Example #1
0
 public function onRun($currentTick)
 {
     Server::getInstance()->broadcastTip(TextFormat::DARK_BLUE . "[HungerGames]" . TextFormat::WHITE . " Match will end in " . $this->countdownVal, $this->arena->getPlayers());
     $this->countdownVal--;
     if ($this->countdownVal == 0) {
         $this->arena->onMatchEnd();
     }
 }
Example #2
0
 public function onRun($currentTick)
 {
     $this->arena->setInUse(true);
     $playersOnline = true;
     foreach ($this->arena->players as $player) {
         if (!$this->arena->isOnline($player)) {
             $playersOnline = false;
         }
     }
     if ($playersOnline && $this->countdownVal >= 0) {
         $this->arena->broadcastTip("Match starts in: " . $this->countdownVal);
         $this->arena->inUse = false;
         $this->countdownVal--;
     } else {
         if (!$playersOnline) {
             $this->arena->abortMatch();
         }
     }
     if ($this->countdownVal <= 0) {
         $this->arena->inUse = true;
         $this->arena->onStartCountdownEnd();
         $this->arena->broadcastTip("GO!");
     }
 }
Example #3
0
 /**
  * Reset the arena
  * @param Arena $arena
  */
 public function clearArena(Arena $arena)
 {
     $arena->reset();
     foreach ($arena->players as $player) {
         $player->teleport($this->getLobbySpawn());
         $player->removeAllEffects();
     }
 }