Files
Grinch-AP/worlds/inscryption/test/TestAccess.py

222 lines
13 KiB
Python
Raw Normal View History

Inscryption: Implement new game (#3621) * Worked locally before that so this is a lot of work . So, initial push * Changes in init with better create_regions (Thanks to Phar on discord). Add a rule for victory. Change the regions list to remove menu in the destination. * Added tests for location rules and changed rule locations to lists instead of sets * Fixed game var in InscryptionLocation * Fixed location access by using the same system from The Messenger * Remove unuse rules in init and add region rules. Add all the act 2 locations and items. * Add locations rule for the left of the bridge in act 2 * Added test for bridge requirement and added a dash to locationfor clarity * Added more act 2 rules and removed completion rule * Created docs for website, added Salmon Card item, marked multiple items as "progression", renamed tomb checks, added more location rules, re-added completion rule * Renamed tower bath check to "Tentacle", added monocle as requirement for some checks, adjusted setup doc a bit * Added tentacle to monocle test * Added forest burrow chest rule * Switch the two clock location because the id was swapped and screwed with the logic * Added Ancient Obol rule and adjusted docs * Added act 3 locations/items/rules/tests * Added drone & battery to trader rules * Fixed tutorial docs, added more act 3 rules, renamed holo pelt locations * Add an option for the optional death card feature * Added well check and quill item, added rules and tests * Renamed Gems module and Gems drone * Added slot data options * Added rule for act 3 middle pelt * Added option for randomize ability and uptade the randomize deck option to fit the new setup * Added randomize ability in slot data * Added more requirements for mycologists boss since it's pretty much an impossible fight early on * Finished the french translation of the installation guide * Changed the french title in the guide * Added goal option and tests associated to it + fixed goal requirement missing quill * Added goal option to docs and removed references to the now discarded API mod. Fixed some french translations. * Added ourobot item + renamed some goal settings * Fixed locations and items for act 1 goal * Added skip tutorial option. Cleanup and rename of some options. Added tower requirement for Mycologist Key check. Fixed missing comma in act 2 locations oopsies. * Added missing rules for Extra Battery, Nano Armor and Goobert's painting * Added act 1 deathlink behaviour and epitaph pieces randomization options + made pieces progressive + adjusted docs * Fixed some docs typos * Added act 3 clock rule. Paintings 2, 3 and Goobert's painting can no longer contain progression items. * New options system and fixed act 1 goal option breaking * Added skip epilogue and painting checks balancing options. Renamed randomize abilities to randomize sigils. Fixed generation issue with epitaph pieces randomization. Goobert's painting no longer forces filler. Removed traps option for now. Reworded some option descriptions. * Attempting type fix for python 3.8 * Attempting type fix for python 3.8 again * Added starting only option for randomize deck * Fixed arbitrary rule error * Import fix attempt * Migrated to DeathLinkMixin instead of creating a custom DeathLink option, cleaned up imports, renamed Death Link related options to include "death_link" instead of "deathlink", replaced numeral values for option checking into class attributes for readability, slight optimization to tower rule, fixed typo in codes option description. * Added bug report page to web class, condensed pelt rules to one function, added items/locations count in game docs and adjusted some sections * Added Inscryption to CODEOWNERS * Implemented a bunch of suggestions: Better handling of painting option, options as dict for slot data, remove redundant auto_display_name, use of has_all, better goal tests, demote skink card to filler if goal is act 1 and force filler on paintings * Makes clover plant and squirrel head progression items if paintings are balanced + fixed other issues * filler items, start inventory from pool, '->" * Fix bleeding issue * Copy the list instead * Fixed bleeding using proper deep copy * Remove unnecessary for loops in tests * Add defaults to choice options --------- Co-authored-by: Benjamin Gregoire <benjamingregoire@outlook.com> Co-authored-by: Exempt-Medic <ExemptMedic@Gmail.com> Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-12-21 17:12:35 -05:00
from . import InscryptionTestBase
class AccessTestGeneral(InscryptionTestBase):
def test_dagger(self) -> None:
self.assertAccessDependency(["Act 1 - Magnificus Eye"], [["Dagger"]])
def test_caged_wolf(self) -> None:
self.assertAccessDependency(["Act 1 - Dagger"], [["Caged Wolf Card"]])
def test_magnificus_eye(self) -> None:
self.assertAccessDependency(["Act 1 - Clock Main Compartment"], [["Magnificus Eye"]])
def test_wardrobe_key(self) -> None:
self.assertAccessDependency(
["Act 1 - Wardrobe Drawer 1", "Act 1 - Wardrobe Drawer 2",
"Act 1 - Wardrobe Drawer 3", "Act 1 - Wardrobe Drawer 4"],
[["Wardrobe Key"]]
)
def test_ancient_obol(self) -> None:
self.assertAccessDependency(
["Act 2 - Bone Lord Femur", "Act 2 - Bone Lord Horn", "Act 2 - Bone Lord Holo Key"],
[["Ancient Obol"]]
)
def test_holo_pelt(self) -> None:
self.assertAccessDependency(
["Act 3 - Trader 1", "Act 3 - Trader 2", "Act 3 - Trader 3", "Act 3 - Trader 4", "Act 3 - Trader 5"],
[["Holo Pelt"]]
)
def test_inspectometer_battery(self) -> None:
self.assertAccessDependency(
["Act 3 - Boss Photographer", "Act 3 - Boss Archivist", "Act 3 - Boss Unfinished", "Act 3 - Boss G0lly",
"Act 3 - Trader 1", "Act 3 - Trader 2", "Act 3 - Trader 3", "Act 3 - Trader 4", "Act 3 - Trader 5",
"Act 3 - Shop Holo Pelt", "Act 3 - Middle Holo Pelt", "Act 3 - Forest Holo Pelt", "Act 3 - Clock",
"Act 3 - Crypt Holo Pelt", "Act 3 - Gems Drone", "Act 3 - Nano Armor Generator", "Act 3 - Extra Battery",
"Act 3 - Tower Holo Pelt", "Act 3 - The Great Transcendence", "Act 3 - Boss Mycologists",
"Act 3 - Bone Lord Room", "Act 3 - Well", "Act 3 - Luke's File Entry 1", "Act 3 - Luke's File Entry 2",
"Act 3 - Luke's File Entry 3", "Act 3 - Luke's File Entry 4", "Act 3 - Goobert's Painting"],
[["Inspectometer Battery"]]
)
def test_gem_drone(self) -> None:
self.assertAccessDependency(
["Act 3 - Boss Unfinished", "Act 3 - Boss G0lly", "Act 3 - Trader 1", "Act 3 - Trader 2",
"Act 3 - Trader 3", "Act 3 - Trader 4", "Act 3 - Trader 5", "Act 3 - Shop Holo Pelt", "Act 3 - Clock",
"Act 3 - Tower Holo Pelt", "Act 3 - The Great Transcendence", "Act 3 - Luke's File Entry 4",
"Act 3 - Boss Mycologists", "Act 3 - Nano Armor Generator", "Act 3 - Goobert's Painting"],
[["Gems Module"]]
)
def test_mycologists_holo_key(self) -> None:
self.assertAccessDependency(
["Act 3 - Boss Mycologists"],
[["Mycologists Holo Key"]]
)
def test_bone_lord_holo_key(self) -> None:
self.assertAccessDependency(
["Act 3 - Bone Lord Room"],
[["Bone Lord Holo Key"]]
)
def test_quill(self) -> None:
self.assertAccessDependency(
["Act 3 - Boss Archivist", "Act 3 - Luke's File Entry 1", "Act 3 - Luke's File Entry 2",
"Act 3 - Luke's File Entry 3", "Act 3 - Luke's File Entry 4", "Act 3 - The Great Transcendence",
"Act 3 - Boss Mycologists"],
[["Quill"]]
)
class AccessTestOrdered(InscryptionTestBase):
options = {
"goal": 0,
}
def test_film_roll(self) -> None:
self.assertAccessDependency(
["Act 2 - Battle Prospector", "Act 2 - Battle Angler", "Act 2 - Battle Trapper", "Act 2 - Battle Sawyer",
"Act 2 - Battle Royal", "Act 2 - Battle Kaycee", "Act 2 - Battle Pike Mage", "Act 2 - Battle Goobert",
"Act 2 - Battle Lonely Wizard", "Act 2 - Battle Inspector", "Act 2 - Battle Melter",
"Act 2 - Battle Dredger", "Act 2 - Tower Chest 1", "Act 2 - Tower Chest 2", "Act 2 - Tower Chest 3",
"Act 2 - Forest Meadow Chest", "Act 2 - Forest Cabin Chest", "Act 2 - Cabin Wardrobe Drawer",
"Act 2 - Cabin Safe", "Act 2 - Crypt Casket 1", "Act 2 - Crypt Casket 2", "Act 2 - Crypt Well",
"Act 2 - Camera Replica", "Act 2 - Clover", "Act 2 - Epitaph Piece 1", "Act 2 - Epitaph Piece 2",
"Act 2 - Epitaph Piece 3", "Act 2 - Epitaph Piece 4", "Act 2 - Epitaph Piece 5", "Act 2 - Epitaph Piece 6",
"Act 2 - Epitaph Piece 7", "Act 2 - Epitaph Piece 8", "Act 2 - Epitaph Piece 9", "Act 2 - Dock Chest",
"Act 2 - Tentacle", "Act 2 - Factory Trash Can", "Act 2 - Factory Drawer 1",
"Act 2 - Ancient Obol", "Act 2 - Factory Drawer 2", "Act 2 - Factory Chest 1", "Act 2 - Factory Chest 2",
"Act 2 - Factory Chest 3", "Act 2 - Factory Chest 4", "Act 2 - Monocle", "Act 2 - Boss Leshy",
"Act 2 - Boss Grimora", "Act 2 - Boss Magnificus", "Act 2 - Boss P03", "Act 2 - Mycologists Holo Key",
"Act 2 - Bone Lord Femur", "Act 2 - Bone Lord Horn", "Act 2 - Bone Lord Holo Key",
"Act 3 - Boss Photographer", "Act 3 - Boss Archivist", "Act 3 - Boss Unfinished", "Act 3 - Boss G0lly",
"Act 3 - Boss Mycologists", "Act 3 - Bone Lord Room", "Act 3 - Shop Holo Pelt", "Act 3 - Middle Holo Pelt",
"Act 3 - Forest Holo Pelt", "Act 3 - Crypt Holo Pelt", "Act 3 - Tower Holo Pelt", "Act 3 - Trader 1",
"Act 3 - Trader 2", "Act 3 - Trader 3", "Act 3 - Trader 4", "Act 3 - Trader 5", "Act 3 - Drawer 1",
"Act 3 - Drawer 2", "Act 3 - Clock", "Act 3 - Extra Battery", "Act 3 - Nano Armor Generator",
"Act 3 - Chest", "Act 3 - Goobert's Painting", "Act 3 - Luke's File Entry 1", "Act 3 - Gems Drone",
"Act 3 - Luke's File Entry 2", "Act 3 - Luke's File Entry 3", "Act 3 - Luke's File Entry 4",
"Act 3 - Inspectometer Battery", "Act 3 - Gems Drone", "Act 3 - The Great Transcendence", "Act 3 - Well"],
[["Film Roll"]]
)
def test_epitaphs_and_forest_items(self) -> None:
self.assertAccessDependency(
["Act 2 - Battle Prospector", "Act 2 - Battle Angler", "Act 2 - Battle Trapper",
"Act 2 - Battle Pike Mage", "Act 2 - Battle Goobert", "Act 2 - Battle Lonely Wizard",
"Act 2 - Battle Inspector", "Act 2 - Battle Melter", "Act 2 - Battle Dredger",
"Act 2 - Tower Chest 1", "Act 2 - Tower Chest 2", "Act 2 - Tower Chest 3", "Act 2 - Forest Meadow Chest",
"Act 2 - Tentacle", "Act 2 - Factory Trash Can", "Act 2 - Factory Drawer 1", "Act 2 - Ancient Obol",
"Act 2 - Factory Drawer 2", "Act 2 - Factory Chest 1", "Act 2 - Factory Chest 2",
"Act 2 - Factory Chest 3", "Act 2 - Factory Chest 4", "Act 2 - Monocle", "Act 2 - Boss Leshy",
"Act 2 - Boss Grimora", "Act 2 - Boss Magnificus", "Act 2 - Boss P03", "Act 2 - Mycologists Holo Key",
"Act 3 - Boss Photographer", "Act 3 - Boss Archivist", "Act 3 - Boss Unfinished", "Act 3 - Boss G0lly",
"Act 3 - Boss Mycologists", "Act 3 - Bone Lord Room", "Act 3 - Shop Holo Pelt", "Act 3 - Middle Holo Pelt",
"Act 3 - Forest Holo Pelt", "Act 3 - Crypt Holo Pelt", "Act 3 - Tower Holo Pelt", "Act 3 - Trader 1",
"Act 3 - Trader 2", "Act 3 - Trader 3", "Act 3 - Trader 4", "Act 3 - Trader 5", "Act 3 - Drawer 1",
"Act 3 - Drawer 2", "Act 3 - Clock", "Act 3 - Extra Battery", "Act 3 - Nano Armor Generator",
"Act 3 - Chest", "Act 3 - Goobert's Painting", "Act 3 - Luke's File Entry 1", "Act 3 - Gems Drone",
"Act 3 - Luke's File Entry 2", "Act 3 - Luke's File Entry 3", "Act 3 - Luke's File Entry 4",
"Act 3 - Inspectometer Battery", "Act 3 - Gems Drone", "Act 3 - The Great Transcendence", "Act 3 - Well"],
[["Epitaph Piece", "Camera Replica", "Pile Of Meat"]]
)
def test_epitaphs(self) -> None:
self.assertAccessDependency(
["Act 2 - Boss Grimora",
"Act 3 - Boss Photographer", "Act 3 - Boss Archivist", "Act 3 - Boss Unfinished", "Act 3 - Boss G0lly",
"Act 3 - Boss Mycologists", "Act 3 - Bone Lord Room", "Act 3 - Shop Holo Pelt", "Act 3 - Middle Holo Pelt",
"Act 3 - Forest Holo Pelt", "Act 3 - Crypt Holo Pelt", "Act 3 - Tower Holo Pelt", "Act 3 - Trader 1",
"Act 3 - Trader 2", "Act 3 - Trader 3", "Act 3 - Trader 4", "Act 3 - Trader 5", "Act 3 - Drawer 1",
"Act 3 - Drawer 2", "Act 3 - Clock", "Act 3 - Extra Battery", "Act 3 - Nano Armor Generator",
"Act 3 - Chest", "Act 3 - Goobert's Painting", "Act 3 - Luke's File Entry 1", "Act 3 - Gems Drone",
"Act 3 - Luke's File Entry 2", "Act 3 - Luke's File Entry 3", "Act 3 - Luke's File Entry 4",
"Act 3 - Inspectometer Battery", "Act 3 - Gems Drone", "Act 3 - The Great Transcendence", "Act 3 - Well"],
[["Epitaph Piece"]]
)
def test_forest_items(self) -> None:
self.assertAccessDependency(
["Act 2 - Battle Prospector", "Act 2 - Battle Angler", "Act 2 - Battle Trapper",
"Act 2 - Boss Leshy", "Act 2 - Forest Meadow Chest",
"Act 3 - Boss Photographer", "Act 3 - Boss Archivist", "Act 3 - Boss Unfinished", "Act 3 - Boss G0lly",
"Act 3 - Boss Mycologists", "Act 3 - Bone Lord Room", "Act 3 - Shop Holo Pelt", "Act 3 - Middle Holo Pelt",
"Act 3 - Forest Holo Pelt", "Act 3 - Crypt Holo Pelt", "Act 3 - Tower Holo Pelt", "Act 3 - Trader 1",
"Act 3 - Trader 2", "Act 3 - Trader 3", "Act 3 - Trader 4", "Act 3 - Trader 5", "Act 3 - Drawer 1",
"Act 3 - Drawer 2", "Act 3 - Clock", "Act 3 - Extra Battery", "Act 3 - Nano Armor Generator",
"Act 3 - Chest", "Act 3 - Goobert's Painting", "Act 3 - Luke's File Entry 1", "Act 3 - Gems Drone",
"Act 3 - Luke's File Entry 2", "Act 3 - Luke's File Entry 3", "Act 3 - Luke's File Entry 4",
"Act 3 - Inspectometer Battery", "Act 3 - Gems Drone", "Act 3 - The Great Transcendence", "Act 3 - Well"],
[["Camera Replica", "Pile Of Meat"]]
)
def test_monocle(self) -> None:
self.assertAccessDependency(
["Act 2 - Battle Goobert", "Act 2 - Battle Pike Mage", "Act 2 - Battle Lonely Wizard",
"Act 2 - Boss Magnificus", "Act 2 - Tower Chest 2", "Act 2 - Tower Chest 3",
"Act 2 - Tentacle", "Act 2 - Ancient Obol", "Act 2 - Mycologists Holo Key",
"Act 3 - Boss Photographer", "Act 3 - Boss Archivist", "Act 3 - Boss Unfinished", "Act 3 - Boss G0lly",
"Act 3 - Boss Mycologists", "Act 3 - Bone Lord Room", "Act 3 - Shop Holo Pelt", "Act 3 - Middle Holo Pelt",
"Act 3 - Forest Holo Pelt", "Act 3 - Crypt Holo Pelt", "Act 3 - Tower Holo Pelt", "Act 3 - Trader 1",
"Act 3 - Trader 2", "Act 3 - Trader 3", "Act 3 - Trader 4", "Act 3 - Trader 5", "Act 3 - Drawer 1",
"Act 3 - Drawer 2", "Act 3 - Clock", "Act 3 - Extra Battery", "Act 3 - Nano Armor Generator",
"Act 3 - Chest", "Act 3 - Goobert's Painting", "Act 3 - Luke's File Entry 1", "Act 3 - Gems Drone",
"Act 3 - Luke's File Entry 2", "Act 3 - Luke's File Entry 3", "Act 3 - Luke's File Entry 4",
"Act 3 - Inspectometer Battery", "Act 3 - Gems Drone", "Act 3 - The Great Transcendence", "Act 3 - Well"],
[["Monocle"]]
)
class AccessTestUnordered(InscryptionTestBase):
options = {
"goal": 1,
}
def test_epitaphs_and_forest_items(self) -> None:
self.assertAccessDependency(
["Act 2 - Battle Prospector", "Act 2 - Battle Angler", "Act 2 - Battle Trapper",
"Act 2 - Battle Pike Mage", "Act 2 - Battle Goobert", "Act 2 - Battle Lonely Wizard",
"Act 2 - Battle Inspector", "Act 2 - Battle Melter", "Act 2 - Battle Dredger",
"Act 2 - Tower Chest 1", "Act 2 - Tower Chest 2", "Act 2 - Tower Chest 3", "Act 2 - Forest Meadow Chest",
"Act 2 - Tentacle", "Act 2 - Factory Trash Can", "Act 2 - Factory Drawer 1", "Act 2 - Ancient Obol",
"Act 2 - Factory Drawer 2", "Act 2 - Factory Chest 1", "Act 2 - Factory Chest 2",
"Act 2 - Factory Chest 3", "Act 2 - Factory Chest 4", "Act 2 - Monocle", "Act 2 - Boss Leshy",
"Act 2 - Boss Grimora", "Act 2 - Boss Magnificus", "Act 2 - Boss P03", "Act 2 - Mycologists Holo Key"],
[["Epitaph Piece", "Camera Replica", "Pile Of Meat"]]
)
def test_epitaphs(self) -> None:
self.assertAccessDependency(
["Act 2 - Boss Grimora"],
[["Epitaph Piece"]]
)
def test_forest_items(self) -> None:
self.assertAccessDependency(
["Act 2 - Battle Prospector", "Act 2 - Battle Angler", "Act 2 - Battle Trapper",
"Act 2 - Boss Leshy", "Act 2 - Forest Meadow Chest"],
[["Camera Replica", "Pile Of Meat"]]
)
def test_monocle(self) -> None:
self.assertAccessDependency(
["Act 2 - Battle Goobert", "Act 2 - Battle Pike Mage", "Act 2 - Battle Lonely Wizard",
"Act 2 - Boss Magnificus", "Act 2 - Tower Chest 2", "Act 2 - Tower Chest 3",
"Act 2 - Tentacle", "Act 2 - Ancient Obol", "Act 2 - Mycologists Holo Key"],
[["Monocle"]]
)
class AccessTestBalancedPaintings(InscryptionTestBase):
options = {
"painting_checks_balancing": 1,
}
def test_paintings(self) -> None:
self.assertAccessDependency(["Act 1 - Painting 2", "Act 1 - Painting 3"],
[["Oil Painting's Clover Plant", "Squirrel Totem Head"]])