コード例 #1
0
 public function work(Player $interactedPlayer)
 {
     if (FreedomDive::getInstance()->getWorldManagerByWorldFolderName($this->worldName)->canJoinGame()) {
         $interactedPlayer->teleport(Server::getInstance()->getLevelByName($this->worldName)->getSpawnLocation());
         FreedomDive::getInstance()->getWorldManagerByWorldFolderName($this->worldName)->onPlayerMoveToWorld($interactedPlayer);
     } else {
         $interactedPlayer->sendMessage(FreedomDive::getTranslation("CANNOT_JOIN"));
     }
 }
コード例 #2
0
 public function getTip()
 {
     switch ($this->currentStatus) {
         case self::STATUS_NOT_STARTED:
             return TextFormat::GREEN . FreedomDive::getTranslation("WAITING_FOR_PLAYERS", count($this->player), FreedomDive::getInstance()->getConfiguration("NEED_PLAYERS"));
         case self::STATUS_PREPARING:
             $time = (FreedomDive::getInstance()->getConfiguration("PREPARATION_TERM") - $this->roundTick) / 20;
             return TextFormat::GREEN . FreedomDive::getTranslation("PREPARING", round($time / 60), $time % 60);
         case self::STATUS_INGAME:
             $time = (FreedomDive::getInstance()->getConfiguration("GAME_TERM") - $this->roundTick) / 20;
             return TextFormat::AQUA . FreedomDive::getTranslation("GAME_MESSAGE", round($time / 60), $time % 60, $this->aliveCount);
         default:
             return "";
     }
 }