From 2ec0efefc9403c055fcff1c8499bbd3fe7bb0b70 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Wed, 23 Dec 2020 18:02:55 -0500 Subject: [PATCH] fix soulscream display bug, fixed sac fly runs not scoring properly --- games.py | 2 +- onomancer.py | 2 +- the_prestige.py | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/games.py b/games.py index 84c326c..987d3c3 100644 --- a/games.py +++ b/games.py @@ -212,11 +212,11 @@ class game(object): return runs elif "advance" in outcome.keys(): + runs = 0 if self.bases[3] is not None: self.bases[3] = None runs = 1 if self.bases[2] is not None: - runs = 0 run_roll = random.gauss(math.erf(random_star_gen("baserunning_stars", self.bases[2])-def_stat)-.5,1.5) if run_roll > 0: self.bases[3] = self.bases[2] diff --git a/onomancer.py b/onomancer.py index f327689..7b5e380 100644 --- a/onomancer.py +++ b/onomancer.py @@ -24,6 +24,6 @@ def get_scream(username): if scream is not None: return scream else: - scream = get_stats(username)["soulscream"] + scream = json.loads(get_stats(username))["soulscream"] db.cache_soulscream(username, scream) return scream \ No newline at end of file diff --git a/the_prestige.py b/the_prestige.py index 9ba05bb..216509d 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -88,16 +88,16 @@ async def on_message(msg): if len(player_name) >= 70: await msg.channel.send("That name is too long. Please keep it below 70 characters, for my sake and yours.") return - #try: - player_json = ono.get_stats(player_name) - db.designate_player(msg.author, json.loads(player_json)) - if not meme: - await msg.channel.send(f"{player_name} is now your idol.") - else: - await msg.channel.send(f"{player_name} is now {msg.author.display_name}'s idol.") - await msg.channel.send(f"Reply if {player_name} is your idol also.") - #except: - #await msg.channel.send("Something went wrong. Tell 16.") + try: + player_json = ono.get_stats(player_name) + db.designate_player(msg.author, json.loads(player_json)) + if not meme: + await msg.channel.send(f"{player_name} is now your idol.") + else: + await msg.channel.send(f"{player_name} is now {msg.author.display_name}'s idol.") + await msg.channel.send(f"Reply if {player_name} is your idol also.") + except: + await msg.channel.send("Something went wrong. Tell 16.") elif command == "showidol": try: