added the ability to modify game end messages on site

This commit is contained in:
Sakimori 2021-03-03 18:26:21 -05:00
parent ca9270e2bf
commit 56ffbc1888
2 changed files with 13 additions and 0 deletions

View file

@ -172,6 +172,8 @@ def update_loop():
state["update_text"] = f"{winning_team} wins!"
state["pitcher"] = "-"
state["batter"] = "-"
this_game.weather.modify_game_end_message(this_game, state)
else:
if this_game.top_of_inning:
state["update_text"] = f"Top of {this_game.inning}. {this_game.teams['away'].name} batting!"

View file

@ -39,6 +39,9 @@ class Weather:
def modify_gamestate(self, game, state):
pass
def modify_game_end_message(self, game, state):
pass
class Supernova(Weather):
def __init__(self, game):
@ -389,6 +392,14 @@ class Downpour(Weather):
def modify_gamestate(self, game, state):
state["max_innings"] = ""
def modify_top_of_inning_message(self, game, state):
state["update_emoji"] = self.emoji
state["update_text"] = "The gods are not yet pleased. Play continues through the storm."
def modify_game_end_message(self, game, state):
state["update_emoji"] = self.emoji
state["update_text"] = f"{self.target} runs are reached, pleasing the gods. The storm clears."
def all_weathers():
weathers_dic = {