diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..625247d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.linting.enabled": false +} \ No newline at end of file diff --git a/actions.py b/actions.py index 2d5c374..111e633 100644 --- a/actions.py +++ b/actions.py @@ -113,6 +113,9 @@ def do_play_card(bot, player, result_id): if game.players_won is 0: us.first_places += 1 + if game.mode == 'one': + gm.end_game(chat, user) + game.players_won += 1 diff --git a/bot.py b/bot.py index cdd2ae4..70238a2 100644 --- a/bot.py +++ b/bot.py @@ -594,6 +594,7 @@ def reply_to_query(bot, update): add_mode_classic(results) add_mode_fast(results) add_mode_wild(results) + add_mode_one(results) else: add_not_started(results) diff --git a/game.py b/game.py index 3234f9b..5600f96 100644 --- a/game.py +++ b/game.py @@ -64,7 +64,7 @@ class Game(object): return players def start(self): - if self.mode == None or self.mode != "wild": + if self.mode == None or self.mode != "wild" or self.mode != "one": self.deck._fill_classic_() else: self.deck._fill_wild_() diff --git a/results.py b/results.py index 1203154..3f6aab2 100644 --- a/results.py +++ b/results.py @@ -129,6 +129,17 @@ def add_mode_wild(results): ) ) +def add_mode_one(results): + """Change mode to classic""" + results.append( + InlineQueryResultArticle( + "mode_one", + title=_("😐 Saitama mode"), + input_message_content= + InputTextMessageContent(_('One hit Kill? 😐')) + ) + ) + def add_draw(player, results): """Add option to draw""" diff --git a/simple_commands.py b/simple_commands.py index b640141..c81ceac 100644 --- a/simple_commands.py +++ b/simple_commands.py @@ -76,6 +76,7 @@ modes_explanation = ("This UNO bot has three game modes: Classic, Sanic and Wild " 🎻 The Classic mode uses the conventional UNO deck and there is no auto skip.\n" " 🚀 The Sanic mode uses the conventional UNO deck and the bot automatically skips a player if he/she takes too long to play its turn\n" " 🐉 The Wild mode uses a deck with more special cards, less number variety and no auto skip.\n\n" + " 😐 The Saitama mode uses a deck with more special cards, less number variety and no auto skip. But ended with one win.\n\n" "To change the game mode, the GAME CREATOR has to type the bot nickname and a space, just like when playing a card, and all gamemode options should appear.")