mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-04-14 08:53:29 -07:00
* Finally remove debug-segment text, update Python imports to relative paths. * HUGE refactor to Regions/Rules to support move rando, first hub area coded. * More refactoring. * Another refactor - may squash. * Fix some Rules, reuse some code by returning key regions from build_regions. * More regions added. A couple of TODOs. * Fixed trade logic, added LPC regions. * Added Spider, Snowy, Boggy. Fixed Misty's orbs. * Fix circular import, assert orb counts per level, fix a few naming errors. * Citadel added, missing locs and connections fixed. First move rando seed generated. * Add Move Rando to Options class. * Fixed rules for prerequisite moves. * Implement client functionality for move rando, add blurbs to game info page. * Fix wrong address for cache checks. * Fix byte alignment of offsets, refactor read_memory for better code reuse. * Refactor memory offsets and add some unit tests. * Make green eco the filler item, also define a maximum ID. Fix Boggy tether locations.
43 lines
1.9 KiB
Python
43 lines
1.9 KiB
Python
import typing
|
|
|
|
from . import JakAndDaxterTestBase
|
|
from .. import jak1_id
|
|
from ..regs.RegionBase import JakAndDaxterRegion
|
|
from ..locs import (OrbLocations as Orbs,
|
|
CellLocations as Cells,
|
|
ScoutLocations as Scouts,
|
|
SpecialLocations as Specials,
|
|
OrbCacheLocations as Caches)
|
|
|
|
|
|
class LocationsTest(JakAndDaxterTestBase):
|
|
|
|
def test_count_cells(self):
|
|
regions = [typing.cast(JakAndDaxterRegion, reg) for reg in self.multiworld.get_regions(self.player)]
|
|
for level in self.level_info:
|
|
cell_count = 0
|
|
sublevels = [reg for reg in regions if reg.level_name == level]
|
|
for sl in sublevels:
|
|
for loc in sl.locations:
|
|
if loc.address in range(jak1_id, jak1_id + Scouts.fly_offset):
|
|
cell_count += 1
|
|
self.assertEqual(self.level_info[level]["cells"] - 1, cell_count, level) # Don't count the Free 7 Cells.
|
|
|
|
def test_count_flies(self):
|
|
regions = [typing.cast(JakAndDaxterRegion, reg) for reg in self.multiworld.get_regions(self.player)]
|
|
for level in self.level_info:
|
|
fly_count = 0
|
|
sublevels = [reg for reg in regions if reg.level_name == level]
|
|
for sl in sublevels:
|
|
for loc in sl.locations:
|
|
if loc.address in range(jak1_id + Scouts.fly_offset, jak1_id + Specials.special_offset):
|
|
fly_count += 1
|
|
self.assertEqual(self.level_info[level]["flies"], fly_count, level)
|
|
|
|
def test_count_orbs(self):
|
|
regions = [typing.cast(JakAndDaxterRegion, reg) for reg in self.multiworld.get_regions(self.player)]
|
|
for level in self.level_info:
|
|
sublevels = [reg for reg in regions if reg.level_name == level]
|
|
orb_count = sum([reg.orb_count for reg in sublevels])
|
|
self.assertEqual(self.level_info[level]["orbs"], orb_count, level)
|