Files
Archipelago/worlds/jakanddaxter/test/test_traps.py
massimilianodelliubaldini 263311d641 Traps 2 (#70)
* Add trap items, relevant options, and citadel orb caches.

* Update REPL to send traps to game.

* Fix item counter.

* Allow player to select which traps to use.

* Fix host.yaml doc strings, ap-setup-options typing, bump memory version to 5.

* Alter some trap names.

* Update world doc.

* Add health trap.

* Added 3 more trap types.

* Protect against empty trap list.

* Reword traps paragraph in world doc.

* Another update to trap paragraph.

* Concisify trap option docstring.

* Timestamp on game log file.

* Update client to handle waiting on title screen.

* Send slot name and seed to game.

* Use self.random instead.

* Update setup doc for new title screen.

* Quick clarification of orb caches in world doc.

* Sanitize slot info earlier.

* Added to and improved unit tests.

* Light cleanup on world.

* Optimizations to movement rules, docs: known issues update.
2025-02-15 23:35:30 -05:00

81 lines
3.1 KiB
Python

from BaseClasses import ItemClassification
from ..test import JakAndDaxterTestBase
class NoTrapsTest(JakAndDaxterTestBase):
options = {
"filler_power_cells_replaced_with_traps": 0,
"filler_orb_bundles_replaced_with_traps": 0,
"chosen_traps": ["Trip Trap"]
}
def test_trap_count(self):
count = len([item.name for item in self.multiworld.itempool
if item.name == "Trip Trap"
and item.classification == ItemClassification.trap])
self.assertEqual(0, count)
def test_prog_power_cells_count(self):
count = len([item.name for item in self.multiworld.itempool
if item.name == "Power Cell"
and item.classification == ItemClassification.progression_skip_balancing])
self.assertEqual(72, count)
def test_fill_power_cells_count(self):
count = len([item.name for item in self.multiworld.itempool
if item.name == "Power Cell"
and item.classification == ItemClassification.filler])
self.assertEqual(29, count)
class SomeTrapsTest(JakAndDaxterTestBase):
options = {
"filler_power_cells_replaced_with_traps": 10,
"filler_orb_bundles_replaced_with_traps": 10,
"chosen_traps": ["Trip Trap"]
}
def test_trap_count(self):
count = len([item.name for item in self.multiworld.itempool
if item.name == "Trip Trap"
and item.classification == ItemClassification.trap])
self.assertEqual(10, count)
def test_prog_power_cells_count(self):
count = len([item.name for item in self.multiworld.itempool
if item.name == "Power Cell"
and item.classification == ItemClassification.progression_skip_balancing])
self.assertEqual(72, count)
def test_fill_power_cells_count(self):
count = len([item.name for item in self.multiworld.itempool
if item.name == "Power Cell"
and item.classification == ItemClassification.filler])
self.assertEqual(19, count)
class MaximumTrapsTest(JakAndDaxterTestBase):
options = {
"filler_power_cells_replaced_with_traps": 100,
"filler_orb_bundles_replaced_with_traps": 100,
"chosen_traps": ["Trip Trap"]
}
def test_trap_count(self):
count = len([item.name for item in self.multiworld.itempool
if item.name == "Trip Trap"
and item.classification == ItemClassification.trap])
self.assertEqual(29, count)
def test_prog_power_cells_count(self):
count = len([item.name for item in self.multiworld.itempool
if item.name == "Power Cell"
and item.classification == ItemClassification.progression_skip_balancing])
self.assertEqual(72, count)
def test_fill_power_cells_count(self):
count = len([item.name for item in self.multiworld.itempool
if item.name == "Power Cell"
and item.classification == ItemClassification.filler])
self.assertEqual(0, count)