mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-07-17 09:10:39 -07:00
f110a7efbc
* Update GauntletLegendsClient.py * Continuation of obelisk update * APPP Implementation Groundwork. * Continuation of APPP Implementation * Create Pain.asm * ROM verification modified since crc32 hash can no longer be calculated. * Initial upload of barrel/chest locations. * Finished adding and naming all chests/barrels. * Continued locations. * Added new yaml options * Work on mirror shards * Python 3.8 compatibility * Finalized location names. Fixed lambda bug. * v1.0 * Removed excess Docs and Changed item counts. * Update Archipelago Unittests.run.xml * Started working on Docs. * Updated item arrays for client * Fix client bugs * Flake8 fixes + Yaml fix * Update speed boots * v1.1 * Update GauntletLegendsClient.py * Update GauntletLegendsClient.py * Update GauntletLegendsClient.py * Update GauntletLegendsClient.py * v1.0.4 * Initial Ruff format * Formatting part-2 * More formatting + Doc changes * Updated Docs * Move client to root * Update Client Name * Make Imports Relative * Add new yaml options + rename obelisks * v1.1 Initial Upload * v1.1.0 + some additions * Client Update * Client Updates * pre-v1.1.1 * Update GauntletLegendsClient.py * pre-1.2 * 1.2.0 * v1.2.1 * Client fixes * v1.3.0 * v1.4.0 * v1.4.1 * Merged Changes * Experimental * pre-v1.5.0 * Changes * v1.5.0 * Update GauntletLegendsClient.py * Death Update * pre v1.5.1 * Obelisk rule changes * pre-v1.5.1 * Update GauntletLegendsClient.py * v1.5.1 * v1.5.1 * Update GauntletLegendsClient.py * Small fix * Update GauntletLegendsClient.py * v1.5.2 * pre-v1.6.0 * pre-v1.6.0 * v1.6.0 * Update * Update GauntletLegendsClient.py * Test * pre-v1.6.0 * Client Updtaes * Update GauntletLegendsClient.py * Update GauntletLegendsClient.py * Update GauntletLegendsClient.py * Update Rom.py * Update GauntletLegendsClient.py * Update Rom.py * Added Logging on stage enter * v1.6.2 * v1.6.2 * Update Rom.py * Update GauntletLegendsClient.py * v1.6.3 * Small Update * Update GauntletLegendsClient.py * Update GauntletLegendsClient.py * Update GauntletLegendsClient.py * Changes ready for review * Update Rom.py * Remove root client * Update inno_setup.iss * Update client * Initial Review Refactor * Update Arrays.py * Review refactor * Update __init__.py * Small tweaks after test generations * Update GauntletLegendsClient.py * Implement new check_locations() function * Add name for Skorn to level_names Dict * Fix for #4671 * Update __init__.py * Adjust item frequency + Place 50% of filler as local * Oops I modified the itempool after create_items teehee * Update __init__.py * Check MD5 hash before patching ROM * Update __init__.py * Fix get_filler_item_name() * Update MD5 check to built in method in FilePath * Update Rom.py * Update worlds/gl/Rom.py Co-authored-by: qwint <qwint.42@gmail.com> * WIP Generation fixes * v1.7.1 * Update Archipelago Unittests.run.xml * 0.7.2 * Update GauntletLegendsClient.py * Review Edits * Update World description * Fuzz fixes * Update GauntletLegendsClient.py * Make static data immutable * Update option comparisons since no longer a Choice * Update worlds/gl/Rom.py Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com> * Update __init__.py * Initial Update commit * Progress * Remove un-used import + Add manifest * Add missing docstring for client command * Progress * pre-v2.0.0-BETA * Updates * Progress * Working Generations * Working IN-Game * v2.0.0-BETA * Create archipelago.json * v2.0.1 * v2.0.1 FINAL * pre v2.0.2 * Delete report.json * Cleanup * pre v2.0.2 * v2.0.2 * PR Ready * Update Items.py * Delete fuzz.py * Update Items.py * Update GauntletLegendsClient.py * Fix scouting disabled locations * Client Updates * v2.0.3 * Increment World Version * Docstring + slot_data updates * Option name update + Remove redundant option * Code Cleanup * Trenches is level 24 * Frequencies * More cleanup and removal of stale code. MISSING BASEPATCH * v2.1.0 * Minor enemy changes * Small fix * Update Rom.py * v2.1.1 * Small fixes * Update basepatch.bsdiff4 * Update GauntletLegendsClient.py * Socket error clarity * Delete settings.local.json * Update GauntletLegendsClient.py * v2.1.2 fixes * Boss portal fix * Small client fix + Item Frequencies * Update archipelago.json * Fix for games playing with max difficulty lower than 4 not sending locations * Update archipelago.json * v2.1.5 * Fix for Chimera's lair mirror shard * Update archipelago.json * Mod Re-Base + Queue limits + Item Receiving fixes * Options cleanup and newlines for some files * Include v2.x features in docs * Make sure players has at least 1 item * v2.1.6 * Update archipelago.json * Review Edits + Client Tweaks --------- Co-authored-by: qwint <qwint.42@gmail.com> Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com> Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com> Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
63 lines
2.9 KiB
Python
63 lines
2.9 KiB
Python
import typing
|
|
|
|
from BaseClasses import CollectionRule
|
|
from worlds.generic.Rules import add_rule, forbid_item
|
|
|
|
from .Data import difficulty_lambda, level_locations, obelisks, boss_regions, excluded_levels, spawner_trap_ids, \
|
|
difficulty_lambda_no_portal
|
|
from .Items import items_by_id
|
|
from .Locations import get_locations_by_tags
|
|
from .Options import Goal
|
|
|
|
if typing.TYPE_CHECKING:
|
|
from . import GauntletLegendsWorld
|
|
|
|
|
|
def set_rules(world: "GauntletLegendsWorld"):
|
|
for location in get_locations_by_tags("no_obelisks") + (get_locations_by_tags("obelisk") if world.options.obelisks else []):
|
|
for item in obelisks:
|
|
if location.name not in world.disabled_locations:
|
|
forbid_item(world.get_location(location.name), item, world.player)
|
|
|
|
for location in get_locations_by_tags("no_spawner"):
|
|
for item in spawner_trap_ids:
|
|
if location.name not in world.disabled_locations:
|
|
forbid_item(world.get_location(location.name), items_by_id[item].item_name, world.player)
|
|
|
|
if not world.options.instant_max:
|
|
for level_id, locations in level_locations.items():
|
|
for location in locations:
|
|
if location.difficulty > 1:
|
|
if location.name not in world.disabled_locations:
|
|
if location.name not in world.disabled_locations:
|
|
level_id_ = level_id >> 4
|
|
difficulty = location.difficulty - 1
|
|
if world.options.portals:
|
|
expected_count = difficulty_lambda[level_id_][difficulty] - (
|
|
len(world.excluded_regions) * 4)
|
|
else:
|
|
expected_count = difficulty_lambda_no_portal[level_id_][difficulty] - (
|
|
len(world.excluded_regions) * 4)
|
|
expected_count = max(expected_count, 0)
|
|
add_rule(
|
|
world.get_location(location.name),
|
|
lambda state, expected_count_=expected_count: state.has("progression", world.player,
|
|
expected_count)
|
|
)
|
|
|
|
|
|
def goal_conditions(world: "GauntletLegendsWorld") -> CollectionRule:
|
|
if world.options.goal == Goal.option_defeat_skorne:
|
|
return lambda state: state.can_reach("Gates of the Underworld", "Region", world.player)
|
|
|
|
eligible_boss_regions = [
|
|
boss for boss in boss_regions
|
|
if boss not in [
|
|
level for region, levels in excluded_levels.items()
|
|
if region in world.excluded_regions for level in levels
|
|
]
|
|
]
|
|
needed_boss_count = world.options.boss_goal_count.value
|
|
|
|
return lambda state: sum(state.can_reach_region(boss, world.player) for boss in eligible_boss_regions) >= needed_boss_count
|