J&D : add per region location groups (#64)

* add per region power cells location group

* add per region scout flies location group

* add per zone orb bundle groups
(I'm not particularly happy about this code, but I figured doing it this way was the point of least friction/duplication)

* guess who forgot 9 very important characters in each line of the last commit
This commit is contained in:
Romain BERNARD
2024-11-29 19:48:15 +01:00
committed by GitHub
parent 0ae5faa862
commit c752cef9fa
2 changed files with 101 additions and 5 deletions

View File

@@ -137,10 +137,57 @@ class JakAndDaxterWorld(World):
}
location_name_groups = {
"Power Cells": set(cell_location_table.values()),
"GR Power Cells": set(Cells.locGR_cellTable.values()),
"SV Power Cells": set(Cells.locSV_cellTable.values()),
"FJ Power Cells": set(Cells.locFJ_cellTable.values()),
"SB Power Cells": set(Cells.locSB_cellTable.values()),
"MI Power Cells": set(Cells.locMI_cellTable.values()),
"FC Power Cells": set(Cells.locFC_cellTable.values()),
"RV Power Cells": set(Cells.locRV_cellTable.values()),
"PB Power Cells": set(Cells.locPB_cellTable.values()),
"LPC Power Cells": set(Cells.locLPC_cellTable.values()),
"BS Power Cells": set(Cells.locBS_cellTable.values()),
"MP Power Cells": set(Cells.locMP_cellTable.values()),
"VC Power Cells": set(Cells.locVC_cellTable.values()),
"SC Power Cells": set(Cells.locSC_cellTable.values()),
"SM Power Cells": set(Cells.locSM_cellTable.values()),
"LT Power Cells": set(Cells.locLT_cellTable.values()),
"GMC Power Cells": set(Cells.locGMC_cellTable.values()),
"Scout Flies": set(scout_location_table.values()),
"GR Scout Flies": set(Scouts.locGR_scoutTable.values()),
"SV Scout Flies": set(Scouts.locSV_scoutTable.values()),
"FJ Scout Flies": set(Scouts.locFJ_scoutTable.values()),
"SB Scout Flies": set(Scouts.locSB_scoutTable.values()),
"MI Scout Flies": set(Scouts.locMI_scoutTable.values()),
"FC Scout Flies": set(Scouts.locFC_scoutTable.values()),
"RV Scout Flies": set(Scouts.locRV_scoutTable.values()),
"PB Scout Flies": set(Scouts.locPB_scoutTable.values()),
"LPC Scout Flies": set(Scouts.locLPC_scoutTable.values()),
"BS Scout Flies": set(Scouts.locBS_scoutTable.values()),
"MP Scout Flies": set(Scouts.locMP_scoutTable.values()),
"VC Scout Flies": set(Scouts.locVC_scoutTable.values()),
"SC Scout Flies": set(Scouts.locSC_scoutTable.values()),
"SM Scout Flies": set(Scouts.locSM_scoutTable.values()),
"LT Scout Flies": set(Scouts.locLT_scoutTable.values()),
"Specials": set(special_location_table.values()),
"Orb Caches": set(cache_location_table.values()),
"Precursor Orbs": set(orb_location_table.values()),
"GR Precursor Orbs": set(Orbs.locGR_orbBundleTable.values()),
"SV Precursor Orbs": set(Orbs.locSV_orbBundleTable.values()),
"FJ Precursor Orbs": set(Orbs.locFJ_orbBundleTable.values()),
"SB Precursor Orbs": set(Orbs.locSB_orbBundleTable.values()),
"MI Precursor Orbs": set(Orbs.locMI_orbBundleTable.values()),
"FC Precursor Orbs": set(Orbs.locFC_orbBundleTable.values()),
"RV Precursor Orbs": set(Orbs.locRV_orbBundleTable.values()),
"PB Precursor Orbs": set(Orbs.locPB_orbBundleTable.values()),
"LPC Precursor Orbs": set(Orbs.locLPC_orbBundleTable.values()),
"BS Precursor Orbs": set(Orbs.locBS_orbBundleTable.values()),
"MP Precursor Orbs": set(Orbs.locMP_orbBundleTable.values()),
"VC Precursor Orbs": set(Orbs.locVC_orbBundleTable.values()),
"SC Precursor Orbs": set(Orbs.locSC_orbBundleTable.values()),
"SM Precursor Orbs": set(Orbs.locSM_orbBundleTable.values()),
"LT Precursor Orbs": set(Orbs.locLT_orbBundleTable.values()),
"GMC Precursor Orbs": set(Orbs.locGMC_orbBundleTable.values()),
"Trades": {location_table[Cells.to_ap_id(k)] for k in
{11, 12, 31, 32, 33, 96, 97, 98, 99, 13, 14, 34, 35, 100, 101}},
"'Free 7 Scout Flies' Power Cells": set(Cells.loc7SF_cellTable.values()),

View File

@@ -49,10 +49,59 @@ def create_address(level_index: int, bundle_index: int) -> int:
return result
# What follows is our method of generating all the name/ID pairs for location_name_to_id.
# Remember that not every bundle will be used in the actual seed, we just need this as a static map of strings to ints.
# What follows is our methods of generating all the name/ID pairs for location_name_to_id.
# Remember that not every bundle will be used in the actual seed, we just need a static map of strings to ints.
locGR_orbBundleTable = {create_address(level_table_with_global["Geyser Rock"]["level_index"], index): f"Geyser Rock Orb Bundle {index + 1}"
for index in range(level_table_with_global["Geyser Rock"]["orbs"])}
locSV_orbBundleTable = {create_address(level_table_with_global["Sandover Village"]["level_index"], index): f"Sandover Village Orb Bundle {index + 1}"
for index in range(level_table_with_global["Sandover Village"]["orbs"])}
locFJ_orbBundleTable = {create_address(level_table_with_global["Forbidden Jungle"]["level_index"], index): f"Forbidden Jungle Orb Bundle {index + 1}"
for index in range(level_table_with_global["Forbidden Jungle"]["orbs"])}
locSB_orbBundleTable = {create_address(level_table_with_global["Sentinel Beach"]["level_index"], index): f"Sentinel Beach Orb Bundle {index + 1}"
for index in range(level_table_with_global["Sentinel Beach"]["orbs"])}
locMI_orbBundleTable = {create_address(level_table_with_global["Misty Island"]["level_index"], index): f"Misty Island Orb Bundle {index + 1}"
for index in range(level_table_with_global["Misty Island"]["orbs"])}
locFC_orbBundleTable = {create_address(level_table_with_global["Fire Canyon"]["level_index"], index): f"Fire Canyon Orb Bundle {index + 1}"
for index in range(level_table_with_global["Fire Canyon"]["orbs"])}
locRV_orbBundleTable = {create_address(level_table_with_global["Rock Village"]["level_index"], index): f"Rock Village Orb Bundle {index + 1}"
for index in range(level_table_with_global["Rock Village"]["orbs"])}
locLPC_orbBundleTable = {create_address(level_table_with_global["Lost Precursor City"]["level_index"], index): f"Lost Precursor City Orb Bundle {index + 1}"
for index in range(level_table_with_global["Lost Precursor City"]["orbs"])}
locBS_orbBundleTable = {create_address(level_table_with_global["Boggy Swamp"]["level_index"], index): f"Boggy Swamp Orb Bundle {index + 1}"
for index in range(level_table_with_global["Boggy Swamp"]["orbs"])}
locPB_orbBundleTable = {create_address(level_table_with_global["Precursor Basin"]["level_index"], index): f"Precursor Basin Orb Bundle {index + 1}"
for index in range(level_table_with_global["Precursor Basin"]["orbs"])}
locMP_orbBundleTable = {create_address(level_table_with_global["Mountain Pass"]["level_index"], index): f"Mountain Pass Orb Bundle {index + 1}"
for index in range(level_table_with_global["Mountain Pass"]["orbs"])}
locVC_orbBundleTable = {create_address(level_table_with_global["Volcanic Crater"]["level_index"], index): f"Volcanic Crater Orb Bundle {index + 1}"
for index in range(level_table_with_global["Volcanic Crater"]["orbs"])}
locSM_orbBundleTable = {create_address(level_table_with_global["Snowy Mountain"]["level_index"], index): f"Snowy Mountain Orb Bundle {index + 1}"
for index in range(level_table_with_global["Snowy Mountain"]["orbs"])}
locSC_orbBundleTable = {create_address(level_table_with_global["Spider Cave"]["level_index"], index): f"Spider Cave Orb Bundle {index + 1}"
for index in range(level_table_with_global["Spider Cave"]["orbs"])}
locLT_orbBundleTable = {create_address(level_table_with_global["Lava Tube"]["level_index"], index): f"Lava Tube Orb Bundle {index + 1}"
for index in range(level_table_with_global["Lava Tube"]["orbs"])}
locGMC_orbBundleTable = {create_address(level_table_with_global["Gol and Maia's Citadel"]["level_index"], index): f"Gol and Maia's Citadel Orb Bundle {index + 1}"
for index in range(level_table_with_global["Gol and Maia's Citadel"]["orbs"])}
locGlobal_orbBundleTable = {create_address(level_table_with_global[""]["level_index"], index): f"Orb Bundle {index + 1}"
for index in range(level_table_with_global[""]["orbs"])}
loc_orbBundleTable = {
create_address(level_table_with_global[name]["level_index"], index): f"{name} Orb Bundle {index + 1}".strip()
for name in level_table_with_global
for index in range(level_table_with_global[name]["orbs"])
**locGR_orbBundleTable,
**locSV_orbBundleTable,
**locSB_orbBundleTable,
**locFJ_orbBundleTable,
**locMI_orbBundleTable,
**locFC_orbBundleTable,
**locRV_orbBundleTable,
**locLPC_orbBundleTable,
**locBS_orbBundleTable,
**locPB_orbBundleTable,
**locMP_orbBundleTable,
**locVC_orbBundleTable,
**locSM_orbBundleTable,
**locSC_orbBundleTable,
**locLT_orbBundleTable,
**locGMC_orbBundleTable,
**locGlobal_orbBundleTable
}