Skip to content

Commit

Permalink
rename stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouramie committed Dec 2, 2024
1 parent 932cea5 commit 9ea276c
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 55 deletions.
30 changes: 15 additions & 15 deletions worlds/stardew_valley/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions worlds/stardew_valley/logic/walnut_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions worlds/stardew_valley/options/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion worlds/stardew_valley/options/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions worlds/stardew_valley/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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]:
Expand All @@ -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))
Expand Down
38 changes: 19 additions & 19 deletions worlds/stardew_valley/strings/ap_names/ap_option_names.py
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 5 additions & 5 deletions worlds/stardew_valley/test/TestWalnutsanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions worlds/stardew_valley/test/options/TestForcedOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9ea276c

Please sign in to comment.