Files
Archipelago/worlds/jakanddaxter/regs/PrecursorBasinRegions.py
massimilianodelliubaldini 35bf07806f Finishing Touches (#36)
* Set up connector level thresholds, completion goal choices.

* Send AP sender/recipient info to game via client.

* Slight refactors.

* Refactor option checking, add DataStorage handling of traded orbs.

* Update instructions to change order of load/connect.

* Add Option check to ensure enough Locations exist for Cell Count thresholds. Fix Final Door region.

* Need some height move to get LPC sunken chamber cell.
2024-07-23 19:32:15 -04:00

37 lines
1.7 KiB
Python

from typing import List
from BaseClasses import CollectionState, MultiWorld
from .RegionBase import JakAndDaxterRegion
from .. import JakAndDaxterOptions, EnableOrbsanity
from ..Rules import can_reach_orbs
from ..locs import CellLocations as Cells, ScoutLocations as Scouts
def build_regions(level_name: str, multiworld: MultiWorld, options: JakAndDaxterOptions, player: int) -> List[JakAndDaxterRegion]:
main_area = JakAndDaxterRegion("Main Area", player, multiworld, level_name, 200)
# Everything is accessible by making contact with the zoomer.
main_area.add_cell_locations(Cells.locPB_cellTable.keys())
main_area.add_fly_locations(Scouts.locPB_scoutTable.keys())
multiworld.regions.append(main_area)
# If Per-Level Orbsanity is enabled, build the special Orbsanity Region. This is a virtual region always
# accessible to Main Area. The Locations within are automatically checked when you collect enough orbs.
if options.enable_orbsanity == EnableOrbsanity.option_per_level:
orbs = JakAndDaxterRegion("Orbsanity", player, multiworld, level_name)
bundle_size = options.level_orbsanity_bundle_size.value
bundle_count = int(200 / bundle_size)
for bundle_index in range(bundle_count):
orbs.add_orb_locations(9,
bundle_index,
bundle_size,
access_rule=lambda state, bundle=bundle_index:
can_reach_orbs(state, player, multiworld, options, level_name)
>= (bundle_size * (bundle + 1)))
multiworld.regions.append(orbs)
main_area.connect(orbs)
return [main_area]