public function run() { if ($this->getLevel($this->senderNick) < 10) { return; } $server = Server::getInstance(); $game = MafiaGame::getInstance(); $name = $this->parameters(1, true); if ($name) { MafiaGame::setGameName($name); } MafiaGame::saveGame(); }
/** * * Say status in start of daay * @param boolean $killed is anyone killed */ public function sayStatus($killed = true) { if ($this->checkWinState()) { return; } switch ($this->state) { case MAFIA_TURN: $this->prepareKillVote(); //$this->setMode(self::$LOBBY_ROOM , "+m"); $this->doNight(); $this->drVote = $this->isDrDead(); $this->detectiveVote = $this->isDetectiveDead(); $this->say(self::$MAFIA_ROOM, MafiaGame::bold("Your turn to kill!! use " . MafiaGame::colorize(2, "!kill") . " command to vote")); $this->say(self::$MAFIA_ROOM, MafiaGame::bold("!kill * : for kill nobody")); $this->say(self::$MAFIA_ROOM, MafiaGame::bold("!kill - : for remove your vote")); $this->say(self::$MAFIA_ROOM, MafiaGame::bold("!vote : To see other mafias (and their votes)")); $this->say(self::$MAFIA_ROOM, MafiaGame::bold("!list : To see list of all players")); $this->say(self::$LOBBY_ROOM, MafiaGame::bold("!timeout : To end the night after " . self::$NIGHT_TIMEOUT)); $this->act(self::$LOBBY_ROOM, "Good night ppl ;)"); $this->nightTurnTime = time(); break; case DAY_TURN: $this->preparePunishVote(); //$this->setMode(self::$LOBBY_ROOM , "-m"); $this->doDay(); $this->act(self::$MAFIA_ROOM, "Your turn to hide!!"); if ($killed) { $this->say(self::$LOBBY_ROOM, MafiaGame::bold("Hi ppl, there is a dead! lets find the killer and punish him/her. use " . MafiaGame::colorize(2, "!punish") . " command")); } else { $this->say(self::$LOBBY_ROOM, MafiaGame::bold("Hi ppl, No one dead. peeowh!! either its a doctor's job or mafia trick :D, but who care? use " . MafiaGame::colorize(2, "!punish") . " command")); } $this->say(self::$LOBBY_ROOM, MafiaGame::bold("!punish - : for remove your vote")); $this->say(self::$LOBBY_ROOM, MafiaGame::bold("!vote : To see other people votes")); $this->say(self::$LOBBY_ROOM, MafiaGame::bold("!list : To see list of all players")); $this->say(self::$LOBBY_ROOM, MafiaGame::bold("!voice : If you must have voice and you have no voice, (mostly reconnect problems)")); $this->say(self::$LOBBY_ROOM, MafiaGame::bold("!timeout : To end the day after " . self::$DAY_TIMEOUT . " and 70% of player cast their vote.")); $this->dayTurnTime = time(); break; } MafiaGame::saveGame(); }