From aabab8bfba14ed6706e8872c0275a4377115de5d Mon Sep 17 00:00:00 2001 From: Sakimori Date: Thu, 25 Feb 2021 16:16:00 -0500 Subject: [PATCH 1/7] added new pledge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8845f64..801cd8c 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,7 @@ these folks are helping me a *ton* via patreon, and i cannot possibly thank them - iliana etaoin - yooori - Bend +- ALC ## Attribution From fe774411a07d4a879612864a64804bcac64f7098 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Thu, 25 Feb 2021 17:13:14 -0500 Subject: [PATCH 2/7] implemented starlight weather --- weather.py | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/weather.py b/weather.py index 49a5d73..bfd6beb 100644 --- a/weather.py +++ b/weather.py @@ -60,12 +60,6 @@ class SlightTailwind(Weather): self.emoji = "🏌️‍♀️" def activate(self, game, result): - if game.top_of_inning: - offense_team = game.teams["away"] - defense_team = game.teams["home"] - else: - offense_team = game.teams["home"] - defense_team = game.teams["away"] if "mulligan" not in game.last_update[0].keys() and not result["ishit"] and result["text"] != appearance_outcomes.walk: mulligan_roll_target = -((((game.get_batter().stlats["batting_stars"])-5)/6)**2)+1 @@ -78,6 +72,37 @@ class SlightTailwind(Weather): "weather_message": True, }) +class Starlight(Weather): + def __init__(self, game): + self.name = "Starlight" + self.emoji = "🌃" + + def activate(self, game, result): + + if (result["text"] == appearance_outcomes.homerun or result["text"] == appearance_outcomes.grandslam): + result["weather_message"] = True + dinger_roll = random.random() + if "dragon" in game.get_batter().name.lower(): + result["dragin_the_park"] = True + + elif dinger_roll < 0.941: + result.clear() + result.update({ + "text": f"{game.get_batter()} hits a dinger, but the stars do not approve! The ball pulls foul.", + "text_only": True + }) + else: + result["in_the_park"] = True + + + def modify_atbat_message(self, game, state): + result = game.last_update[0] + if "in_the_park" in result.keys(): + state["update_text"] = f"The stars are pleased with {result['batter']}, and allow a dinger! {game.last_update[1]} runs scored!" + elif "dragin_the_park" in result.keys(): + state["update_text"] = f"The stars enjoy watching dragons play baseball, and allow {result['batter']} to hit a dinger! {game.last_update[1]} runs scored!" + + class HeavySnow(Weather): def __init__(self, game): self.name = "Heavy Snow" @@ -278,7 +303,8 @@ def all_weathers(): "Thinned Veil" : ThinnedVeil, "Heat Wave" : HeatWave, "Drizzle" : Drizzle, - "Breezy": Breezy + "Breezy": Breezy, + "Starlight" : Starlight } return weathers_dic From bd0a1af03eef3dc80cabd04712d5481806be2341 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Thu, 25 Feb 2021 19:27:11 -0500 Subject: [PATCH 3/7] implemented meteor shower --- games.py | 7 +++++++ weather.py | 30 +++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/games.py b/games.py index f38ffeb..88a22be 100644 --- a/games.py +++ b/games.py @@ -225,6 +225,13 @@ class game(object): self.weather = weather.Weather(self) self.current_batter = None + def occupied_bases(self): + occ_dic = {} + for base in self.bases.keys(): + if self.bases[base] is not None: + occ_dic[base] = self.bases[base] + return occ_dic + def choose_next_batter(self): if self.top_of_inning: bat_team = self.teams["away"] diff --git a/weather.py b/weather.py index bfd6beb..a1f7bf1 100644 --- a/weather.py +++ b/weather.py @@ -293,6 +293,33 @@ class Breezy(Weather): "weather_message": True }) +class MeteorShower(Weather): + def __init__(self, game): + self.name = "Meteor Shower" + self.emoji = "🌠" + self.activation_chance = 1 + + def activate(self, game, result): + if random.random() < self.activation_chance and game.occupied_bases() != {}: + base, runner = random.choice(list(game.occupied_bases().items())) + runner = game.bases[base] + game.bases[base] = None + + if game.top_of_inning: + bat_team = game.teams["away"] + else: + bat_team = game.teams["home"] + + bat_team.score += 1 + result.clear() + result.update({ + "text": f"{runner.name} wished upon one of the shooting stars, and was warped to None base!! 1 runs score!", + "text_only": True, + "weather_message": True + }) + + + def all_weathers(): weathers_dic = { "Supernova" : Supernova, @@ -304,7 +331,8 @@ def all_weathers(): "Heat Wave" : HeatWave, "Drizzle" : Drizzle, "Breezy": Breezy, - "Starlight" : Starlight + "Starlight" : Starlight, + "Meteor Shower" : MeteorShower } return weathers_dic From 65fde63898a9401da31eb59adeb9c7a9c069501f Mon Sep 17 00:00:00 2001 From: Sakimori Date: Thu, 25 Feb 2021 19:30:36 -0500 Subject: [PATCH 4/7] made meteor shower not 100% --- weather.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weather.py b/weather.py index a1f7bf1..7e076a0 100644 --- a/weather.py +++ b/weather.py @@ -297,7 +297,7 @@ class MeteorShower(Weather): def __init__(self, game): self.name = "Meteor Shower" self.emoji = "🌠" - self.activation_chance = 1 + self.activation_chance = 0.13 def activate(self, game, result): if random.random() < self.activation_chance and game.occupied_bases() != {}: From 05d2f80107acf1b05263d108f1af73180da5946d Mon Sep 17 00:00:00 2001 From: Sakimori Date: Sat, 27 Feb 2021 16:26:56 -0500 Subject: [PATCH 5/7] fixed help template for division standings --- the_prestige.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/the_prestige.py b/the_prestige.py index 9b147fc..d49a911 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -919,7 +919,7 @@ class LeagueLeadersCommand(Command): class LeagueDivisionDisplayCommand(Command): name = "divisionstandings" - template = "m;divisionstandings [league name]\n[team name]" + template = "m;divisionstandings [league name]\n[division name]" description = "Displays the current standings for the given division in the given league." async def execute(self, msg, command): From 44fda5691e308e1501aee73a851b05aa4dc8a9a3 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Sat, 27 Feb 2021 16:40:57 -0500 Subject: [PATCH 6/7] fixed oblstandings display --- the_prestige.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/the_prestige.py b/the_prestige.py index d49a911..37c9646 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -1251,15 +1251,15 @@ class OBLLeaderboardCommand(Command): async def execute(self, msg, command): leaders_list = db.obl_leaderboards()[:15] - leaders = {} + leaders = [] rank = 1 for team, points in leaders_list: - leaders[team] = {"rank" : rank, "points" : points} + leaders.append({"name" : team, "points" : points}) rank += 1 embed = discord.Embed(color=discord.Color.red(), title="The One Big League") - for team in leaders.keys(): - embed.add_field(name=f"{leaders[team]['rank']}. {team}", value=f"{leaders[team]['points']} points" , inline = False) + for index in range(0, len(leaders)): + embed.add_field(name=f"{index+1}. {leaders[index]['name']}", value=f"{leaders[index]['points']} points" , inline = False) await msg.channel.send(embed=embed) class OBLTeamCommand(Command): From b8b29886b093e9619c5ea3929841050144024ac2 Mon Sep 17 00:00:00 2001 From: Genderdruid Date: Sat, 27 Feb 2021 14:16:23 -0800 Subject: [PATCH 7/7] added descriptions of all old weathers to the readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 801cd8c..12cb7b4 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,20 @@ accepting pull requests, check the issues for to-dos. - m;roman [number] - converts any natural number less than 4,000,000 into roman numerals, this one is just for fun. +## weathers +- all current simsim weathers are listed here with a short description of their effects except for the most recent weathers whose effects remain a mystery. + - supernova 🌟: makes all pitchers pitch worse. + - midnight 🕶: significantly increased the chance that players will attempt to steal a base. + - heavy snow ❄: occasionally causes the team's pitcher to bat in place of the scheduled batter. + - slight tailwind 🏌️‍♀: occasionally batters get a mulligan and start the at bat over if they would have gotten out, significantly more likely to happen for weaker batters. + - thinned veil 🌌: when a player hits a dinger, they end up on the base corresponding to the number of runs the dinger scored, 1st base if it's a solo home run, up to none base if it's a grand slam, resulting in 5 runs scoring. + - twilight 👻: occasionally turns outs into hit by causing the ball to go ethereal, preventing the fielder from catching it. + - drizzle 🌧: causes each inning to start with the previous inning's final batter on second base. + - heat wave 🌄: occasionally causes pitchers to be relieved by a random player from the lineup. + - breezy 🎐: occasionally swaps letters of a player's name, altering their name for the remainder of the game and changing their stats. + - starlight 🌃: current patch weather, effects will be revealed the next time weathers are added. + - meteor shower 🌠: current patch weather, effects will be revealed the next time weathers are added. + ## patreon! these folks are helping me a *ton* via patreon, and i cannot possibly thank them enough: