new mode
This commit is contained in:
parent
d2a52cf1ef
commit
27279b9114
6 changed files with 20 additions and 1 deletions
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"python.linting.enabled": false
|
||||||
|
}
|
|
@ -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
1
bot.py
|
@ -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)
|
||||||
|
|
||||||
|
|
2
game.py
2
game.py
|
@ -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_()
|
||||||
|
|
11
results.py
11
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):
|
def add_draw(player, results):
|
||||||
"""Add option to draw"""
|
"""Add option to draw"""
|
||||||
|
|
|
@ -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.")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue