mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Tests: datapackage and more multiworld renaming (#1454)
* Tests: add a test that created items and locations exist in the datapackage * move FF validation to `assert_generate` and remove test exclusion * test created location addresses are correct * make the assertion proper and more verbose * make item count test ~~a bit faster~~ a lot nicer * 120 blaze it * name test multiworld setup better and fix another over 120 line in FFR
This commit is contained in:
@@ -45,8 +45,14 @@ class FF1World(World):
|
||||
self.locked_items = []
|
||||
self.locked_locations = []
|
||||
|
||||
def generate_early(self):
|
||||
return
|
||||
@classmethod
|
||||
def stage_assert_generate(cls, multiworld: MultiWorld) -> None:
|
||||
# Fail generation if there are no items in the pool
|
||||
for player in multiworld.get_game_players(cls.game):
|
||||
options = get_options(multiworld, 'items', player)
|
||||
assert options,\
|
||||
f"FFR settings submitted with no key items ({multiworld.get_player_name(player)}). Please ensure you " \
|
||||
f"generated the settings using finalfantasyrandomizer.com AND enabled the AP flag"
|
||||
|
||||
def create_regions(self):
|
||||
locations = get_options(self.multiworld, 'locations', self.player)
|
||||
@@ -65,8 +71,8 @@ class FF1World(World):
|
||||
terminated_event.access_rule = goal_rule_and_shards
|
||||
if "MARK" in items.keys():
|
||||
# Fail generation for Noverworld and provide link to old FFR website
|
||||
raise Exception("FFR Noverworld seeds must be generated on an older version of FFR. Please ensure you generated the settings using "
|
||||
"4-4-0.finalfantasyrandomizer.com")
|
||||
raise Exception("FFR Noverworld seeds must be generated on an older version of FFR. Please ensure you "
|
||||
"generated the settings using 4-4-0.finalfantasyrandomizer.com")
|
||||
menu_region.locations.append(terminated_event)
|
||||
self.multiworld.regions += [menu_region]
|
||||
|
||||
@@ -85,10 +91,6 @@ class FF1World(World):
|
||||
if possible_early_items:
|
||||
progression_item = self.multiworld.random.choice(possible_early_items)
|
||||
self._place_locked_item_in_sphere0(progression_item)
|
||||
else:
|
||||
# Fail generation if there are no items in the pool
|
||||
raise Exception("FFR settings submitted with no key items. Please ensure you generated the settings using "
|
||||
"finalfantasyrandomizer.com AND enabled the AP flag")
|
||||
|
||||
items = [self.create_item(name) for name, data in items.items() for x in range(data['count']) if name not in
|
||||
self.locked_items]
|
||||
|
||||
Reference in New Issue
Block a user