Skip to content

Commit a04b7d1

Browse files
committed
add ability to exclude the "always quests"
1 parent c2ea81c commit a04b7d1

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

worlds/crosscode/codegen/lists.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ def __add_location(self, name: str, raw_loc: dict[str, typing.Any], category: Lo
193193
item_rewards = rewards.get("items", [])
194194
num_rewards = max(1, len(item_rewards))
195195

196+
properties = raw_loc.get("properties", {})
197+
196198
found = False
197199

198200
if name in self.reward_amounts:
@@ -244,6 +246,9 @@ def __add_location(self, name: str, raw_loc: dict[str, typing.Any], category: Lo
244246
except KeyError:
245247
print(f"Cannot add location '{name}' in area '{area}'")
246248

249+
if properties.get("alwaysQuest", False):
250+
self.location_groups["Always Quests"].append(loc)
251+
247252
if locked:
248253
self.locked_locations.append(locid)
249254

worlds/crosscode/locations.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,6 +2929,13 @@
29292929
locations_dict['Talatu Introductions'],
29302930
locations_dict['Schneider Guild Pass'],
29312931
},
2932+
"Always Quests": {
2933+
locations_dict['Talatu Introductions'],
2934+
locations_dict['Bergen Mine Detector'],
2935+
locations_dict["Ba'kii Shade Statue"],
2936+
locations_dict['Chase the Hologram Frobbit'],
2937+
locations_dict['Mushroom Kingdom'],
2938+
},
29322939
"Bergen Village Cutscenes": {
29332940
locations_dict['Bergen Mine Guard'],
29342941
locations_dict['Bergen Mine Detector'],

worlds/crosscode/options.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,15 @@ class GoldChestLockWeight(Range):
384384
range_end = 100
385385
default = 10
386386

387+
class ExcludeAlwaysQuests(DefaultOnToggle):
388+
"""
389+
Certain quests are always in the location pool because they hold progression items when playing vanilla CrossCode.
390+
If selected, this option will ensure that none of those locations are populated with progression or useful items. It
391+
will also prohibit items from being placed on NPC interactions that give progression items but require working
392+
through part of a questline to get to.
393+
"""
394+
display_name = "Exclude Always Quests"
395+
387396
class ForceFillerLocal(Toggle):
388397
"""
389398
If selected, forces all filler items to be placed in your own world.
@@ -491,6 +500,8 @@ class CrossCodeOptions(PerGameCommonOptions):
491500
silver_chest_lock_weight: SilverChestLockWeight
492501
gold_chest_lock_weight: GoldChestLockWeight
493502

503+
exclude_always_quests: ExcludeAlwaysQuests
504+
494505
force_filler_local: ForceFillerLocal
495506
common_pool_weight: CommonPoolWeight
496507
rare_pool_weight: RarePoolWeight
@@ -549,6 +560,12 @@ class CrossCodeOptions(PerGameCommonOptions):
549560
GoldChestLockWeight,
550561
]
551562
),
563+
OptionGroup(
564+
name="Locations",
565+
options=[
566+
ExcludeAlwaysQuests
567+
]
568+
),
552569
OptionGroup(
553570
name="Pools",
554571
options=[

worlds/crosscode/world.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ def generate_early(self):
333333
self.options.gold_chest_lock_weight.value,
334334
]))
335335

336+
if self.options.exclude_always_quests.value:
337+
self.options.exclude_locations.value.update(self.location_name_groups["Always Quests"])
338+
336339
if self.options.force_filler_local.value:
337340
for name in self._filler_pool_names:
338341
self.options.local_items.value.update(self.item_name_groups[name])

0 commit comments

Comments
 (0)