Example #1
0
 private function onFirstNight(Game $game)
 {
     $client = $this->client;
     foreach ($game->getPlayers() as $player) {
         $client->getDMByUserId($player->getId())->then(function (DirectMessageChannel $dmc) use($client, $player, $game) {
             $client->send("Your role is {$player->role}", $dmc);
             if ($player->role == Role::WEREWOLF) {
                 if ($game->getNumRole(Role::WEREWOLF) > 1) {
                     $werewolves = PlayerListFormatter::format($game->getPlayersOfRole(Role::WEREWOLF));
                     $client->send("The other werewolves are: {$werewolves}", $dmc);
                 } else {
                     $client->send("You are the only werewolf.", $dmc);
                 }
             }
             if ($player->role == Role::SEER) {
                 $client->send("Seer, select a player by saying !see #channel @username.", $dmc);
             }
         });
     }
     $playerList = PlayerListFormatter::format($game->getPlayers());
     $roleList = RoleListFormatter::format($game->getPlayers());
     $msg = ":wolf: A new game of Werewolf is starting! For a tutorial, type !help.\r\n\r\n";
     $msg .= "Players: {$playerList}\r\n";
     $msg .= "Roles: {$roleList}\r\n\r\n";
     $msg .= ":crescent_moon: :zzz: It is the middle of the night and the village is sleeping. The game will begin when the Seer chooses someone.";
     $this->client->getChannelGroupOrDMByID($game->getId())->then(function (Channel $channel) use($msg, $client) {
         $client->send($msg, $channel);
     });
 }
Example #2
0
 private function onFirstNight(Game $game)
 {
     $client = $this->client;
     foreach ($game->getLivingPlayers() as $player) {
         $client->getDMByUserId($player->getId())->then(function (DirectMessageChannel $dmc) use($client, $player, $game) {
             $client->send("Vous êtes {$player->role}", $dmc);
             if ($player->role == Role::WEREWOLF) {
                 if ($game->getNumRole(Role::WEREWOLF) > 1) {
                     $werewolves = PlayerListFormatter::format($game->getPlayersOfRole(Role::WEREWOLF));
                     $client->send("Les Loups-Garous sont : {$werewolves}", $dmc);
                 } else {
                     $client->send("Vous êtes le seul Loup-Garou.", $dmc);
                 }
             }
             if ($player->role == Role::SEER) {
                 $client->send("C'est à votre tour ! Espionnez un joueur en tapant !see #channel @joueur.\r\nNE DITES PAS PENDANT LA NUIT CE QUE VOUS AVEZ VU, PARLEZ UNIQUEMENT PENDANT LE JOUR ET SI VOUS N'ÊTES PAS MORT(E) !", $dmc);
             }
             if ($player->role == Role::BEHOLDER) {
                 $seers = $game->getPlayersOfRole(Role::SEER);
                 $seers = PlayerListFormatter::format($seers);
                 $client->send("La Voyante est: {$seers}", $dmc);
             }
         });
     }
     $playerList = PlayerListFormatter::format($game->getLivingPlayers());
     $roleList = RoleListFormatter::format($game->getLivingPlayers());
     $msg = ":wolf: Une nouvelle partie de Loups-Garous a commencé ! Pour un tutoriel, tapez !help.\r\n\r\n";
     $msg .= "Joueurs: {$playerList}\r\n";
     $msg .= "Rôles possibles: {$game->getRoleStrategy()->getRoleListMsg()}\r\n\r\n";
     if ($this->optionsManager->getOptionValue(OptionName::role_seer)) {
         $msg .= ":crescent_moon: :zzz: C'est la nuit, le village dort.";
         $msg .= " La partie commencera quand la Voyante aura sondé quelqu'un.";
     }
     $this->sendMessageToChannel($game, $msg);
     if (!$this->optionsManager->getOptionValue(OptionName::role_seer)) {
         $this->changeGameState($game->getId(), GameState::NIGHT);
     }
 }
