The Witness: The Secret Feature (#4370)

* Secret Feature

* Fixes

* Fixes and unit tests

* renaming some variables

* Fix the thing

* unit test for elevator egg

* Docstring

* reword

* Fix duplicate locations I think?

* Remove debug thing

* Add the tests back lol

* Make it so that you can exclude an egg to disable it

* Improve hint text for easter eggs

* Update worlds/witness/options.py

Co-authored-by: Scipio Wright <scipiowright@gmail.com>

* Update worlds/witness/player_logic.py

Co-authored-by: Scipio Wright <scipiowright@gmail.com>

* Update worlds/witness/options.py

Co-authored-by: Scipio Wright <scipiowright@gmail.com>

* Update worlds/witness/player_logic.py

Co-authored-by: Scipio Wright <scipiowright@gmail.com>

* Update worlds/witness/rules.py

Co-authored-by: Scipio Wright <scipiowright@gmail.com>

* Update test_easter_egg_shuffle.py

* This was actually not necessary, since this is the Egg requirements, nothing to do with location names

* Move one of them

* Improve logic

* Lol

* Moar

* Adjust unit tests

* option docstring adjustment

* Recommend door shuffle

* Don't overlap IDs

* Option description idk

* Change the way the difficulties work to reward playing higher modes

* Fix merge

* add some stuff to generate_data_file (this file is not imported during gen, don't review it :D)

* oop

* space

* This can be earlier than I thought, apparently.

* buffer

* Comment

* Make sure the option is VERY visible

* Some mypy stuff

* apparently ruff wants this

* .

* durinig

* Update options.py

* Explain the additional effects of each difficulty

* Fix logic of flood room secret

* Add Southern Peninsula Area

* oop

---------

Co-authored-by: Scipio Wright <scipiowright@gmail.com>
This commit is contained in:
NewSoupVi
2025-03-08 01:44:06 +01:00
committed by GitHub
parent bc61221ec6
commit 08b3b3ecf5
18 changed files with 651 additions and 73 deletions

View File

@@ -196,6 +196,8 @@ def _has_item(item: str, world: "WitnessWorld",
if item == "Entity Hunt":
# Right now, panel hunt is the only type of entity hunt. This may need to be changed later
return _can_do_panel_hunt(world)
if "Eggs" in item:
return SimpleItemRepresentation("Egg", int(item.split(" ")[0]))
if item == "PP2 Weirdness":
return lambda state: _can_do_expert_pp2(state, world)
if item == "Theater to Tunnels":
@@ -303,6 +305,11 @@ def make_lambda(entity_hex: str, world: "WitnessWorld") -> Optional[CollectionRu
return _meets_item_requirements(entity_req, world)
def make_region_lambda(region_name: str, world: "WitnessWorld") -> CollectionRule:
region = world.get_region(region_name)
return lambda state: region.can_reach(state)
def set_rules(world: "WitnessWorld") -> None:
"""
Sets all rules for all locations
@@ -312,8 +319,12 @@ def set_rules(world: "WitnessWorld") -> None:
real_location = location
if location in world.player_locations.EVENT_LOCATION_TABLE:
entity_hex = world.player_logic.EVENT_ITEM_PAIRS[location][1]
real_location = static_witness_logic.ENTITIES_BY_HEX[entity_hex]["checkName"]
entity_hex_or_region_name = world.player_logic.EVENT_ITEM_PAIRS[location][1]
if entity_hex_or_region_name in static_witness_logic.ALL_REGIONS_BY_NAME:
set_rule(world.get_location(location), make_region_lambda(entity_hex_or_region_name, world))
continue
real_location = static_witness_logic.ENTITIES_BY_HEX[entity_hex_or_region_name]["checkName"]
associated_entity = world.player_logic.REFERENCE_LOGIC.ENTITIES_BY_NAME[real_location]
entity_hex = associated_entity["entity_hex"]