mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
TUNIC: Swap from multiworld.get to world.get for applicable things (#3789)
* Swap from multiworld.get to world.get for applicable things * Why was this even here in the first place?
This commit is contained in:
@@ -1318,222 +1318,221 @@ def set_er_region_rules(world: "TunicWorld", regions: Dict[str, Region], portal_
|
||||
|
||||
def set_er_location_rules(world: "TunicWorld") -> None:
|
||||
player = world.player
|
||||
multiworld = world.multiworld
|
||||
options = world.options
|
||||
|
||||
forbid_item(multiworld.get_location("Secret Gathering Place - 20 Fairy Reward", player), fairies, player)
|
||||
forbid_item(world.get_location("Secret Gathering Place - 20 Fairy Reward"), fairies, player)
|
||||
|
||||
# Ability Shuffle Exclusive Rules
|
||||
set_rule(multiworld.get_location("East Forest - Dancing Fox Spirit Holy Cross", player),
|
||||
set_rule(world.get_location("East Forest - Dancing Fox Spirit Holy Cross"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Forest Grave Path - Holy Cross Code by Grave", player),
|
||||
set_rule(world.get_location("Forest Grave Path - Holy Cross Code by Grave"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("East Forest - Golden Obelisk Holy Cross", player),
|
||||
set_rule(world.get_location("East Forest - Golden Obelisk Holy Cross"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Beneath the Well - [Powered Secret Room] Chest", player),
|
||||
set_rule(world.get_location("Beneath the Well - [Powered Secret Room] Chest"),
|
||||
lambda state: state.has("Activate Furnace Fuse", player))
|
||||
set_rule(multiworld.get_location("West Garden - [North] Behind Holy Cross Door", player),
|
||||
set_rule(world.get_location("West Garden - [North] Behind Holy Cross Door"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Library Hall - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Library Hall - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Eastern Vault Fortress - [West Wing] Candles Holy Cross", player),
|
||||
set_rule(world.get_location("Eastern Vault Fortress - [West Wing] Candles Holy Cross"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("West Garden - [Central Highlands] Holy Cross (Blue Lines)", player),
|
||||
set_rule(world.get_location("West Garden - [Central Highlands] Holy Cross (Blue Lines)"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Quarry - [Back Entrance] Bushes Holy Cross", player),
|
||||
set_rule(world.get_location("Quarry - [Back Entrance] Bushes Holy Cross"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Cathedral - Secret Legend Trophy Chest", player),
|
||||
set_rule(world.get_location("Cathedral - Secret Legend Trophy Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Overworld - [Southwest] Flowers Holy Cross", player),
|
||||
set_rule(world.get_location("Overworld - [Southwest] Flowers Holy Cross"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Overworld - [East] Weathervane Holy Cross", player),
|
||||
set_rule(world.get_location("Overworld - [East] Weathervane Holy Cross"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Overworld - [Northeast] Flowers Holy Cross", player),
|
||||
set_rule(world.get_location("Overworld - [Northeast] Flowers Holy Cross"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Overworld - [Southwest] Haiku Holy Cross", player),
|
||||
set_rule(world.get_location("Overworld - [Southwest] Haiku Holy Cross"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Overworld - [Northwest] Golden Obelisk Page", player),
|
||||
set_rule(world.get_location("Overworld - [Northwest] Golden Obelisk Page"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
|
||||
# Overworld
|
||||
set_rule(multiworld.get_location("Overworld - [Southwest] Grapple Chest Over Walkway", player),
|
||||
set_rule(world.get_location("Overworld - [Southwest] Grapple Chest Over Walkway"),
|
||||
lambda state: state.has_any({grapple, laurels}, player))
|
||||
set_rule(multiworld.get_location("Overworld - [Southwest] West Beach Guarded By Turret 2", player),
|
||||
set_rule(world.get_location("Overworld - [Southwest] West Beach Guarded By Turret 2"),
|
||||
lambda state: state.has_any({grapple, laurels}, player))
|
||||
set_rule(multiworld.get_location("Overworld - [Southwest] From West Garden", player),
|
||||
set_rule(world.get_location("Overworld - [Southwest] From West Garden"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Overworld - [Southeast] Page on Pillar by Swamp", player),
|
||||
set_rule(world.get_location("Overworld - [Southeast] Page on Pillar by Swamp"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Overworld - [Southwest] Fountain Page", player),
|
||||
set_rule(world.get_location("Overworld - [Southwest] Fountain Page"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Overworld - [Northwest] Page on Pillar by Dark Tomb", player),
|
||||
set_rule(world.get_location("Overworld - [Northwest] Page on Pillar by Dark Tomb"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Old House - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Old House - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Overworld - [East] Grapple Chest", player),
|
||||
set_rule(world.get_location("Overworld - [East] Grapple Chest"),
|
||||
lambda state: state.has(grapple, player))
|
||||
set_rule(multiworld.get_location("Sealed Temple - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Sealed Temple - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Caustic Light Cave - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Caustic Light Cave - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Cube Cave - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Cube Cave - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Old House - Holy Cross Door Page", player),
|
||||
set_rule(world.get_location("Old House - Holy Cross Door Page"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Maze Cave - Maze Room Holy Cross", player),
|
||||
set_rule(world.get_location("Maze Cave - Maze Room Holy Cross"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Old House - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Old House - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Patrol Cave - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Patrol Cave - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Ruined Passage - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Ruined Passage - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Hourglass Cave - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Hourglass Cave - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Secret Gathering Place - Holy Cross Chest", player),
|
||||
set_rule(world.get_location("Secret Gathering Place - Holy Cross Chest"),
|
||||
lambda state: has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("Secret Gathering Place - 10 Fairy Reward", player),
|
||||
set_rule(world.get_location("Secret Gathering Place - 10 Fairy Reward"),
|
||||
lambda state: state.has(fairies, player, 10))
|
||||
set_rule(multiworld.get_location("Secret Gathering Place - 20 Fairy Reward", player),
|
||||
set_rule(world.get_location("Secret Gathering Place - 20 Fairy Reward"),
|
||||
lambda state: state.has(fairies, player, 20))
|
||||
set_rule(multiworld.get_location("Coins in the Well - 3 Coins", player),
|
||||
set_rule(world.get_location("Coins in the Well - 3 Coins"),
|
||||
lambda state: state.has(coins, player, 3))
|
||||
set_rule(multiworld.get_location("Coins in the Well - 6 Coins", player),
|
||||
set_rule(world.get_location("Coins in the Well - 6 Coins"),
|
||||
lambda state: state.has(coins, player, 6))
|
||||
set_rule(multiworld.get_location("Coins in the Well - 10 Coins", player),
|
||||
set_rule(world.get_location("Coins in the Well - 10 Coins"),
|
||||
lambda state: state.has(coins, player, 10))
|
||||
set_rule(multiworld.get_location("Coins in the Well - 15 Coins", player),
|
||||
set_rule(world.get_location("Coins in the Well - 15 Coins"),
|
||||
lambda state: state.has(coins, player, 15))
|
||||
|
||||
# East Forest
|
||||
set_rule(multiworld.get_location("East Forest - Lower Grapple Chest", player),
|
||||
set_rule(world.get_location("East Forest - Lower Grapple Chest"),
|
||||
lambda state: state.has(grapple, player))
|
||||
set_rule(multiworld.get_location("East Forest - Lower Dash Chest", player),
|
||||
set_rule(world.get_location("East Forest - Lower Dash Chest"),
|
||||
lambda state: state.has_all({grapple, laurels}, player))
|
||||
set_rule(multiworld.get_location("East Forest - Ice Rod Grapple Chest", player), lambda state: (
|
||||
set_rule(world.get_location("East Forest - Ice Rod Grapple Chest"), lambda state: (
|
||||
state.has_all({grapple, ice_dagger, fire_wand}, player) and has_ability(icebolt, state, world)))
|
||||
|
||||
# West Garden
|
||||
set_rule(multiworld.get_location("West Garden - [North] Across From Page Pickup", player),
|
||||
set_rule(world.get_location("West Garden - [North] Across From Page Pickup"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("West Garden - [West] In Flooded Walkway", player),
|
||||
set_rule(world.get_location("West Garden - [West] In Flooded Walkway"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("West Garden - [West Lowlands] Tree Holy Cross Chest", player),
|
||||
set_rule(world.get_location("West Garden - [West Lowlands] Tree Holy Cross Chest"),
|
||||
lambda state: state.has(laurels, player) and has_ability(holy_cross, state, world))
|
||||
set_rule(multiworld.get_location("West Garden - [East Lowlands] Page Behind Ice Dagger House", player),
|
||||
set_rule(world.get_location("West Garden - [East Lowlands] Page Behind Ice Dagger House"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("West Garden - [Central Lowlands] Below Left Walkway", player),
|
||||
set_rule(world.get_location("West Garden - [Central Lowlands] Below Left Walkway"),
|
||||
lambda state: state.has(laurels, player))
|
||||
|
||||
# Ruined Atoll
|
||||
set_rule(multiworld.get_location("Ruined Atoll - [West] Near Kevin Block", player),
|
||||
set_rule(world.get_location("Ruined Atoll - [West] Near Kevin Block"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Ruined Atoll - [East] Locked Room Lower Chest", player),
|
||||
set_rule(world.get_location("Ruined Atoll - [East] Locked Room Lower Chest"),
|
||||
lambda state: state.has(laurels, player) or state.has(key, player, 2))
|
||||
set_rule(multiworld.get_location("Ruined Atoll - [East] Locked Room Upper Chest", player),
|
||||
set_rule(world.get_location("Ruined Atoll - [East] Locked Room Upper Chest"),
|
||||
lambda state: state.has(laurels, player) or state.has(key, player, 2))
|
||||
|
||||
# Frog's Domain
|
||||
set_rule(multiworld.get_location("Frog's Domain - Side Room Grapple Secret", player),
|
||||
set_rule(world.get_location("Frog's Domain - Side Room Grapple Secret"),
|
||||
lambda state: state.has_any({grapple, laurels}, player))
|
||||
set_rule(multiworld.get_location("Frog's Domain - Grapple Above Hot Tub", player),
|
||||
set_rule(world.get_location("Frog's Domain - Grapple Above Hot Tub"),
|
||||
lambda state: state.has_any({grapple, laurels}, player))
|
||||
set_rule(multiworld.get_location("Frog's Domain - Escape Chest", player),
|
||||
set_rule(world.get_location("Frog's Domain - Escape Chest"),
|
||||
lambda state: state.has_any({grapple, laurels}, player))
|
||||
|
||||
# Eastern Vault Fortress
|
||||
set_rule(multiworld.get_location("Fortress Arena - Hexagon Red", player),
|
||||
set_rule(world.get_location("Fortress Arena - Hexagon Red"),
|
||||
lambda state: state.has(vault_key, player))
|
||||
|
||||
# Beneath the Vault
|
||||
set_rule(multiworld.get_location("Beneath the Fortress - Bridge", player),
|
||||
set_rule(world.get_location("Beneath the Fortress - Bridge"),
|
||||
lambda state: state.has_group("Melee Weapons", player, 1) or state.has_any({laurels, fire_wand}, player))
|
||||
|
||||
# Quarry
|
||||
set_rule(multiworld.get_location("Quarry - [Central] Above Ladder Dash Chest", player),
|
||||
set_rule(world.get_location("Quarry - [Central] Above Ladder Dash Chest"),
|
||||
lambda state: state.has(laurels, player))
|
||||
|
||||
# Ziggurat
|
||||
# if ER is off, you still need to get past the Admin or you'll get stuck in lower zig
|
||||
set_rule(multiworld.get_location("Rooted Ziggurat Upper - Near Bridge Switch", player),
|
||||
set_rule(world.get_location("Rooted Ziggurat Upper - Near Bridge Switch"),
|
||||
lambda state: has_sword(state, player) or (state.has(fire_wand, player) and (state.has(laurels, player)
|
||||
or options.entrance_rando)))
|
||||
set_rule(multiworld.get_location("Rooted Ziggurat Lower - After Guarded Fuse", player),
|
||||
set_rule(world.get_location("Rooted Ziggurat Lower - After Guarded Fuse"),
|
||||
lambda state: has_sword(state, player) and has_ability(prayer, state, world))
|
||||
|
||||
# Bosses
|
||||
set_rule(multiworld.get_location("Fortress Arena - Siege Engine/Vault Key Pickup", player),
|
||||
set_rule(world.get_location("Fortress Arena - Siege Engine/Vault Key Pickup"),
|
||||
lambda state: has_sword(state, player))
|
||||
# nmg - kill Librarian with a lure, or gun I guess
|
||||
set_rule(multiworld.get_location("Librarian - Hexagon Green", player),
|
||||
set_rule(world.get_location("Librarian - Hexagon Green"),
|
||||
lambda state: (has_sword(state, player) or options.logic_rules)
|
||||
and has_ladder("Ladders in Library", state, world))
|
||||
# nmg - kill boss scav with orb + firecracker, or similar
|
||||
set_rule(multiworld.get_location("Rooted Ziggurat Lower - Hexagon Blue", player),
|
||||
set_rule(world.get_location("Rooted Ziggurat Lower - Hexagon Blue"),
|
||||
lambda state: has_sword(state, player) or (state.has(grapple, player) and options.logic_rules))
|
||||
|
||||
# Swamp
|
||||
set_rule(multiworld.get_location("Cathedral Gauntlet - Gauntlet Reward", player),
|
||||
set_rule(world.get_location("Cathedral Gauntlet - Gauntlet Reward"),
|
||||
lambda state: state.has(fire_wand, player) and has_sword(state, player))
|
||||
set_rule(multiworld.get_location("Swamp - [Entrance] Above Entryway", player),
|
||||
set_rule(world.get_location("Swamp - [Entrance] Above Entryway"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Swamp - [South Graveyard] Upper Walkway Dash Chest", player),
|
||||
set_rule(world.get_location("Swamp - [South Graveyard] Upper Walkway Dash Chest"),
|
||||
lambda state: state.has(laurels, player))
|
||||
# these two swamp checks really want you to kill the big skeleton first
|
||||
set_rule(multiworld.get_location("Swamp - [South Graveyard] 4 Orange Skulls", player),
|
||||
set_rule(world.get_location("Swamp - [South Graveyard] 4 Orange Skulls"),
|
||||
lambda state: has_sword(state, player))
|
||||
|
||||
# Hero's Grave and Far Shore
|
||||
set_rule(multiworld.get_location("Hero's Grave - Tooth Relic", player),
|
||||
set_rule(world.get_location("Hero's Grave - Tooth Relic"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Hero's Grave - Mushroom Relic", player),
|
||||
set_rule(world.get_location("Hero's Grave - Mushroom Relic"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Hero's Grave - Ash Relic", player),
|
||||
set_rule(world.get_location("Hero's Grave - Ash Relic"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Hero's Grave - Flowers Relic", player),
|
||||
set_rule(world.get_location("Hero's Grave - Flowers Relic"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Hero's Grave - Effigy Relic", player),
|
||||
set_rule(world.get_location("Hero's Grave - Effigy Relic"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Hero's Grave - Feathers Relic", player),
|
||||
set_rule(world.get_location("Hero's Grave - Feathers Relic"),
|
||||
lambda state: state.has(laurels, player))
|
||||
set_rule(multiworld.get_location("Far Shore - Secret Chest", player),
|
||||
set_rule(world.get_location("Far Shore - Secret Chest"),
|
||||
lambda state: state.has(laurels, player))
|
||||
|
||||
# Events
|
||||
set_rule(multiworld.get_location("Eastern Bell", player),
|
||||
set_rule(world.get_location("Eastern Bell"),
|
||||
lambda state: (has_stick(state, player) or state.has(fire_wand, player)))
|
||||
set_rule(multiworld.get_location("Western Bell", player),
|
||||
set_rule(world.get_location("Western Bell"),
|
||||
lambda state: (has_stick(state, player) or state.has(fire_wand, player)))
|
||||
set_rule(multiworld.get_location("Furnace Fuse", player),
|
||||
set_rule(world.get_location("Furnace Fuse"),
|
||||
lambda state: has_ability(prayer, state, world))
|
||||
set_rule(multiworld.get_location("South and West Fortress Exterior Fuses", player),
|
||||
set_rule(world.get_location("South and West Fortress Exterior Fuses"),
|
||||
lambda state: has_ability(prayer, state, world))
|
||||
set_rule(multiworld.get_location("Upper and Central Fortress Exterior Fuses", player),
|
||||
set_rule(world.get_location("Upper and Central Fortress Exterior Fuses"),
|
||||
lambda state: has_ability(prayer, state, world))
|
||||
set_rule(multiworld.get_location("Beneath the Vault Fuse", player),
|
||||
set_rule(world.get_location("Beneath the Vault Fuse"),
|
||||
lambda state: state.has("Activate South and West Fortress Exterior Fuses", player))
|
||||
set_rule(multiworld.get_location("Eastern Vault West Fuses", player),
|
||||
set_rule(world.get_location("Eastern Vault West Fuses"),
|
||||
lambda state: state.has("Activate Beneath the Vault Fuse", player))
|
||||
set_rule(multiworld.get_location("Eastern Vault East Fuse", player),
|
||||
set_rule(world.get_location("Eastern Vault East Fuse"),
|
||||
lambda state: state.has_all({"Activate Upper and Central Fortress Exterior Fuses",
|
||||
"Activate South and West Fortress Exterior Fuses"}, player))
|
||||
set_rule(multiworld.get_location("Quarry Connector Fuse", player),
|
||||
set_rule(world.get_location("Quarry Connector Fuse"),
|
||||
lambda state: has_ability(prayer, state, world) and state.has(grapple, player))
|
||||
set_rule(multiworld.get_location("Quarry Fuse", player),
|
||||
set_rule(world.get_location("Quarry Fuse"),
|
||||
lambda state: state.has("Activate Quarry Connector Fuse", player))
|
||||
set_rule(multiworld.get_location("Ziggurat Fuse", player),
|
||||
set_rule(world.get_location("Ziggurat Fuse"),
|
||||
lambda state: has_ability(prayer, state, world))
|
||||
set_rule(multiworld.get_location("West Garden Fuse", player),
|
||||
set_rule(world.get_location("West Garden Fuse"),
|
||||
lambda state: has_ability(prayer, state, world))
|
||||
set_rule(multiworld.get_location("Library Fuse", player),
|
||||
set_rule(world.get_location("Library Fuse"),
|
||||
lambda state: has_ability(prayer, state, world))
|
||||
|
||||
# Shop
|
||||
set_rule(multiworld.get_location("Shop - Potion 1", player),
|
||||
set_rule(world.get_location("Shop - Potion 1"),
|
||||
lambda state: has_sword(state, player))
|
||||
set_rule(multiworld.get_location("Shop - Potion 2", player),
|
||||
set_rule(world.get_location("Shop - Potion 2"),
|
||||
lambda state: has_sword(state, player))
|
||||
set_rule(multiworld.get_location("Shop - Coin 1", player),
|
||||
set_rule(world.get_location("Shop - Coin 1"),
|
||||
lambda state: has_sword(state, player))
|
||||
set_rule(multiworld.get_location("Shop - Coin 2", player),
|
||||
set_rule(world.get_location("Shop - Coin 2"),
|
||||
lambda state: has_sword(state, player))
|
||||
|
Reference in New Issue
Block a user