Example #3
0
 private function onFirstNight(Game $game)
 {
     $client = $this->client;
     foreach ($game->getLivingPlayers() as $player) {
         $client->getDMByUserId($player->getId())->then(function (DirectMessageChannel $dmc) use($client, $player, $game) {
             $client->send("Your role is {$player->role}", $dmc);
             if ($player->role == Role::WEREWOLF) {
                 if ($game->getNumRole(Role::WEREWOLF) > 1) {
                     $werewolves = PlayerListFormatter::format($game->getPlayersOfRole(Role::WEREWOLF));
                     $client->send("The werewolves are: {$werewolves}", $dmc);
                 } else {
                     $client->send("You are the only werewolf.", $dmc);
                 }
             }
             if ($player->role == Role::SEER) {
                 $client->send("Seer, select a player by saying !see #channel @username.\r\nDO NOT DISCUSS WHAT YOU SEE DURING THE NIGHT, ONLY DISCUSS DURING THE DAY IF YOU ARE NOT DEAD!", $dmc);
             }
             if ($player->role == Role::BEHOLDER) {
                 $seers = $game->getPlayersOfRole(Role::SEER);
                 $seers = PlayerListFormatter::format($seers);
                 $client->send("The seer is: {$seers}", $dmc);
             }
         });
     }
     $playerList = PlayerListFormatter::format($game->getLivingPlayers());
     $roleList = RoleListFormatter::format($game->getLivingPlayers());
     $msg = ":wolf: A new game of Werewolf is starting! For a tutorial, type !help.\r\n\r\n";
     $msg .= "Players: {$playerList}\r\n";
     $msg .= "Possible Roles: {$game->getRoleStrategy()->getRoleListMsg()}\r\n\r\n";
     if ($this->optionsManager->getOptionValue(OptionName::role_seer)) {
         $msg .= ":crescent_moon: :zzz: It is the middle of the night and the village is sleeping.";
         $msg .= " The game will begin when the Seer chooses someone.";
     }
     $this->sendMessageToChannel($game, $msg);
     if (!$this->optionsManager->getOptionValue(OptionName::role_seer)) {
         $this->changeGameState($game->getId(), GameState::NIGHT);
     }
 }
Example #4
0
 private function onFirstNight(Game $game)
 {
     $client = $this->client;
     foreach ($game->getLivingPlayers() as $player) {
         $client->getDMByUserId($player->getId())->then(function (DirectMessageChannel $dmc) use($client, $player, $game) {
             $client->send("Ты у нас будешь {$player->role}", $dmc);
             if ($player->role == Role::WEREWOLF) {
                 if ($game->getNumRole(Role::WEREWOLF) > 1) {
                     $werewolves = PlayerListFormatter::format($game->getPlayersOfRole(Role::WEREWOLF));
                     $client->send("В этой игре Оборотни: {$werewolves}", $dmc);
                 } else {
                     $client->send("В этой игре ты единственный Оборотень.", $dmc);
                 }
             }
             if ($player->role == Role::SEER) {
                 $client->send("Смотритель, выбери игрока !see #channel @username.\r\nВНИМАНИЕ! ДЕРЖИ ЯЗЫК ЗА ЗУБАМИ ДО УТРА, А ЕСЛИ УМЕР ЛУЧШЕ ВООБЩЕ ПОМОЛЧИ!1111", $dmc);
             }
             if ($player->role == Role::BEHOLDER) {
                 $seers = $game->getPlayersOfRole(Role::SEER);
                 $seers = PlayerListFormatter::format($seers);
                 $client->send("Смотрители: {$seers}", $dmc);
             }
         });
     }
     $playerList = PlayerListFormatter::format($game->getLivingPlayers());
     $roleList = RoleListFormatter::format($game->getLivingPlayers());
     $msg = ":wolf: Новая игра в Оборотня начинается! Если не знаешь правил пиши !help.\r\n\r\n";
     $msg .= "ВАЖНО! Главное разобраться какие сообщения писать в общий чат, а какие в личку боту.\r\n\r\n";
     $msg .= "Если кратко: все действия, связанные с ролями идут в личку. Голосование днем и обсуждение - в общий чат. \r\n\r\n";
     $msg .= "Игроки: {$playerList}\r\n";
     $msg .= "Возможные роли: {$game->getRoleStrategy()->getRoleListMsg()}\r\n\r\n";
     if ($this->optionsManager->getOptionValue(OptionName::role_seer)) {
         $msg .= ":crescent_moon: :zzz: Наступает ночь, крестьяне выпили чарку, съели шкварку и идут спать. ";
         $msg .= "Игра начнется как только Смотритель выберет кого-то.";
     }
     $this->sendMessageToChannel($game, $msg);
     if (!$this->optionsManager->getOptionValue(OptionName::role_seer)) {
         $this->changeGameState($game->getId(), GameState::NIGHT);
     }
 }