Files
Grinch-AP/worlds/tunic/test/test_access.py

125 lines
6.1 KiB
Python
Raw Normal View History

2024-01-12 14:32:15 -05:00
from . import TunicTestBase
from .. import options
class TestAccess(TunicTestBase):
# test whether you can get into the temple without laurels
2024-04-13 20:06:06 -04:00
def test_temple_access(self) -> None:
2024-01-12 14:32:15 -05:00
self.collect_all_but(["Hero's Laurels", "Lantern"])
self.assertFalse(self.can_reach_location("Sealed Temple - Page Pickup"))
self.collect_by_name(["Lantern"])
self.assertTrue(self.can_reach_location("Sealed Temple - Page Pickup"))
# test that the wells function properly. Since fairies is written the same way, that should succeed too
2024-04-13 20:06:06 -04:00
def test_wells(self) -> None:
2024-01-12 14:32:15 -05:00
self.collect_all_but(["Golden Coin"])
self.assertFalse(self.can_reach_location("Coins in the Well - 3 Coins"))
self.collect_by_name(["Golden Coin"])
self.assertTrue(self.can_reach_location("Coins in the Well - 3 Coins"))
class TestStandardShuffle(TunicTestBase):
options = {options.AbilityShuffling.internal_name: options.AbilityShuffling.option_true}
# test that you need to get holy cross to open the hc door in overworld
2024-04-13 20:06:06 -04:00
def test_hc_door(self) -> None:
2024-01-12 14:32:15 -05:00
self.assertFalse(self.can_reach_location("Fountain Cross Door - Page Pickup"))
self.collect_by_name("Pages 42-43 (Holy Cross)")
self.assertTrue(self.can_reach_location("Fountain Cross Door - Page Pickup"))
class TestHexQuestShuffle(TunicTestBase):
options = {options.HexagonQuest.internal_name: options.HexagonQuest.option_true,
options.AbilityShuffling.internal_name: options.AbilityShuffling.option_true}
# test that you need the gold questagons to open the hc door in overworld
2024-04-13 20:06:06 -04:00
def test_hc_door_hex_shuffle(self) -> None:
2024-01-12 14:32:15 -05:00
self.assertFalse(self.can_reach_location("Fountain Cross Door - Page Pickup"))
self.collect_by_name("Gold Questagon")
self.assertTrue(self.can_reach_location("Fountain Cross Door - Page Pickup"))
class TestHexQuestNoShuffle(TunicTestBase):
options = {options.HexagonQuest.internal_name: options.HexagonQuest.option_true,
options.AbilityShuffling.internal_name: options.AbilityShuffling.option_false}
# test that you can get the item behind the overworld hc door with nothing and no ability shuffle
2024-04-13 20:06:06 -04:00
def test_hc_door_no_shuffle(self) -> None:
2024-01-12 14:32:15 -05:00
self.assertTrue(self.can_reach_location("Fountain Cross Door - Page Pickup"))
class TestNormalGoal(TunicTestBase):
options = {options.HexagonQuest.internal_name: options.HexagonQuest.option_false}
# test that you need the three colored hexes to reach the Heir in standard
2024-04-13 20:06:06 -04:00
def test_normal_goal(self) -> None:
2024-01-12 14:32:15 -05:00
location = ["The Heir"]
items = [["Red Questagon", "Blue Questagon", "Green Questagon"]]
self.assertAccessDependency(location, items)
class TestER(TunicTestBase):
options = {options.EntranceRando.internal_name: options.EntranceRando.option_yes,
2024-01-12 14:32:15 -05:00
options.AbilityShuffling.internal_name: options.AbilityShuffling.option_true,
options.HexagonQuest.internal_name: options.HexagonQuest.option_false}
2024-04-13 20:06:06 -04:00
def test_overworld_hc_chest(self) -> None:
2024-01-12 14:32:15 -05:00
# test to see that static connections are working properly -- this chest requires holy cross and is in Overworld
self.assertFalse(self.can_reach_location("Overworld - [Southwest] Flowers Holy Cross"))
self.collect_by_name(["Pages 42-43 (Holy Cross)"])
self.assertTrue(self.can_reach_location("Overworld - [Southwest] Flowers Holy Cross"))
TUNIC: Logic Rules Redux (#3544) * Clean these functions up, get the hell out of here 5 parameter function * Clean up a bunch of rules that no longer need to be multi-lined since the functions are shorter * Clean up some range functions * Update to use world instead of player like Vi recommended * Fix merge conflict * Create new options * Slightly revise ls rule * Update options.py * Update options.py * Add tedious option for ls * Update laurels zips description * Create new options * Slightly revise ls rule * Update options.py * Update options.py * Add tedious option for ls * Update laurels zips description * Creating structures to redo ladder storage rules * Put together overworld ladder groups, remove tedious * Write up the rules for the regular rules * Update slot data and UT stuff * Put new ice grapple stuff in er rules * Ice grapple hard to get to fountain cross room * More ladder data * Wrote majority of overworld ladder rules * Finish the ladder storage rules * Update notes * Add note * Add well rail to the rules * More rules * Comment out logically irrelevant entrances * Update with laurels_zip helper * Add parameter to has_ice_grapple_logic for difficulty * Add new parameter to has_ice_grapple_logic * Move ice grapple chest to lower forest in ER/ladders * Fix rule * Finishing out hooking the new rules into the code * Fix bugs * Add more hard ice grapples * Fix more bugs * Shops my beloved * Change victory condition back * Remove debug stuff * Update plando connections description * Fix extremely rare bug * Add well front -> back hard ladder storages * Note in ls rules about knocking yourself down with bombs being out of logic * Add atoll fuse with wand + hard ls * Add some nonsense that boils down to activating the fuse in overworld * Further update LS description * Fix missing logic on bridge switch chest in upper zig * Revise upper zig rule change to account for ER * Fix merge conflict * Fix formatting, fix rule for heir access after merge * Add the shop sword logic stuff in * Remove todo that was already done * Fill out a to-do with some cursed nonsense * Fix event in wrong region * Fix missing cathedral -> elevator connection * Fix missing cathedral -> elevator connection * Add ER exception to cathedral -> elevator * Fix secret gathering place issue * Fix incorrect ls rule * Move 3 locations to Quarry Back since they're easily accessible from the back * Also update non-er region * Remove redundant parentheses * Add new test for a weird edge case in ER * Slight option description updates * Use has_ladder in spots where it wasn't used for some reason, add a comment * Fix unit test for ER * Update per exempt's suggestion * Add back LogicRules as an invisible option, to not break old yamls * Remove unused elevation from portal class * Update ladder storage without items description * Remove shop_scene stuff since it's no longer relevant in the mod by the time this version comes out * Remove shop scene stuff from game info since it's no longer relevant in the mod by the time this comes out * Update portal list to match main * god I love github merging things * Remove note * Add ice grapple hard path from upper overworld to temple rafters entrance * Actually that should be medium * Remove outdated note * Add ice grapple hard for swamp mid to the ledge * Add missing laurels zip in swamp * Some fixes to the ladder storage data while reviewing it * Add unit test for weird edge case * Backport outlet region system to fix ls bug * Fix incorrect ls, add todo * Add missing swamp ladder storage connections * Add swamp zip to er data * Add swamp zip to er rules * Add hard ice grapple for forest grave path main to upper * Add ice grapple logic for all bomb walls except the east quarry one * Add ice grapple logic for frog stairs eye to mouth without the ladder * Add hard ice grapple for overworld to the stairs to west garden * Add the ice grapple boss quick kills to medium ice grappling * Add the reverse connection for the ice grapple kill on Garden Knight * Add atoll house ice grapple push, and add west garden ice grapple entry to the regular rules
2024-09-08 08:42:59 -04:00
class TestERSpecial(TunicTestBase):
options = {options.EntranceRando.internal_name: options.EntranceRando.option_yes,
options.AbilityShuffling.internal_name: options.AbilityShuffling.option_true,
options.HexagonQuest.internal_name: options.HexagonQuest.option_false,
options.FixedShop.internal_name: options.FixedShop.option_false,
options.IceGrappling.internal_name: options.IceGrappling.option_easy,
"plando_connections": [
{
"entrance": "Stick House Entrance",
"exit": "Ziggurat Portal Room Entrance"
},
{
"entrance": "Ziggurat Lower to Ziggurat Tower",
"exit": "Secret Gathering Place Exit"
}
]}
# with these plando connections, you need to ice grapple from the back of lower zig to the front to get laurels
# ensure that ladder storage connections connect to the outlet region, not the portal's region
class TestLadderStorage(TunicTestBase):
options = {options.EntranceRando.internal_name: options.EntranceRando.option_yes,
options.AbilityShuffling.internal_name: options.AbilityShuffling.option_true,
options.HexagonQuest.internal_name: options.HexagonQuest.option_false,
options.FixedShop.internal_name: options.FixedShop.option_false,
options.LadderStorage.internal_name: options.LadderStorage.option_hard,
options.LadderStorageWithoutItems.internal_name: options.LadderStorageWithoutItems.option_false,
"plando_connections": [
{
"entrance": "Fortress Courtyard Shop",
# "exit": "Ziggurat Portal Room Exit"
"exit": "Spawn to Far Shore"
},
{
"entrance": "Fortress Courtyard to Beneath the Vault",
"exit": "Stick House Exit"
},
{
"entrance": "Stick House Entrance",
"exit": "Fortress Courtyard to Overworld"
},
{
"entrance": "Old House Waterfall Entrance",
"exit": "Ziggurat Portal Room Entrance"
},
]}
def test_ls_to_shop_entrance(self) -> None:
self.collect_by_name(["Magic Orb"])
self.assertFalse(self.can_reach_location("Fortress Courtyard - Page Near Cave"))
self.collect_by_name(["Pages 24-25 (Prayer)"])
self.assertTrue(self.can_reach_location("Fortress Courtyard - Page Near Cave"))