Files
Grinch-AP/worlds/witness/test/test_symbol_shuffle.py

81 lines
3.2 KiB
Python
Raw Normal View History

from ..test.bases import WitnessMultiworldTestBase, WitnessTestBase
2024-07-06 13:40:55 +02:00
class TestSymbols(WitnessTestBase):
options = {
"early_symbol_item": False,
}
def test_progressive_symbols(self) -> None:
"""
Test that Dots & Full Dots are correctly replaced by 2x Progressive Dots,
and test that Dots puzzles and Full Dots puzzles require 1 and 2 copies of this item respectively.
"""
progressive_dots = self.get_items_by_name("Progressive Dots")
self.assertEqual(len(progressive_dots), 2)
self.assertFalse(self.multiworld.state.can_reach("Outside Tutorial Shed Row 5", "Location", self.player))
self.assertFalse(
self.multiworld.state.can_reach("Outside Tutorial Outpost Entry Panel", "Location", self.player)
)
self.collect(progressive_dots.pop())
self.assertTrue(self.multiworld.state.can_reach("Outside Tutorial Shed Row 5", "Location", self.player))
self.assertFalse(
self.multiworld.state.can_reach("Outside Tutorial Outpost Entry Panel", "Location", self.player)
)
self.collect(progressive_dots.pop())
self.assertTrue(self.multiworld.state.can_reach("Outside Tutorial Shed Row 5", "Location", self.player))
self.assertTrue(
self.multiworld.state.can_reach("Outside Tutorial Outpost Entry Panel", "Location", self.player)
)
class TestSymbolRequirementsMultiworld(WitnessMultiworldTestBase):
options_per_world = [
{
"puzzle_randomization": "sigma_normal",
},
{
"puzzle_randomization": "sigma_expert",
},
{
"puzzle_randomization": "none",
},
The Witness: Implement "Variety" puzzles mode (#3239) * Variety Rando (But WitnessLogicVariety.txt is wrong * Actually variety the variety file (Ty Exempt-Medic <3) * This will be preopened * Tooltip explaining the different difficulties * Remove ?, those were correct * Less efficient but easier to follow * Parentheses * Fix some reqs * Not Arrows in Variety * Oops * Happy medic, I made a wacky solution * there we go * Lint oops * There * that copy is unnecessary * Turns out that copy is necessary still * yes * lol * Rename to Umbra Variety * missed one * Erase the Eraser * Fix remaining instances of 'variety' and don't have a symbol item on the gate in variety * reorder difficulties * inbetween * ruff * Fix Variety Invis requirements * Fix wooden beams variety * Fix PP2 variety * Mirror changes from 'Variety Mode Puzzle Change 3.2.3' * These also have Symmetry * merge error prevention * Update worlds/witness/data/static_items.py Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * no elif after return * add variety to the symbol requirement bleed test * Add variety to one of the 'other settings' unit tests * Add Variety minimal symbols unittest * oops * I did the dumb again * . * Incorporate changes from other PR into WitnesLogicVariety.txt * Update worlds/witness/data/WitnessLogicVariety.txt Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * Update worlds/witness/data/WitnessLogicVariety.txt Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * Update the reqs as well haha * Another difference, thanks Medic :§ * Wait no, this one was right * lol * apply changes to WitnessLogicVariety.txt * Add most recent Variety changes * oof --------- Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 17:10:09 +02:00
{
"puzzle_randomization": "umbra_variety",
}
2024-07-06 13:40:55 +02:00
]
common_options = {
"shuffle_discarded_panels": True,
"early_symbol_item": False,
}
def test_arrows_exist_and_are_required_in_expert_seeds_only(self) -> None:
"""
In sigma_expert, Discarded Panels require Arrows.
In sigma_normal, Discarded Panels require Triangles, and Arrows shouldn't exist at all as an item.
"""
with self.subTest("Test that Arrows exist only in the expert seed."):
self.assertFalse(self.get_items_by_name("Arrows", 1))
self.assertTrue(self.get_items_by_name("Arrows", 2))
self.assertFalse(self.get_items_by_name("Arrows", 3))
The Witness: Implement "Variety" puzzles mode (#3239) * Variety Rando (But WitnessLogicVariety.txt is wrong * Actually variety the variety file (Ty Exempt-Medic <3) * This will be preopened * Tooltip explaining the different difficulties * Remove ?, those were correct * Less efficient but easier to follow * Parentheses * Fix some reqs * Not Arrows in Variety * Oops * Happy medic, I made a wacky solution * there we go * Lint oops * There * that copy is unnecessary * Turns out that copy is necessary still * yes * lol * Rename to Umbra Variety * missed one * Erase the Eraser * Fix remaining instances of 'variety' and don't have a symbol item on the gate in variety * reorder difficulties * inbetween * ruff * Fix Variety Invis requirements * Fix wooden beams variety * Fix PP2 variety * Mirror changes from 'Variety Mode Puzzle Change 3.2.3' * These also have Symmetry * merge error prevention * Update worlds/witness/data/static_items.py Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * no elif after return * add variety to the symbol requirement bleed test * Add variety to one of the 'other settings' unit tests * Add Variety minimal symbols unittest * oops * I did the dumb again * . * Incorporate changes from other PR into WitnesLogicVariety.txt * Update worlds/witness/data/WitnessLogicVariety.txt Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * Update worlds/witness/data/WitnessLogicVariety.txt Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * Update the reqs as well haha * Another difference, thanks Medic :§ * Wait no, this one was right * lol * apply changes to WitnessLogicVariety.txt * Add most recent Variety changes * oof --------- Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 17:10:09 +02:00
self.assertTrue(self.get_items_by_name("Arrows", 4))
2024-07-06 13:40:55 +02:00
with self.subTest("Test that Discards ask for Triangles in normal, but Arrows in expert."):
desert_discard = "0x17CE7"
triangles = frozenset({frozenset({"Triangles"})})
arrows = frozenset({frozenset({"Arrows"})})
The Witness: Implement "Variety" puzzles mode (#3239) * Variety Rando (But WitnessLogicVariety.txt is wrong * Actually variety the variety file (Ty Exempt-Medic <3) * This will be preopened * Tooltip explaining the different difficulties * Remove ?, those were correct * Less efficient but easier to follow * Parentheses * Fix some reqs * Not Arrows in Variety * Oops * Happy medic, I made a wacky solution * there we go * Lint oops * There * that copy is unnecessary * Turns out that copy is necessary still * yes * lol * Rename to Umbra Variety * missed one * Erase the Eraser * Fix remaining instances of 'variety' and don't have a symbol item on the gate in variety * reorder difficulties * inbetween * ruff * Fix Variety Invis requirements * Fix wooden beams variety * Fix PP2 variety * Mirror changes from 'Variety Mode Puzzle Change 3.2.3' * These also have Symmetry * merge error prevention * Update worlds/witness/data/static_items.py Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * no elif after return * add variety to the symbol requirement bleed test * Add variety to one of the 'other settings' unit tests * Add Variety minimal symbols unittest * oops * I did the dumb again * . * Incorporate changes from other PR into WitnesLogicVariety.txt * Update worlds/witness/data/WitnessLogicVariety.txt Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * Update worlds/witness/data/WitnessLogicVariety.txt Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * Update the reqs as well haha * Another difference, thanks Medic :§ * Wait no, this one was right * lol * apply changes to WitnessLogicVariety.txt * Add most recent Variety changes * oof --------- Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 17:10:09 +02:00
both = frozenset({frozenset({"Triangles", "Arrows"})})
2024-07-06 13:40:55 +02:00
self.assertEqual(self.multiworld.worlds[1].player_logic.REQUIREMENTS_BY_HEX[desert_discard], triangles)
self.assertEqual(self.multiworld.worlds[2].player_logic.REQUIREMENTS_BY_HEX[desert_discard], arrows)
self.assertEqual(self.multiworld.worlds[3].player_logic.REQUIREMENTS_BY_HEX[desert_discard], triangles)
The Witness: Implement "Variety" puzzles mode (#3239) * Variety Rando (But WitnessLogicVariety.txt is wrong * Actually variety the variety file (Ty Exempt-Medic <3) * This will be preopened * Tooltip explaining the different difficulties * Remove ?, those were correct * Less efficient but easier to follow * Parentheses * Fix some reqs * Not Arrows in Variety * Oops * Happy medic, I made a wacky solution * there we go * Lint oops * There * that copy is unnecessary * Turns out that copy is necessary still * yes * lol * Rename to Umbra Variety * missed one * Erase the Eraser * Fix remaining instances of 'variety' and don't have a symbol item on the gate in variety * reorder difficulties * inbetween * ruff * Fix Variety Invis requirements * Fix wooden beams variety * Fix PP2 variety * Mirror changes from 'Variety Mode Puzzle Change 3.2.3' * These also have Symmetry * merge error prevention * Update worlds/witness/data/static_items.py Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * no elif after return * add variety to the symbol requirement bleed test * Add variety to one of the 'other settings' unit tests * Add Variety minimal symbols unittest * oops * I did the dumb again * . * Incorporate changes from other PR into WitnesLogicVariety.txt * Update worlds/witness/data/WitnessLogicVariety.txt Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * Update worlds/witness/data/WitnessLogicVariety.txt Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * Update the reqs as well haha * Another difference, thanks Medic :§ * Wait no, this one was right * lol * apply changes to WitnessLogicVariety.txt * Add most recent Variety changes * oof --------- Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 17:10:09 +02:00
self.assertEqual(self.multiworld.worlds[4].player_logic.REQUIREMENTS_BY_HEX[desert_discard], both)