TUNIC: Give the fox a gun (in logic) (very small PR) (#3790)

* Add bomb wall logic

* Remove option call from can_shop

* Gun for the envoy blocking Quarry

* has_sword -> can_shop on cube cave entrance region
This commit is contained in:
Scipio Wright
2024-08-16 14:53:54 -04:00
committed by GitHub
parent 4af6927e23
commit 474a3181c6
4 changed files with 43 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
from random import Random
from typing import Dict, TYPE_CHECKING
from worlds.generic.Rules import set_rule, forbid_item
from worlds.generic.Rules import set_rule, forbid_item, add_rule
from BaseClasses import CollectionState
from .options import TunicOptions
if TYPE_CHECKING:
@@ -11,6 +11,7 @@ laurels = "Hero's Laurels"
grapple = "Magic Orb"
ice_dagger = "Magic Dagger"
fire_wand = "Magic Wand"
gun = "Gun"
lantern = "Lantern"
fairies = "Fairy"
coins = "Golden Coin"
@@ -26,6 +27,11 @@ green_hexagon = "Green Questagon"
blue_hexagon = "Blue Questagon"
gold_hexagon = "Gold Questagon"
bomb_walls = ["East Forest - Bombable Wall", "Eastern Vault Fortress - [East Wing] Bombable Wall",
"Overworld - [Central] Bombable Wall", "Overworld - [Southwest] Bombable Wall Near Fountain",
"Quarry - [West] Upper Area Bombable Wall", "Quarry - [East] Bombable Wall",
"Ruined Atoll - [Northwest] Bombable Wall"]
def randomize_ability_unlocks(random: Random, options: TunicOptions) -> Dict[str, int]:
ability_requirement = [1, 1, 1]
@@ -110,7 +116,7 @@ def set_region_rules(world: "TunicWorld") -> None:
lambda state: state.has_any({grapple, laurels}, player) and has_ability(prayer, state, world)
world.get_entrance("Overworld -> Quarry").access_rule = \
lambda state: (has_sword(state, player) or state.has(fire_wand, player)) \
and (state.has_any({grapple, laurels}, player) or can_ladder_storage(state, world))
and (state.has_any({grapple, laurels, gun}, player) or can_ladder_storage(state, world))
world.get_entrance("Quarry Back -> Quarry").access_rule = \
lambda state: has_sword(state, player) or state.has(fire_wand, player)
world.get_entrance("Quarry -> Lower Quarry").access_rule = \
@@ -326,6 +332,13 @@ def set_location_rules(world: "TunicWorld") -> None:
set_rule(world.get_location("Hero's Grave - Feathers Relic"),
lambda state: state.has(laurels, player) and has_ability(prayer, state, world))
# Bombable Walls
for location_name in bomb_walls:
# has_sword is there because you can buy bombs in the shop
set_rule(world.get_location(location_name), lambda state: state.has(gun, player) or has_sword(state, player))
add_rule(world.get_location("Cube Cave - Holy Cross Chest"),
lambda state: state.has(gun, player) or has_sword(state, player))
# Shop
set_rule(world.get_location("Shop - Potion 1"),
lambda state: has_sword(state, player))