added the ability to modify game end messages on site
This commit is contained in:
parent
ca9270e2bf
commit
56ffbc1888
|
@ -172,6 +172,8 @@ def update_loop():
|
||||||
state["update_text"] = f"{winning_team} wins!"
|
state["update_text"] = f"{winning_team} wins!"
|
||||||
state["pitcher"] = "-"
|
state["pitcher"] = "-"
|
||||||
state["batter"] = "-"
|
state["batter"] = "-"
|
||||||
|
|
||||||
|
this_game.weather.modify_game_end_message(this_game, state)
|
||||||
else:
|
else:
|
||||||
if this_game.top_of_inning:
|
if this_game.top_of_inning:
|
||||||
state["update_text"] = f"Top of {this_game.inning}. {this_game.teams['away'].name} batting!"
|
state["update_text"] = f"Top of {this_game.inning}. {this_game.teams['away'].name} batting!"
|
||||||
|
|
11
weather.py
11
weather.py
|
@ -39,6 +39,9 @@ class Weather:
|
||||||
def modify_gamestate(self, game, state):
|
def modify_gamestate(self, game, state):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def modify_game_end_message(self, game, state):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Supernova(Weather):
|
class Supernova(Weather):
|
||||||
def __init__(self, game):
|
def __init__(self, game):
|
||||||
|
@ -388,6 +391,14 @@ class Downpour(Weather):
|
||||||
|
|
||||||
def modify_gamestate(self, game, state):
|
def modify_gamestate(self, game, state):
|
||||||
state["max_innings"] = "∞"
|
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():
|
def all_weathers():
|
||||||
|
|
Loading…
Reference in a new issue