This commit is contained in:
Pesakitan22 2018-04-16 15:11:42 +07:00
parent d2a52cf1ef
commit 27279b9114
6 changed files with 20 additions and 1 deletions

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"python.linting.enabled": false
}

View file

@ -113,6 +113,9 @@ def do_play_card(bot, player, result_id):
if game.players_won is 0: if game.players_won is 0:
us.first_places += 1 us.first_places += 1
if game.mode == 'one':
gm.end_game(chat, user)
game.players_won += 1 game.players_won += 1

1
bot.py
View file

@ -594,6 +594,7 @@ def reply_to_query(bot, update):
add_mode_classic(results) add_mode_classic(results)
add_mode_fast(results) add_mode_fast(results)
add_mode_wild(results) add_mode_wild(results)
add_mode_one(results)
else: else:
add_not_started(results) add_not_started(results)

View file

@ -64,7 +64,7 @@ class Game(object):
return players return players
def start(self): 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_() self.deck._fill_classic_()
else: else:
self.deck._fill_wild_() self.deck._fill_wild_()

View file

@ -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): def add_draw(player, results):
"""Add option to draw""" """Add option to draw"""

View file

@ -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 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 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 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.") "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.")