Archipelago/worlds/bumpstik/Regions.py

51 lines
2.2 KiB
Python
Raw Normal View History

Add Bumper Stickers (#811) * bumpstik: initial commit * bumpstik: fix game name in location obj * bumpstik: specified offset * bumpstik: forgot to call create_regions * bumpstik: fix entrance generation * bumpstik: fix completion definition * bumpstik: treasure bumper, LttP text * bumpstik: add more score-based locations * bumpstik: adjust regions * bumpstik: fill with Treasure Bumpers * bumpstik: force Treasure Bumper on last location * bumpstik: don't require Hazard Bumpers for level 4 * bumpstik: treasure bumper locations * bumpstik: formatting * bumpstik: refactor to 0.3.5 * bumpstik: Treasure bumpers are now progression * bumpstik: complete reimplementation of locations * bumpstik: implement Nothing as item * bumpstik: level 3 and 4 locations * bumpstik: correct a goal value * bumpstik: region defs need one extra treasure * bumpstik: add more starting paint cans * bumpstik: toned down final score goal * bumpstik: changing items, Hazards no longer traps * bumpstik: remove item groups * bumpstik: update self.world to self.multiworld * bumpstik: clean up item types and classes * bumpstik: add options also add traps to item pool * bumpstik: update docs * bumpstik: oops * bumpstik: add to master game list on readme * bumpstik: renaming Task Skip to Task Advance because "Task Skip" is surprisingly hard to say * bumpstik: fill with score on item gen instead of nothing (nothing is still the default filler) * bumpstik: add 18 checks * bumpstik: bump ap ver * bumpstik: add item groups * bumpstik: make helper items and traps configurable * bumpstik: make Hazard Bumper progression * bumpstik: tone final score goal down to 50K * bumpstik: 0.4.0 region update * bumpstik: clean up docs also final goal is now 50K or your score + 5000, whichever is higher * bumpstik: take datapackage out of testing mode * bumpstik: Apply suggestions from code review code changes for .apworld support Co-authored-by: Zach Parks <zach@alliware.com> --------- Co-authored-by: Zach Parks <zach@alliware.com>
2023-06-27 20:37:17 +00:00
# Copyright (c) 2022 FelicitusNeko
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
from BaseClasses import MultiWorld, Region, Entrance
from .Locations import BumpStikLocation, level1_locs, level2_locs, level3_locs, level4_locs, level5_locs, location_table
def _generate_entrances(player: int, entrance_list: [str], parent: Region):
return [Entrance(player, entrance, parent) for entrance in entrance_list]
def create_regions(world: MultiWorld, player: int):
region_map = {
"Menu": level1_locs + ["Bonus Booster 1"] + [f"Treasure Bumper {i + 1}" for i in range(8)],
"Level 1": level2_locs + ["Bonus Booster 2"] + [f"Treasure Bumper {i + 9}" for i in range(8)],
"Level 2": level3_locs + ["Bonus Booster 3"] + [f"Treasure Bumper {i + 17}" for i in range(8)],
"Level 3": level4_locs + [f"Bonus Booster {i + 4}" for i in range(2)] +
[f"Treasure Bumper {i + 25}" for i in range(8)],
"Level 4": level5_locs
}
entrance_map = {
"Level 1": lambda state:
state.has("Booster Bumper", player, 1) and state.has("Treasure Bumper", player, 8),
Add Bumper Stickers (#811) * bumpstik: initial commit * bumpstik: fix game name in location obj * bumpstik: specified offset * bumpstik: forgot to call create_regions * bumpstik: fix entrance generation * bumpstik: fix completion definition * bumpstik: treasure bumper, LttP text * bumpstik: add more score-based locations * bumpstik: adjust regions * bumpstik: fill with Treasure Bumpers * bumpstik: force Treasure Bumper on last location * bumpstik: don't require Hazard Bumpers for level 4 * bumpstik: treasure bumper locations * bumpstik: formatting * bumpstik: refactor to 0.3.5 * bumpstik: Treasure bumpers are now progression * bumpstik: complete reimplementation of locations * bumpstik: implement Nothing as item * bumpstik: level 3 and 4 locations * bumpstik: correct a goal value * bumpstik: region defs need one extra treasure * bumpstik: add more starting paint cans * bumpstik: toned down final score goal * bumpstik: changing items, Hazards no longer traps * bumpstik: remove item groups * bumpstik: update self.world to self.multiworld * bumpstik: clean up item types and classes * bumpstik: add options also add traps to item pool * bumpstik: update docs * bumpstik: oops * bumpstik: add to master game list on readme * bumpstik: renaming Task Skip to Task Advance because "Task Skip" is surprisingly hard to say * bumpstik: fill with score on item gen instead of nothing (nothing is still the default filler) * bumpstik: add 18 checks * bumpstik: bump ap ver * bumpstik: add item groups * bumpstik: make helper items and traps configurable * bumpstik: make Hazard Bumper progression * bumpstik: tone final score goal down to 50K * bumpstik: 0.4.0 region update * bumpstik: clean up docs also final goal is now 50K or your score + 5000, whichever is higher * bumpstik: take datapackage out of testing mode * bumpstik: Apply suggestions from code review code changes for .apworld support Co-authored-by: Zach Parks <zach@alliware.com> --------- Co-authored-by: Zach Parks <zach@alliware.com>
2023-06-27 20:37:17 +00:00
"Level 2": lambda state:
state.has("Booster Bumper", player, 2) and state.has("Treasure Bumper", player, 16),
Add Bumper Stickers (#811) * bumpstik: initial commit * bumpstik: fix game name in location obj * bumpstik: specified offset * bumpstik: forgot to call create_regions * bumpstik: fix entrance generation * bumpstik: fix completion definition * bumpstik: treasure bumper, LttP text * bumpstik: add more score-based locations * bumpstik: adjust regions * bumpstik: fill with Treasure Bumpers * bumpstik: force Treasure Bumper on last location * bumpstik: don't require Hazard Bumpers for level 4 * bumpstik: treasure bumper locations * bumpstik: formatting * bumpstik: refactor to 0.3.5 * bumpstik: Treasure bumpers are now progression * bumpstik: complete reimplementation of locations * bumpstik: implement Nothing as item * bumpstik: level 3 and 4 locations * bumpstik: correct a goal value * bumpstik: region defs need one extra treasure * bumpstik: add more starting paint cans * bumpstik: toned down final score goal * bumpstik: changing items, Hazards no longer traps * bumpstik: remove item groups * bumpstik: update self.world to self.multiworld * bumpstik: clean up item types and classes * bumpstik: add options also add traps to item pool * bumpstik: update docs * bumpstik: oops * bumpstik: add to master game list on readme * bumpstik: renaming Task Skip to Task Advance because "Task Skip" is surprisingly hard to say * bumpstik: fill with score on item gen instead of nothing (nothing is still the default filler) * bumpstik: add 18 checks * bumpstik: bump ap ver * bumpstik: add item groups * bumpstik: make helper items and traps configurable * bumpstik: make Hazard Bumper progression * bumpstik: tone final score goal down to 50K * bumpstik: 0.4.0 region update * bumpstik: clean up docs also final goal is now 50K or your score + 5000, whichever is higher * bumpstik: take datapackage out of testing mode * bumpstik: Apply suggestions from code review code changes for .apworld support Co-authored-by: Zach Parks <zach@alliware.com> --------- Co-authored-by: Zach Parks <zach@alliware.com>
2023-06-27 20:37:17 +00:00
"Level 3": lambda state:
state.has("Booster Bumper", player, 3) and state.has("Treasure Bumper", player, 24),
Add Bumper Stickers (#811) * bumpstik: initial commit * bumpstik: fix game name in location obj * bumpstik: specified offset * bumpstik: forgot to call create_regions * bumpstik: fix entrance generation * bumpstik: fix completion definition * bumpstik: treasure bumper, LttP text * bumpstik: add more score-based locations * bumpstik: adjust regions * bumpstik: fill with Treasure Bumpers * bumpstik: force Treasure Bumper on last location * bumpstik: don't require Hazard Bumpers for level 4 * bumpstik: treasure bumper locations * bumpstik: formatting * bumpstik: refactor to 0.3.5 * bumpstik: Treasure bumpers are now progression * bumpstik: complete reimplementation of locations * bumpstik: implement Nothing as item * bumpstik: level 3 and 4 locations * bumpstik: correct a goal value * bumpstik: region defs need one extra treasure * bumpstik: add more starting paint cans * bumpstik: toned down final score goal * bumpstik: changing items, Hazards no longer traps * bumpstik: remove item groups * bumpstik: update self.world to self.multiworld * bumpstik: clean up item types and classes * bumpstik: add options also add traps to item pool * bumpstik: update docs * bumpstik: oops * bumpstik: add to master game list on readme * bumpstik: renaming Task Skip to Task Advance because "Task Skip" is surprisingly hard to say * bumpstik: fill with score on item gen instead of nothing (nothing is still the default filler) * bumpstik: add 18 checks * bumpstik: bump ap ver * bumpstik: add item groups * bumpstik: make helper items and traps configurable * bumpstik: make Hazard Bumper progression * bumpstik: tone final score goal down to 50K * bumpstik: 0.4.0 region update * bumpstik: clean up docs also final goal is now 50K or your score + 5000, whichever is higher * bumpstik: take datapackage out of testing mode * bumpstik: Apply suggestions from code review code changes for .apworld support Co-authored-by: Zach Parks <zach@alliware.com> --------- Co-authored-by: Zach Parks <zach@alliware.com>
2023-06-27 20:37:17 +00:00
"Level 4": lambda state:
state.has("Booster Bumper", player, 5) and state.has("Treasure Bumper", player, 32)
Add Bumper Stickers (#811) * bumpstik: initial commit * bumpstik: fix game name in location obj * bumpstik: specified offset * bumpstik: forgot to call create_regions * bumpstik: fix entrance generation * bumpstik: fix completion definition * bumpstik: treasure bumper, LttP text * bumpstik: add more score-based locations * bumpstik: adjust regions * bumpstik: fill with Treasure Bumpers * bumpstik: force Treasure Bumper on last location * bumpstik: don't require Hazard Bumpers for level 4 * bumpstik: treasure bumper locations * bumpstik: formatting * bumpstik: refactor to 0.3.5 * bumpstik: Treasure bumpers are now progression * bumpstik: complete reimplementation of locations * bumpstik: implement Nothing as item * bumpstik: level 3 and 4 locations * bumpstik: correct a goal value * bumpstik: region defs need one extra treasure * bumpstik: add more starting paint cans * bumpstik: toned down final score goal * bumpstik: changing items, Hazards no longer traps * bumpstik: remove item groups * bumpstik: update self.world to self.multiworld * bumpstik: clean up item types and classes * bumpstik: add options also add traps to item pool * bumpstik: update docs * bumpstik: oops * bumpstik: add to master game list on readme * bumpstik: renaming Task Skip to Task Advance because "Task Skip" is surprisingly hard to say * bumpstik: fill with score on item gen instead of nothing (nothing is still the default filler) * bumpstik: add 18 checks * bumpstik: bump ap ver * bumpstik: add item groups * bumpstik: make helper items and traps configurable * bumpstik: make Hazard Bumper progression * bumpstik: tone final score goal down to 50K * bumpstik: 0.4.0 region update * bumpstik: clean up docs also final goal is now 50K or your score + 5000, whichever is higher * bumpstik: take datapackage out of testing mode * bumpstik: Apply suggestions from code review code changes for .apworld support Co-authored-by: Zach Parks <zach@alliware.com> --------- Co-authored-by: Zach Parks <zach@alliware.com>
2023-06-27 20:37:17 +00:00
}
for x, region_name in enumerate(region_map):
region_list = region_map[region_name]
region = Region(region_name, player, world)
for location_name in region_list:
region.locations += [BumpStikLocation(
player, location_name, location_table[location_name], region)]
if x < 4:
region.exits += _generate_entrances(player,
[f"To Level {x + 1}"], region)
world.regions += [region]
for entrance in entrance_map:
connection = world.get_entrance(f"To {entrance}", player)
connection.access_rule = entrance_map[entrance]
connection.connect(world.get_region(entrance, player))