RuneHive-Game
Loading...
Searching...
No Matches
LMSGameEvent.java
Go to the documentation of this file.
1package com.runehive.content.lms;
2
3import com.runehive.content.lms.crate.LMSCrate;
4import com.runehive.content.lms.lobby.LMSLobby;
5import com.runehive.game.task.Task;
6
7public class LMSGameEvent extends Task {
8
9 public LMSGameEvent() {
10 super(1);
11 }
12
13 @Override
14 protected void execute() {
15 if(!LMSGame.gameInProgress) return;
16
18 LMSGame.gamePlayers.stream().forEach(player -> LMSGame.processPlayer(player));
19
22
23 if (LMSGame.crateTicks == 300) {
25 if(LMSGame.lmsCrate == null)
27 }
28
29 if(LMSGame.gameTicks == 100)
31
32 if (LMSGame.gameTicks >= 100)
34
35 if (--LMSGame.startingTicks >= 0) {
36 if (LMSGame.startingTicks > 0)
37 LMSGame.gamePlayers.stream().forEach(player -> player.speak(LMSGame.startingTicks + ".."));
38 else if (LMSGame.startingTicks == 0) {
39 LMSGame.gamePlayers.stream().forEach(player -> player.speak("FIGHT!"));
40 LMSGame.canAttack = true;
41 }
42 }
43 }
44
45}
void execute()
A function representing the unit of work that will be carried out.
static LMSCrate lmsCrate
The lms crate within the game.
Definition LMSGame.java:80
static void updateInterface()
Handles updating the player's there interface.
Definition LMSGame.java:560
static void processPlayer(Player player)
Handles processing the player if hes a active player within the LMS game.
Definition LMSGame.java:498
static boolean canAttack
Checks if the players are allowed to attack within the game.
Definition LMSGame.java:53
static int crateTicks
The current amount of crate ticks within the lms game.
Definition LMSGame.java:75
static List< Player > gamePlayers
All the players within the LMS game.
Definition LMSGame.java:43
static int gameTicks
The current amount of game ticks within the lms game.
Definition LMSGame.java:65
static int startingTicks
The amount of ticks before the real game starts.
Definition LMSGame.java:70
static boolean gameInProgress
Checks if there is currently a game in progress.
Definition LMSGame.java:48
static void handleFog()
Handles the fog closing in on the save zone.
Definition LMSGame.java:539
static void setupSafezone()
Handles setting up the safezone.
Definition LMSGame.java:464
Task(boolean instant, int delay)
Creates a new Task.
Definition Task.java:41