mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Stardew Valley: Fix 3 Logic Issues (#5094)
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
This commit is contained in:
@@ -271,11 +271,11 @@ solar_essence = BundleItem(Loot.solar_essence)
|
|||||||
void_essence = BundleItem(Loot.void_essence)
|
void_essence = BundleItem(Loot.void_essence)
|
||||||
|
|
||||||
petrified_slime = BundleItem(Mineral.petrified_slime)
|
petrified_slime = BundleItem(Mineral.petrified_slime)
|
||||||
blue_slime_egg = BundleItem(Loot.blue_slime_egg)
|
blue_slime_egg = BundleItem(AnimalProduct.slime_egg_blue)
|
||||||
red_slime_egg = BundleItem(Loot.red_slime_egg)
|
red_slime_egg = BundleItem(AnimalProduct.slime_egg_red)
|
||||||
purple_slime_egg = BundleItem(Loot.purple_slime_egg)
|
purple_slime_egg = BundleItem(AnimalProduct.slime_egg_purple)
|
||||||
green_slime_egg = BundleItem(Loot.green_slime_egg)
|
green_slime_egg = BundleItem(AnimalProduct.slime_egg_green)
|
||||||
tiger_slime_egg = BundleItem(Loot.tiger_slime_egg, source=BundleItem.Sources.island)
|
tiger_slime_egg = BundleItem(AnimalProduct.slime_egg_tiger, source=BundleItem.Sources.island)
|
||||||
|
|
||||||
cherry_bomb = BundleItem(Bomb.cherry_bomb, 5)
|
cherry_bomb = BundleItem(Bomb.cherry_bomb, 5)
|
||||||
bomb = BundleItem(Bomb.bomb, 2)
|
bomb = BundleItem(Bomb.bomb, 2)
|
||||||
|
@@ -174,7 +174,8 @@ class StardewLogic(ReceivedLogicMixin, HasLogicMixin, RegionLogicMixin, Travelin
|
|||||||
AnimalProduct.slime_egg_blue: self.has(Machine.slime_egg_press) & self.has(Loot.slime) & self.time.has_lived_months(3),
|
AnimalProduct.slime_egg_blue: self.has(Machine.slime_egg_press) & self.has(Loot.slime) & self.time.has_lived_months(3),
|
||||||
AnimalProduct.slime_egg_red: self.has(Machine.slime_egg_press) & self.has(Loot.slime) & self.time.has_lived_months(6),
|
AnimalProduct.slime_egg_red: self.has(Machine.slime_egg_press) & self.has(Loot.slime) & self.time.has_lived_months(6),
|
||||||
AnimalProduct.slime_egg_purple: self.has(Machine.slime_egg_press) & self.has(Loot.slime) & self.time.has_lived_months(9),
|
AnimalProduct.slime_egg_purple: self.has(Machine.slime_egg_press) & self.has(Loot.slime) & self.time.has_lived_months(9),
|
||||||
AnimalProduct.slime_egg_tiger: self.has(Fish.lionfish) & self.building.has_building(Building.fish_pond),
|
AnimalProduct.slime_egg_tiger: self.can_fish_pond(Fish.lionfish, *(Forageable.ginger, Fruit.pineapple, Fruit.mango)) & self.time.has_lived_months(12) &
|
||||||
|
self.building.has_building(Building.slime_hutch) & self.monster.can_kill(Monster.tiger_slime),
|
||||||
AnimalProduct.duck_egg_starter: self.logic.false_, # It could be purchased at the Feast of the Winter Star, but it's random every year, so not considering it yet...
|
AnimalProduct.duck_egg_starter: self.logic.false_, # It could be purchased at the Feast of the Winter Star, but it's random every year, so not considering it yet...
|
||||||
AnimalProduct.dinosaur_egg_starter: self.logic.false_, # Dinosaur eggs are also part of the museum rules, and I don't want to touch them yet.
|
AnimalProduct.dinosaur_egg_starter: self.logic.false_, # Dinosaur eggs are also part of the museum rules, and I don't want to touch them yet.
|
||||||
AnimalProduct.egg_starter: self.logic.false_, # It could be purchased at the Desert Festival, but festival logic is quite a mess, so not considering it yet...
|
AnimalProduct.egg_starter: self.logic.false_, # It could be purchased at the Desert Festival, but festival logic is quite a mess, so not considering it yet...
|
||||||
@@ -233,7 +234,7 @@ class StardewLogic(ReceivedLogicMixin, HasLogicMixin, RegionLogicMixin, Travelin
|
|||||||
Forageable.secret_note: self.quest.has_magnifying_glass() & (self.ability.can_chop_trees() | self.mine.can_mine_in_the_mines_floor_1_40()), #
|
Forageable.secret_note: self.quest.has_magnifying_glass() & (self.ability.can_chop_trees() | self.mine.can_mine_in_the_mines_floor_1_40()), #
|
||||||
Fossil.bone_fragment: (self.region.can_reach(Region.dig_site) & self.tool.has_tool(Tool.pickaxe)) | self.monster.can_kill(Monster.skeleton),
|
Fossil.bone_fragment: (self.region.can_reach(Region.dig_site) & self.tool.has_tool(Tool.pickaxe)) | self.monster.can_kill(Monster.skeleton),
|
||||||
Fossil.fossilized_leg: self.region.can_reach(Region.dig_site) & self.tool.has_tool(Tool.pickaxe),
|
Fossil.fossilized_leg: self.region.can_reach(Region.dig_site) & self.tool.has_tool(Tool.pickaxe),
|
||||||
Fossil.fossilized_ribs: self.region.can_reach(Region.island_south) & self.tool.has_tool(Tool.hoe),
|
Fossil.fossilized_ribs: self.region.can_reach(Region.island_south) & self.tool.has_tool(Tool.hoe) & self.received("Open Professor Snail Cave"),
|
||||||
Fossil.fossilized_skull: self.action.can_open_geode(Geode.golden_coconut),
|
Fossil.fossilized_skull: self.action.can_open_geode(Geode.golden_coconut),
|
||||||
Fossil.fossilized_spine: self.fishing.can_fish_at(Region.dig_site),
|
Fossil.fossilized_spine: self.fishing.can_fish_at(Region.dig_site),
|
||||||
Fossil.fossilized_tail: self.action.can_pan_at(Region.dig_site, ToolMaterial.copper),
|
Fossil.fossilized_tail: self.action.can_pan_at(Region.dig_site, ToolMaterial.copper),
|
||||||
@@ -288,9 +289,9 @@ class StardewLogic(ReceivedLogicMixin, HasLogicMixin, RegionLogicMixin, Travelin
|
|||||||
MetalBar.quartz: self.can_smelt(Mineral.quartz) | self.can_smelt("Fire Quartz") | (self.has(Machine.recycling_machine) & (self.has(Trash.broken_cd) | self.has(Trash.broken_glasses))),
|
MetalBar.quartz: self.can_smelt(Mineral.quartz) | self.can_smelt("Fire Quartz") | (self.has(Machine.recycling_machine) & (self.has(Trash.broken_cd) | self.has(Trash.broken_glasses))),
|
||||||
MetalBar.radioactive: self.can_smelt(Ore.radioactive),
|
MetalBar.radioactive: self.can_smelt(Ore.radioactive),
|
||||||
Ore.copper: self.mine.can_mine_in_the_mines_floor_1_40() | self.mine.can_mine_in_the_skull_cavern() | self.tool.has_tool(Tool.pan, ToolMaterial.copper),
|
Ore.copper: self.mine.can_mine_in_the_mines_floor_1_40() | self.mine.can_mine_in_the_skull_cavern() | self.tool.has_tool(Tool.pan, ToolMaterial.copper),
|
||||||
Ore.gold: self.mine.can_mine_in_the_mines_floor_81_120() | self.mine.can_mine_in_the_skull_cavern() | self.tool.has_tool(Tool.pan, ToolMaterial.iron),
|
Ore.gold: self.mine.can_mine_in_the_mines_floor_81_120() | self.mine.can_mine_in_the_skull_cavern() | self.tool.has_tool(Tool.pan, ToolMaterial.gold),
|
||||||
Ore.iridium: self.mine.can_mine_in_the_skull_cavern() | self.can_fish_pond(Fish.super_cucumber) | self.tool.has_tool(Tool.pan, ToolMaterial.gold),
|
Ore.iridium: self.count(2, *(self.mine.can_mine_in_the_skull_cavern(), self.can_fish_pond(Fish.super_cucumber), self.tool.has_tool(Tool.pan, ToolMaterial.iridium))),
|
||||||
Ore.iron: self.mine.can_mine_in_the_mines_floor_41_80() | self.mine.can_mine_in_the_skull_cavern() | self.tool.has_tool(Tool.pan, ToolMaterial.copper),
|
Ore.iron: self.mine.can_mine_in_the_mines_floor_41_80() | self.mine.can_mine_in_the_skull_cavern() | self.tool.has_tool(Tool.pan, ToolMaterial.iron),
|
||||||
Ore.radioactive: self.ability.can_mine_perfectly() & self.region.can_reach(Region.qi_walnut_room),
|
Ore.radioactive: self.ability.can_mine_perfectly() & self.region.can_reach(Region.qi_walnut_room),
|
||||||
RetainingSoil.basic: self.money.can_spend_at(Region.pierre_store, 100),
|
RetainingSoil.basic: self.money.can_spend_at(Region.pierre_store, 100),
|
||||||
RetainingSoil.quality: self.time.has_year_two & self.money.can_spend_at(Region.pierre_store, 150),
|
RetainingSoil.quality: self.time.has_year_two & self.money.can_spend_at(Region.pierre_store, 150),
|
||||||
@@ -381,5 +382,8 @@ class StardewLogic(ReceivedLogicMixin, HasLogicMixin, RegionLogicMixin, Travelin
|
|||||||
def can_use_obelisk(self, obelisk: str) -> StardewRule:
|
def can_use_obelisk(self, obelisk: str) -> StardewRule:
|
||||||
return self.region.can_reach(Region.farm) & self.received(obelisk)
|
return self.region.can_reach(Region.farm) & self.received(obelisk)
|
||||||
|
|
||||||
def can_fish_pond(self, fish: str) -> StardewRule:
|
def can_fish_pond(self, fish: str, *items: str) -> StardewRule:
|
||||||
return self.building.has_building(Building.fish_pond) & self.has(fish)
|
rule = self.building.has_building(Building.fish_pond) & self.has(fish)
|
||||||
|
if items:
|
||||||
|
rule = rule & self.has_all(*items)
|
||||||
|
return rule
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
class Loot:
|
class Loot:
|
||||||
blue_slime_egg = "Blue Slime Egg"
|
|
||||||
red_slime_egg = "Red Slime Egg"
|
|
||||||
purple_slime_egg = "Purple Slime Egg"
|
|
||||||
green_slime_egg = "Green Slime Egg"
|
|
||||||
tiger_slime_egg = "Tiger Slime Egg"
|
|
||||||
slime = "Slime"
|
slime = "Slime"
|
||||||
bug_meat = "Bug Meat"
|
bug_meat = "Bug Meat"
|
||||||
bat_wing = "Bat Wing"
|
bat_wing = "Bat Wing"
|
||||||
|
@@ -8,7 +8,7 @@ class TestNeedRegionToCatchFish(SVTestBase):
|
|||||||
SeasonRandomization.internal_name: SeasonRandomization.option_disabled,
|
SeasonRandomization.internal_name: SeasonRandomization.option_disabled,
|
||||||
ElevatorProgression.internal_name: ElevatorProgression.option_vanilla,
|
ElevatorProgression.internal_name: ElevatorProgression.option_vanilla,
|
||||||
SkillProgression.internal_name: SkillProgression.option_vanilla,
|
SkillProgression.internal_name: SkillProgression.option_vanilla,
|
||||||
ToolProgression.internal_name: ToolProgression.option_vanilla,
|
ToolProgression.internal_name: ToolProgression.option_progressive,
|
||||||
Fishsanity.internal_name: Fishsanity.option_all,
|
Fishsanity.internal_name: Fishsanity.option_all,
|
||||||
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_false,
|
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_false,
|
||||||
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_qi,
|
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_qi,
|
||||||
@@ -18,7 +18,7 @@ class TestNeedRegionToCatchFish(SVTestBase):
|
|||||||
fish_and_items = {
|
fish_and_items = {
|
||||||
Fish.crimsonfish: ["Beach Bridge"],
|
Fish.crimsonfish: ["Beach Bridge"],
|
||||||
Fish.void_salmon: ["Railroad Boulder Removed", "Dark Talisman"],
|
Fish.void_salmon: ["Railroad Boulder Removed", "Dark Talisman"],
|
||||||
Fish.woodskip: ["Glittering Boulder Removed", "Progressive Weapon"], # For the ores to get the axe upgrades
|
Fish.woodskip: ["Progressive Axe", "Progressive Axe", "Progressive Weapon"], # For the ores to get the axe upgrades
|
||||||
Fish.mutant_carp: ["Rusty Key"],
|
Fish.mutant_carp: ["Rusty Key"],
|
||||||
Fish.slimejack: ["Railroad Boulder Removed", "Rusty Key"],
|
Fish.slimejack: ["Railroad Boulder Removed", "Rusty Key"],
|
||||||
Fish.lionfish: ["Boat Repair"],
|
Fish.lionfish: ["Boat Repair"],
|
||||||
@@ -26,8 +26,8 @@ class TestNeedRegionToCatchFish(SVTestBase):
|
|||||||
Fish.stingray: ["Boat Repair", "Island Resort"],
|
Fish.stingray: ["Boat Repair", "Island Resort"],
|
||||||
Fish.ghostfish: ["Progressive Weapon"],
|
Fish.ghostfish: ["Progressive Weapon"],
|
||||||
Fish.stonefish: ["Progressive Weapon"],
|
Fish.stonefish: ["Progressive Weapon"],
|
||||||
Fish.ice_pip: ["Progressive Weapon", "Progressive Weapon"],
|
Fish.ice_pip: ["Progressive Weapon", "Progressive Weapon", "Progressive Pickaxe", "Progressive Pickaxe"],
|
||||||
Fish.lava_eel: ["Progressive Weapon", "Progressive Weapon", "Progressive Weapon"],
|
Fish.lava_eel: ["Progressive Weapon", "Progressive Weapon", "Progressive Weapon", "Progressive Pickaxe", "Progressive Pickaxe", "Progressive Pickaxe"],
|
||||||
Fish.sandfish: ["Bus Repair"],
|
Fish.sandfish: ["Bus Repair"],
|
||||||
Fish.scorpion_carp: ["Desert Obelisk"],
|
Fish.scorpion_carp: ["Desert Obelisk"],
|
||||||
# Starting the extended family quest requires having caught all the legendaries before, so they all have the rules of every other legendary
|
# Starting the extended family quest requires having caught all the legendaries before, so they all have the rules of every other legendary
|
||||||
@@ -37,6 +37,7 @@ class TestNeedRegionToCatchFish(SVTestBase):
|
|||||||
Fish.legend_ii: ["Beach Bridge", "Island Obelisk", "Island West Turtle", "Qi Walnut Room", "Rusty Key"],
|
Fish.legend_ii: ["Beach Bridge", "Island Obelisk", "Island West Turtle", "Qi Walnut Room", "Rusty Key"],
|
||||||
Fish.ms_angler: ["Beach Bridge", "Island Obelisk", "Island West Turtle", "Qi Walnut Room", "Rusty Key"],
|
Fish.ms_angler: ["Beach Bridge", "Island Obelisk", "Island West Turtle", "Qi Walnut Room", "Rusty Key"],
|
||||||
}
|
}
|
||||||
|
self.collect("Progressive Fishing Rod", 4)
|
||||||
self.original_state = self.multiworld.state.copy()
|
self.original_state = self.multiworld.state.copy()
|
||||||
for fish in fish_and_items:
|
for fish in fish_and_items:
|
||||||
with self.subTest(f"Region rules for {fish}"):
|
with self.subTest(f"Region rules for {fish}"):
|
||||||
|
Reference in New Issue
Block a user