finished implementing downpour
This commit is contained in:
parent
a1c3bf4108
commit
f0026a4de8
10
weather.py
10
weather.py
|
@ -1,5 +1,4 @@
|
||||||
import random
|
import random, math, roman
|
||||||
import math
|
|
||||||
from gametext import appearance_outcomes, base_string
|
from gametext import appearance_outcomes, base_string
|
||||||
|
|
||||||
class Weather:
|
class Weather:
|
||||||
|
@ -375,14 +374,15 @@ class Tornado(Weather):
|
||||||
|
|
||||||
class Downpour(Weather):
|
class Downpour(Weather):
|
||||||
def __init__(self, game):
|
def __init__(self, game):
|
||||||
self.name = "Torrential Downpour"
|
|
||||||
self.emoji = '⛈'
|
|
||||||
self.target = game.max_innings
|
self.target = game.max_innings
|
||||||
|
self.name = f"Torrential Downpour: {roman.roman_convert(str(self.target))}"
|
||||||
|
self.emoji = '⛈'
|
||||||
|
|
||||||
|
|
||||||
def on_flip_inning(self, game):
|
def on_flip_inning(self, game):
|
||||||
high_score = game.teams["home"].score if game.teams["home"].score > game.teams["away"].score else game.teams["away"].score
|
high_score = game.teams["home"].score if game.teams["home"].score > game.teams["away"].score else game.teams["away"].score
|
||||||
if high_score >= self.target and game.teams["home"].score != game.teams["away"].score:
|
if high_score >= self.target and game.teams["home"].score != game.teams["away"].score:
|
||||||
game.max_innings = 0
|
game.max_innings = game.inning
|
||||||
else:
|
else:
|
||||||
game.max_innings = game.inning + 1
|
game.max_innings = game.inning + 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue