From d5db9ea527afb136ee419a7397aa8a3a055b0982 Mon Sep 17 00:00:00 2001 From: Silvris <58583688+Silvris@users.noreply.github.com> Date: Fri, 31 May 2024 02:11:40 -0500 Subject: [PATCH] deprioritize Time Stopper in rush checks --- worlds/mm2/Rules.py | 4 ++++ worlds/mm2/test/test_weakness.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/worlds/mm2/Rules.py b/worlds/mm2/Rules.py index 33854c220308..33f582d9245a 100644 --- a/worlds/mm2/Rules.py +++ b/worlds/mm2/Rules.py @@ -172,6 +172,10 @@ def set_rules(world: "MM2World") -> None: boss_damage = weapon_boss[boss] weapon_weight = {weapon: (weapon_energy[weapon] / damage) if damage else 0 for weapon, damage in boss_damage.items() if weapon_energy[weapon]} + if any(boss_damage[i] > 0 for i in range(8)): + # We get exactly one use of Time Stopper during the rush + # So we want to make sure that use is absolutely needed + weapon_weight[8] = min(weapon_weight[8], 0.001) while boss_health[boss] > 0: if boss_damage[0]: boss_health[boss] = 0 # if we can buster, we should buster diff --git a/worlds/mm2/test/test_weakness.py b/worlds/mm2/test/test_weakness.py index acdabc6e6ed2..e9a395078bed 100644 --- a/worlds/mm2/test/test_weakness.py +++ b/worlds/mm2/test/test_weakness.py @@ -29,6 +29,10 @@ def validate_wily_5(base: MM2TestBase) -> None: boss_damage = weapon_boss[boss] weapon_weight = {weapon: (weapon_energy[weapon] / damage) if damage else 0 for weapon, damage in boss_damage.items() if weapon_energy[weapon]} + if any(boss_damage[i] > 0 for i in range(8)): + # We get exactly one use of Time Stopper during the rush + # So we want to make sure that use is absolutely needed + weapon_weight[8] = min(weapon_weight[8], 0.001) while boss_health[boss] > 0: if boss_damage[0]: boss_health[boss] = 0 # if we can buster, we should buster