public function fire() { $client = $this->client; foreach ($this->game->getLivingPlayers() as $player) { if (!strstr($this->chosenUserId, $player->getId())) { continue; } if ($player->role == Role::WEREWOLF || $player->role == Role::LYCAN) { $msg = "@{$player->getUsername()} на стороне Оборотней."; } else { $msg = "@{$player->getUsername()} на стороне Крестьян."; } $this->client->getDMById($this->channel)->then(function (DirectMessageChannel $dmc) use($client, $msg) { $this->client->send($msg, $dmc); }); $this->game->setSeerSeen(true); $this->gameManager->changeGameState($this->game->getId(), GameState::DAY); return; } $this->client->getDMById($this->channel)->then(function (DirectMessageChannel $dmc) use($client) { $this->client->send("Не вижу такого чела, а он с какого района?", $dmc); }); }
public function fire() { $client = $this->client; foreach ($this->game->getLivingPlayers() as $player) { if (!strstr($this->chosenUserId, $player->getId())) { continue; } if ($player->role == Role::WEREWOLF || $player->role == Role::LYCAN) { $msg = "@{$player->getUsername()} is on the side of the Werewolves."; } else { $msg = "@{$player->getUsername()} is on the side of the Villagers."; } $this->client->getDMById($this->channel)->then(function (DirectMessageChannel $dmc) use($client, $msg) { $this->client->send($msg, $dmc); }); $this->game->setSeerSeen(true); $this->gameManager->changeGameState($this->game->getId(), GameState::DAY); return; } $this->client->getDMById($this->channel)->then(function (DirectMessageChannel $dmc) use($client) { $this->client->send("Could not find the user you asked for.", $dmc); }); }
public function fire() { $client = $this->client; foreach ($this->game->getLivingPlayers() as $player) { if (!strstr($this->chosenUserId, $player->getId())) { continue; } if ($player->role == Role::WEREWOLF || $player->role == Role::LYCAN) { $msg = "@{$player->getUsername()} est dans le camp des Loups-Garous."; } else { $msg = "@{$player->getUsername()} est dans le camp des Villageois."; } $this->client->getDMById($this->channel)->then(function (DirectMessageChannel $dmc) use($client, $msg) { $this->client->send($msg, $dmc); }); $this->game->setSeerSeen(true); $this->gameManager->changeGameState($this->game->getId(), GameState::DAY); return; } $this->client->getDMById($this->channel)->then(function (DirectMessageChannel $dmc) use($client) { $this->client->send("Impossible de trouver le joueur que vous avez demandé.", $dmc); }); }