implemented drizzle
This commit is contained in:
parent
48897d8cb1
commit
9a22860ad8
10
games.py
10
games.py
|
@ -35,7 +35,9 @@ def all_weathers():
|
||||||
#"Slight Tailwind": weather("Slight Tailwind", "🏌️♀️"),
|
#"Slight Tailwind": weather("Slight Tailwind", "🏌️♀️"),
|
||||||
"Heavy Snow": weather("Heavy Snow", "❄"),
|
"Heavy Snow": weather("Heavy Snow", "❄"),
|
||||||
"Twilight" : weather("Twilight", "👻"),
|
"Twilight" : weather("Twilight", "👻"),
|
||||||
"Thinned Veil" : weather("Thinned Veil", "🌌")
|
"Thinned Veil" : weather("Thinned Veil", "🌌"),
|
||||||
|
"Heat Wave" : weather("Heat Wave", "🌄"),
|
||||||
|
"Drizzle" : weather("Drizzle", "🌧")
|
||||||
}
|
}
|
||||||
return weathers_dic
|
return weathers_dic
|
||||||
|
|
||||||
|
@ -655,6 +657,12 @@ class game(object):
|
||||||
self.over = True
|
self.over = True
|
||||||
self.top_of_inning = not self.top_of_inning
|
self.top_of_inning = not self.top_of_inning
|
||||||
|
|
||||||
|
if self.weather.name == "Drizzle":
|
||||||
|
if self.top_of_inning:
|
||||||
|
self.bases[2] = self.teams["away"].lineup[(self.teams["away"].lineup_position-1) % len(self.teams["away"].lineup)]
|
||||||
|
else:
|
||||||
|
self.bases[2] = self.teams["home"].lineup[(self.teams["home"].lineup_position-1) % len(self.teams["home"].lineup)]
|
||||||
|
|
||||||
def pitcher_insert(self, this_team):
|
def pitcher_insert(self, this_team):
|
||||||
rounds = math.ceil(this_team.lineup_position / len(this_team.lineup))
|
rounds = math.ceil(this_team.lineup_position / len(this_team.lineup))
|
||||||
position = random.randint(0, len(this_team.lineup)-1)
|
position = random.randint(0, len(this_team.lineup)-1)
|
||||||
|
|
|
@ -172,11 +172,17 @@ def update_loop():
|
||||||
state["batter"] = "-"
|
state["batter"] = "-"
|
||||||
elif this_game.top_of_inning:
|
elif 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!"
|
||||||
|
if this_game.weather.name == "Drizzle":
|
||||||
|
state["update_emoji"] = "🌧"
|
||||||
|
state["update_text"] += f' Due to inclement weather, {this_game.teams["away"].lineup[(this_game.teams["away"].lineup_position-1) % len(this_game.teams["away"].lineup)].name} is placed on second base.'
|
||||||
else:
|
else:
|
||||||
if this_game.inning >= this_game.max_innings:
|
if this_game.inning >= this_game.max_innings:
|
||||||
if this_game.teams["home"].score > this_game.teams["away"].score:
|
if this_game.teams["home"].score > this_game.teams["away"].score:
|
||||||
this_game.victory_lap = True
|
this_game.victory_lap = True
|
||||||
state["update_text"] = f"Bottom of {this_game.inning}. {this_game.teams['home'].name} batting!"
|
state["update_text"] = f"Bottom of {this_game.inning}. {this_game.teams['home'].name} batting!"
|
||||||
|
if this_game.weather.name == "Drizzle":
|
||||||
|
state["update_emoji"] = "🌧"
|
||||||
|
state["update_text"] += f' Due to inclement weather, {this_game.teams["home"].lineup[(this_game.teams["home"].lineup_position-1) % len(this_game.teams["home"].lineup)].name} is placed on second base.'
|
||||||
|
|
||||||
elif state["update_pause"] != 1 and test_string != "Game not started.":
|
elif state["update_pause"] != 1 and test_string != "Game not started.":
|
||||||
if "steals" in this_game.last_update[0].keys():
|
if "steals" in this_game.last_update[0].keys():
|
||||||
|
|
Loading…
Reference in a new issue