Removed weather counts as they are not used

This commit is contained in:
Kevin Rode 2021-01-04 22:51:22 -05:00
parent 6ebea65a93
commit 4cf5e48910

View File

@ -246,10 +246,8 @@ class game(object):
def get_batter(self):
if self.top_of_inning:
bat_team = self.teams["away"]
counter = self.weather.counter_away
else:
bat_team = self.teams["home"]
counter = self.weather.counter_home
if self.weather.name == "Heavy Snow" and counter == bat_team.lineup_position:
return bat_team.pitcher
@ -586,11 +584,9 @@ class game(object):
result = self.at_bat()
if self.top_of_inning:
offense_team = self.teams["away"]
weather_count = self.weather.counter_away
defense_team = self.teams["home"]
else:
offense_team = self.teams["home"]
weather_count = self.weather.counter_home
defense_team = self.teams["away"]
if self.weather.name == "Slight Tailwind" and "mulligan" not in self.last_update[0].keys() and not result["ishit"] and result["text"] != appearance_outcomes.walk:
@ -693,12 +689,8 @@ class game(object):
for base in self.bases.keys():
self.bases[base] = None
self.outs = 0
if self.top_of_inning and self.weather.name == "Heavy Snow" and self.weather.counter_away < self.teams["away"].lineup_position:
self.weather.counter_away = self.pitcher_insert(self.teams["away"])
if not self.top_of_inning:
if self.weather.name == "Heavy Snow" and self.weather.counter_home < self.teams["home"].lineup_position:
self.weather.counter_home = self.pitcher_insert(self.teams["home"])
self.inning += 1
if self.inning > self.max_innings and self.teams["home"].score != self.teams["away"].score: #game over
self.over = True
@ -901,8 +893,6 @@ class weather(object):
def __init__(self, new_name, new_emoji):
self.name = new_name
self.emoji = new_emoji
self.counter_away = 0
self.counter_home = 0
def __str__(self):
return f"{self.emoji} {self.name}"