From 9ea276cd737e7e6b5116f33b24ef68907e4910f0 Mon Sep 17 00:00:00 2001 From: Jouramie Date: Sun, 1 Dec 2024 20:55:54 -0500 Subject: [PATCH] rename stuff --- worlds/stardew_valley/items.py | 30 +++++++-------- worlds/stardew_valley/logic/walnut_logic.py | 8 ++-- worlds/stardew_valley/options/options.py | 10 ++--- worlds/stardew_valley/options/presets.py | 2 +- worlds/stardew_valley/rules.py | 8 ++-- .../strings/ap_names/ap_option_names.py | 38 +++++++++---------- .../stardew_valley/test/TestWalnutsanity.py | 10 ++--- .../test/options/TestForcedOptions.py | 4 +- 8 files changed, 55 insertions(+), 55 deletions(-) diff --git a/worlds/stardew_valley/items.py b/worlds/stardew_valley/items.py index fe5e9305a294..6ac827f869cc 100644 --- a/worlds/stardew_valley/items.py +++ b/worlds/stardew_valley/items.py @@ -538,16 +538,16 @@ def create_walnuts(item_factory: StardewItemFactory, options: StardewValleyOptio num_penta_walnuts = 1 # https://stardewvalleywiki.com/Golden_Walnut # Totals should be accurate, but distribution is slightly offset to make room for baseline walnuts - if WalnutsanityOptionName.walnutsanity_puzzles in walnutsanity: # 61 + if WalnutsanityOptionName.puzzles in walnutsanity: # 61 num_single_walnuts += 6 # 6 num_triple_walnuts += 5 # 15 num_penta_walnuts += 8 # 40 - if WalnutsanityOptionName.walnutsanity_bushes in walnutsanity: # 25 + if WalnutsanityOptionName.bushes in walnutsanity: # 25 num_single_walnuts += 16 # 16 num_triple_walnuts += 3 # 9 - if WalnutsanityOptionName.walnutsanity_dig_spots in walnutsanity: # 18 + if WalnutsanityOptionName.dig_spots in walnutsanity: # 18 num_single_walnuts += 18 # 18 - if WalnutsanityOptionName.walnutsanity_repeatables in walnutsanity: # 33 + if WalnutsanityOptionName.repeatables in walnutsanity: # 33 num_single_walnuts += 30 # 30 num_triple_walnuts += 1 # 3 @@ -833,27 +833,27 @@ def get_all_filler_items(include_traps: bool, exclude_ginger_island: bool) -> Li def get_allowed_player_buffs(buff_option: EnabledFillerBuffs) -> List[ItemData]: allowed_buffs = [] - if BuffOptionName.buff_luck in buff_option: + if BuffOptionName.luck in buff_option: allowed_buffs.append(item_table[Buff.luck]) - if BuffOptionName.buff_damage in buff_option: + if BuffOptionName.damage in buff_option: allowed_buffs.append(item_table[Buff.damage]) - if BuffOptionName.buff_defense in buff_option: + if BuffOptionName.defense in buff_option: allowed_buffs.append(item_table[Buff.defense]) - if BuffOptionName.buff_immunity in buff_option: + if BuffOptionName.immunity in buff_option: allowed_buffs.append(item_table[Buff.immunity]) - if BuffOptionName.buff_health in buff_option: + if BuffOptionName.health in buff_option: allowed_buffs.append(item_table[Buff.health]) - if BuffOptionName.buff_energy in buff_option: + if BuffOptionName.energy in buff_option: allowed_buffs.append(item_table[Buff.energy]) - if BuffOptionName.buff_bite in buff_option: + if BuffOptionName.bite in buff_option: allowed_buffs.append(item_table[Buff.bite_rate]) - if BuffOptionName.buff_fish_trap in buff_option: + if BuffOptionName.fish_trap in buff_option: allowed_buffs.append(item_table[Buff.fish_trap]) - if BuffOptionName.buff_fishing_bar in buff_option: + if BuffOptionName.fishing_bar in buff_option: allowed_buffs.append(item_table[Buff.fishing_bar]) - if BuffOptionName.buff_quality in buff_option: + if BuffOptionName.quality in buff_option: allowed_buffs.append(item_table[Buff.quality]) - if BuffOptionName.buff_glow in buff_option: + if BuffOptionName.glow in buff_option: allowed_buffs.append(item_table[Buff.glow]) return allowed_buffs diff --git a/worlds/stardew_valley/logic/walnut_logic.py b/worlds/stardew_valley/logic/walnut_logic.py index 5595717b3fb8..4ab3b46f70d9 100644 --- a/worlds/stardew_valley/logic/walnut_logic.py +++ b/worlds/stardew_valley/logic/walnut_logic.py @@ -44,22 +44,22 @@ def has_walnut(self, number: int) -> StardewRule: total_walnuts = puzzle_walnuts + bush_walnuts + dig_walnuts + repeatable_walnuts walnuts_to_receive = 0 walnuts_to_collect = number - if WalnutsanityOptionName.walnutsanity_puzzles in self.options.walnutsanity: + if WalnutsanityOptionName.puzzles in self.options.walnutsanity: puzzle_walnut_rate = puzzle_walnuts / total_walnuts puzzle_walnuts_required = round(puzzle_walnut_rate * number) walnuts_to_receive += puzzle_walnuts_required walnuts_to_collect -= puzzle_walnuts_required - if WalnutsanityOptionName.walnutsanity_bushes in self.options.walnutsanity: + if WalnutsanityOptionName.bushes in self.options.walnutsanity: bush_walnuts_rate = bush_walnuts / total_walnuts bush_walnuts_required = round(bush_walnuts_rate * number) walnuts_to_receive += bush_walnuts_required walnuts_to_collect -= bush_walnuts_required - if WalnutsanityOptionName.walnutsanity_dig_spots in self.options.walnutsanity: + if WalnutsanityOptionName.dig_spots in self.options.walnutsanity: dig_walnuts_rate = dig_walnuts / total_walnuts dig_walnuts_required = round(dig_walnuts_rate * number) walnuts_to_receive += dig_walnuts_required walnuts_to_collect -= dig_walnuts_required - if WalnutsanityOptionName.walnutsanity_repeatables in self.options.walnutsanity: + if WalnutsanityOptionName.repeatables in self.options.walnutsanity: repeatable_walnuts_rate = repeatable_walnuts / total_walnuts repeatable_walnuts_required = round(repeatable_walnuts_rate * number) walnuts_to_receive += repeatable_walnuts_required diff --git a/worlds/stardew_valley/options/options.py b/worlds/stardew_valley/options/options.py index b763d9712182..5d3b25b4da13 100644 --- a/worlds/stardew_valley/options/options.py +++ b/worlds/stardew_valley/options/options.py @@ -583,8 +583,8 @@ class Walnutsanity(OptionSet): internal_name = "walnutsanity" display_name = "Walnutsanity" valid_keys = frozenset({ - WalnutsanityOptionName.walnutsanity_puzzles, WalnutsanityOptionName.walnutsanity_bushes, WalnutsanityOptionName.walnutsanity_dig_spots, - WalnutsanityOptionName.walnutsanity_repeatables, + WalnutsanityOptionName.puzzles, WalnutsanityOptionName.bushes, WalnutsanityOptionName.dig_spots, + WalnutsanityOptionName.repeatables, }) preset_none = frozenset() preset_all = valid_keys @@ -625,13 +625,13 @@ class EnabledFillerBuffs(OptionSet): internal_name = "enabled_filler_buffs" display_name = "Enabled Filler Buffs" valid_keys = frozenset({ - BuffOptionName.buff_luck, BuffOptionName.buff_damage, BuffOptionName.buff_defense, BuffOptionName.buff_immunity, BuffOptionName.buff_health, - BuffOptionName.buff_energy, BuffOptionName.buff_bite, BuffOptionName.buff_fish_trap, BuffOptionName.buff_fishing_bar, + BuffOptionName.luck, BuffOptionName.damage, BuffOptionName.defense, BuffOptionName.immunity, BuffOptionName.health, + BuffOptionName.energy, BuffOptionName.bite, BuffOptionName.fish_trap, BuffOptionName.fishing_bar, }) # OptionName.buff_quality, OptionName.buff_glow}) # Disabled these two buffs because they are too hard to make on the mod side preset_none = frozenset() preset_all = valid_keys - default = frozenset({BuffOptionName.buff_luck, BuffOptionName.buff_defense, BuffOptionName.buff_bite}) + default = frozenset({BuffOptionName.luck, BuffOptionName.defense, BuffOptionName.bite}) class ExcludeGingerIsland(Toggle): diff --git a/worlds/stardew_valley/options/presets.py b/worlds/stardew_valley/options/presets.py index be87d3439d97..c2c210e5ca6e 100644 --- a/worlds/stardew_valley/options/presets.py +++ b/worlds/stardew_valley/options/presets.py @@ -122,7 +122,7 @@ options.Friendsanity.internal_name: options.Friendsanity.option_starting_npcs, options.FriendsanityHeartSize.internal_name: 4, options.Booksanity.internal_name: options.Booksanity.option_power_skill, - options.Walnutsanity.internal_name: [WalnutsanityOptionName.walnutsanity_puzzles], + options.Walnutsanity.internal_name: [WalnutsanityOptionName.puzzles], options.NumberOfMovementBuffs.internal_name: 6, options.EnabledFillerBuffs.internal_name: options.EnabledFillerBuffs.preset_all, options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_true, diff --git a/worlds/stardew_valley/rules.py b/worlds/stardew_valley/rules.py index 70f2d75f5c9b..54afc31eb892 100644 --- a/worlds/stardew_valley/rules.py +++ b/worlds/stardew_valley/rules.py @@ -436,7 +436,7 @@ def set_walnut_rules(logic: StardewLogic, multiworld, player, world_options: Sta def set_walnut_puzzle_rules(logic: StardewLogic, multiworld, player, world_options): - if WalnutsanityOptionName.walnutsanity_puzzles not in world_options.walnutsanity: + if WalnutsanityOptionName.puzzles not in world_options.walnutsanity: return MultiWorldRules.add_rule(multiworld.get_location("Open Golden Coconut", player), logic.has(Geode.golden_coconut)) @@ -463,14 +463,14 @@ def set_walnut_puzzle_rules(logic: StardewLogic, multiworld, player, world_optio def set_walnut_bushes_rules(logic, multiworld, player, world_options): - if WalnutsanityOptionName.walnutsanity_bushes not in world_options.walnutsanity: + if WalnutsanityOptionName.bushes not in world_options.walnutsanity: return # I don't think any of the bushes require something special, but that might change with ER return def set_walnut_dig_spot_rules(logic, multiworld, player, world_options): - if WalnutsanityOptionName.walnutsanity_dig_spots not in world_options.walnutsanity: + if WalnutsanityOptionName.dig_spots not in world_options.walnutsanity: return for dig_spot_walnut in locations.locations_by_tag[LocationTags.WALNUTSANITY_DIG]: @@ -483,7 +483,7 @@ def set_walnut_dig_spot_rules(logic, multiworld, player, world_options): def set_walnut_repeatable_rules(logic, multiworld, player, world_options): - if WalnutsanityOptionName.walnutsanity_repeatables not in world_options.walnutsanity: + if WalnutsanityOptionName.repeatables not in world_options.walnutsanity: return for i in range(1, 6): MultiWorldRules.set_rule(multiworld.get_location(f"Fishing Walnut {i}", player), logic.tool.has_fishing_rod(1)) diff --git a/worlds/stardew_valley/strings/ap_names/ap_option_names.py b/worlds/stardew_valley/strings/ap_names/ap_option_names.py index c88d35c26914..7ff2cc783d11 100644 --- a/worlds/stardew_valley/strings/ap_names/ap_option_names.py +++ b/worlds/stardew_valley/strings/ap_names/ap_option_names.py @@ -1,19 +1,19 @@ -class WalnutsanityOptionName: - walnutsanity_puzzles = "Puzzles" - walnutsanity_bushes = "Bushes" - walnutsanity_dig_spots = "Dig Spots" - walnutsanity_repeatables = "Repeatables" - - -class BuffOptionName: - buff_luck = "Luck" - buff_damage = "Damage" - buff_defense = "Defense" - buff_immunity = "Immunity" - buff_health = "Health" - buff_energy = "Energy" - buff_bite = "Bite Rate" - buff_fish_trap = "Fish Trap" - buff_fishing_bar = "Fishing Bar Size" - buff_quality = "Quality" - buff_glow = "Glow" +class WalnutsanityOptionName: + puzzles = "Puzzles" + bushes = "Bushes" + dig_spots = "Dig Spots" + repeatables = "Repeatables" + + +class BuffOptionName: + luck = "Luck" + damage = "Damage" + defense = "Defense" + immunity = "Immunity" + health = "Health" + energy = "Energy" + bite = "Bite Rate" + fish_trap = "Fish Trap" + fishing_bar = "Fishing Bar Size" + quality = "Quality" + glow = "Glow" diff --git a/worlds/stardew_valley/test/TestWalnutsanity.py b/worlds/stardew_valley/test/TestWalnutsanity.py index 0a1b5d36bcb0..c1e8c2c8f095 100644 --- a/worlds/stardew_valley/test/TestWalnutsanity.py +++ b/worlds/stardew_valley/test/TestWalnutsanity.py @@ -49,7 +49,7 @@ def test_logic_received_walnuts(self): class TestWalnutsanityPuzzles(SVTestBase): options = { ExcludeGingerIsland: ExcludeGingerIsland.option_false, - Walnutsanity: frozenset({WalnutsanityOptionName.walnutsanity_puzzles}), + Walnutsanity: frozenset({WalnutsanityOptionName.puzzles}), } def test_only_puzzle_walnut_locations(self): @@ -90,7 +90,7 @@ def test_field_office_locations_require_professor_snail(self): class TestWalnutsanityBushes(SVTestBase): options = { ExcludeGingerIsland: ExcludeGingerIsland.option_false, - Walnutsanity: frozenset({WalnutsanityOptionName.walnutsanity_bushes}), + Walnutsanity: frozenset({WalnutsanityOptionName.bushes}), } def test_only_bush_walnut_locations(self): @@ -108,7 +108,7 @@ def test_only_bush_walnut_locations(self): class TestWalnutsanityPuzzlesAndBushes(SVTestBase): options = { ExcludeGingerIsland: ExcludeGingerIsland.option_false, - Walnutsanity: frozenset({WalnutsanityOptionName.walnutsanity_puzzles, WalnutsanityOptionName.walnutsanity_bushes}), + Walnutsanity: frozenset({WalnutsanityOptionName.puzzles, WalnutsanityOptionName.bushes}), } def test_only_bush_walnut_locations(self): @@ -136,7 +136,7 @@ def test_logic_received_walnuts(self): class TestWalnutsanityDigSpots(SVTestBase): options = { ExcludeGingerIsland: ExcludeGingerIsland.option_false, - Walnutsanity: frozenset({WalnutsanityOptionName.walnutsanity_dig_spots}), + Walnutsanity: frozenset({WalnutsanityOptionName.dig_spots}), } def test_only_dig_spots_walnut_locations(self): @@ -154,7 +154,7 @@ def test_only_dig_spots_walnut_locations(self): class TestWalnutsanityRepeatables(SVTestBase): options = { ExcludeGingerIsland: ExcludeGingerIsland.option_false, - Walnutsanity: frozenset({WalnutsanityOptionName.walnutsanity_repeatables}), + Walnutsanity: frozenset({WalnutsanityOptionName.repeatables}), } def test_only_repeatable_walnut_locations(self): diff --git a/worlds/stardew_valley/test/options/TestForcedOptions.py b/worlds/stardew_valley/test/options/TestForcedOptions.py index 17bd0e3f0ec0..4c8f0f42c389 100644 --- a/worlds/stardew_valley/test/options/TestForcedOptions.py +++ b/worlds/stardew_valley/test/options/TestForcedOptions.py @@ -7,9 +7,9 @@ from ...options.forced_options import force_change_options_if_incompatible -class TestBigGoalsOverrideAccessibility(unittest.TestCase): +class TestGoalsRequiringAllLocationsOverrideAccessibility(unittest.TestCase): - def test_given_goal_when_generate_then_accessibility_is_forced_to_full(self): + def test_given_goal_requiring_all_locations_when_generate_then_accessibility_is_forced_to_full(self): """There is a bug with the current victory condition of the perfection goal that can create unwinnable seeds if the accessibility is set to minimal and the world gets flooded with progression items through plando. This will increase the amount of collected progression items pass the total amount calculated for the world when creating the item pool. This will cause the victory condition to be met before all locations are collected, so some could