Ejemplo n.º 1
0
 def post(self, pl_dict):
     picked_cards = len(self.chosen_players)
     if picked_cards < 2 and not self.action_complete:
         #If 0 exists in pl_dict, it implies that the player did not chose
         #to do nothing.
         if 0 in pl_dict:
             player_no = int(pl_dict[0])
             if player_no not in self.chosen_players:
                 self.chosen_players.append(player_no)
             name = self.game_state.players[player_no].first_name
             if picked_cards < 1:
                 msg = ("You have picked {}'s card. ".format(name) +
                        "Pick a second card to switch.")
                 bot.send_text_message(self.id, msg)
                 carousel = player_carousel(self, 'switch')
                 bot.send_generic_message(self.id, carousel)
             else:
                 msg = ("You have picked {}'s card. ".format(name) +
                        "The cards you have chosen will be switched.")
                 bot.send_text_message(self.id, msg)
                 self.wait()
                 self.action_complete = True
         else:
             msg = "You have decided to not cause trouble."
             bot.send_text_message(self.id, msg)
             self.wait()
             self.action_complete = True
     else:
         msg = "You have already completed your action."
         bot.send_text_message(self.id, msg)
         self.wait()
Ejemplo n.º 2
0
 def pre_game(self):
     self.pre_game_bool = True
     msg = ("Look at another player’s card. You are now that role." +
            "(You have {} seconds to complete the action or one will be " +
            "chosen for you.)").format(self.game_state.pre_game_time)
     bot.send_text_message(self.id, msg)
     carousel = player_carousel(self, 'doppel')
     bot.send_generic_message(self.id, carousel)
Ejemplo n.º 3
0
 def __call__(self):
     msg = "Exchange your card with a card from the center"
     bot.send_text_message(self.id, msg)
     payload = player_payload(self, 'drunk')
     element = pick_center_card(payload,
                                title="Pick",
                                subtitle="Exchange your card with a" +
                                " card from the center")
     bot.send_generic_message(self.id, element)
Ejemplo n.º 4
0
    def _choose(self, pl_dict):
        if not self.choice:
            self.choice = pl_dict.get('title')
            if self.choice == "Player's Card":
                bot.send_text_message(self.id, "Look at another player's card")
                carousel = player_carousel(self, 'spy')
                bot.send_generic_message(self.id, carousel)
            else:
                self.peeker.max_peeks = 2
                self.peeker()

        else:
            bot.send_text_message(self.id, "You have already chosen an action")
Ejemplo n.º 5
0
 def kill(self):
     self.dead = True
     bot.send_text_message(self.id, "Kill another player!")
     carousel = player_carousel(self, 'kill')
     bot.send_generic_message(self.id, carousel)
Ejemplo n.º 6
0
 def __call__(self):
     msg = ("You may exchange cards between two other players. " +
            "Pick the first card or choose to do nothing")
     bot.send_text_message(self.id, msg)
     carousel = player_carousel(self, 'switch', do_nothing=True)
     bot.send_generic_message(self.id, carousel)
Ejemplo n.º 7
0
 def __call__(self):
     msg = ("You may exchange your card with another player’s card," +
            " and then view your new card.")
     bot.send_text_message(self.id, msg)
     carousel = player_carousel(self, 'rob', do_nothing=True)
     bot.send_generic_message(self.id, carousel)
Ejemplo n.º 8
0
 def request(self):
     payload = player_payload(self.player, 'peek')
     element = pick_center_card(payload,
                                title="Peek",
                                subtitle="Look at a card in the center")
     bot.send_generic_message(self.player.id, element)
Ejemplo n.º 9
0
 def vote(self):
     bot.send_text_message(self.id, "Vote to kill the werewolf!")
     carousel = player_carousel(self, 'vote')
     bot.send_generic_message(self.id, carousel)