Skip to content

Commit 92e1087

Browse files
2 parents 020cfcf + cc40648 commit 92e1087

File tree

4 files changed

+52
-2
lines changed

4 files changed

+52
-2
lines changed

worlds/crystal_project/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@ def get_total_progressive_levels(self, max_progressive_levels: int) -> int:
442442
progressive_levels = -(level_up_amount // -self.options.progressive_level_size.value)
443443
return progressive_levels
444444

445+
@staticmethod
446+
def get_total_passive_point_cap_items(max_passive_point_cap: int, starting_passive_point_cap: int, cap_increase: int) -> int:
447+
return round((max_passive_point_cap - starting_passive_point_cap) / cap_increase)
448+
445449
#making randomized scholar ability pool
446450
def get_optional_scholar_abilities(self, count: int):
447451
return self.random.sample(optional_scholar_abilities, count)
@@ -621,6 +625,13 @@ def get_item_pool(self, excluded_items: Set[str]) -> List[Item]:
621625
if item not in pool:
622626
pool.append(item)
623627

628+
if self.options.maximum_passive_points > self.options.starting_passive_points:
629+
passive_points_to_add_to_pool = self.get_total_passive_point_cap_items(self.options.maximum_passive_points.value, self.options.starting_passive_points.value, self.options.passive_point_cap_increase_size.value)
630+
if passive_points_to_add_to_pool > 0:
631+
for _ in range(passive_points_to_add_to_pool):
632+
item = self.set_classifications(PASSIVE_POINT_CAP)
633+
pool.append(item)
634+
624635
if self.options.use_mods:
625636
combined_locations: List[ModLocationData] = self.modded_locations
626637
combined_locations.extend(self.modded_shops)
@@ -762,4 +773,7 @@ def fill_slot_data(self) -> Dict[str, Any]:
762773
"prefillMap": bool(self.options.fill_full_map.value),
763774
"disableSparks": bool(self.options.disable_sparks.value),
764775
"homePointHustle": self.options.home_point_hustle.value,
776+
"maximumPassivePoints": self.options.maximum_passive_points.value,
777+
"startingPassivePoints": self.options.starting_passive_points.value,
778+
"passivePointCapIncreaseSize": self.options.passive_point_cap_increase_size.value,
765779
}

worlds/crystal_project/constants/key_items.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
ANCIENT_TABLET_C = "Item - Ancient Tablet C"
2323
TREASURE_FINDER = "Item - Treasure Finder"
2424
PROGRESSIVE_LEVEL = "Item - Progressive Level"
25+
PASSIVE_POINT_CAP = "Item - Passive Point Cap"
2526
SPECIAL_SHOUDU_STEW = "Item - Special Shoudu Stew"
2627
SPECIAL_MILK = "Item - Special Milk"
2728
SPECIAL_FRESH_SALMON = "Item - Special Fresh Salmon"

worlds/crystal_project/items.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ class Job(NamedTuple):
192192
TREASURE_FINDER: ItemData(ITEM, 196 + item_index_offset, ItemClassification.useful),
193193
# Progressive Level is used for all level gating options: Progressive Level Pass, Progressive Level Cap, and Progressive Level Catch-Up
194194
PROGRESSIVE_LEVEL: ItemData(ITEM, 500 + item_index_offset, ItemClassification.progression, 0),
195+
PASSIVE_POINT_CAP: ItemData(ITEM, 799 + item_index_offset, ItemClassification.useful, 0),
195196
HOMEPOINT_UNLOCK: ItemData(ITEM, 800 + item_index_offset, ItemClassification.filler, 0),
196197
SPECIAL_SHOUDU_STEW: ItemData(ITEM, 229 + item_index_offset, ItemClassification.progression, 0, 1),
197198
SPECIAL_MILK: ItemData(ITEM, 230 + item_index_offset, ItemClassification.progression, 0, 1),

worlds/crystal_project/options.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ class LevelComparedToEnemies(Range):
284284
range_end = 10
285285
default = 0
286286

287-
288287
class ProgressiveLevelSize(Range):
289288
"""
290289
If Level Gating is on, Progressive Levels will be added to the item pool. This sets the number of levels that an individual Progressive Level will grant.
@@ -305,6 +304,38 @@ class MaxLevel(Range):
305304
range_end = 99
306305
default = 60
307306

307+
class MaximumPassivePoints(Range):
308+
"""
309+
This controls the maximum number of passive points each party member will have
310+
Default is the vanilla value of 10
311+
If your starting Passive points are less than your maximum, checks will be added to the pool that increase the maximum when found.
312+
"""
313+
display_name = "Max Passive Points"
314+
range_start = 0
315+
range_end = 50
316+
default = 10
317+
318+
class StartingPassivePoints(Range):
319+
"""
320+
This controls the number of passive points each party member will have at the start of the seed
321+
Default is the vanilla value of 10
322+
If your starting Passive points are less than your maximum, checks will be added to the pool that increase the maximum when found.
323+
"""
324+
display_name = "Starting Passive Points"
325+
range_start = 0
326+
range_end = 50
327+
default = 10
328+
329+
class PassivePointCapIncreaseSize(Range):
330+
"""
331+
If your Maximum Passive Points is greate than your starting passive points
332+
this controls how many additional passive points each check will give you
333+
"""
334+
display_name = "Passive Point Cap Increase Size"
335+
range_start = 1
336+
range_end = 10
337+
default = 2
338+
308339
class KeyMode(Choice):
309340
"""
310341
Skeleton Key: Only the Skeleton Key, which can open any locked door, will be in your item pool.
@@ -505,6 +536,9 @@ class CrystalProjectOptions(PerGameCommonOptions):
505536
level_compared_to_enemies: LevelComparedToEnemies
506537
progressive_level_size: ProgressiveLevelSize
507538
max_level: MaxLevel
539+
starting_passive_points: StartingPassivePoints
540+
maximum_passive_points: MaximumPassivePoints
541+
passive_point_cap_increase_size: PassivePointCapIncreaseSize
508542
key_mode: KeyMode
509543
obscure_routes: ObscureRoutes
510544
hop_to_it: HopToIt
@@ -526,7 +560,7 @@ class CrystalProjectOptions(PerGameCommonOptions):
526560
crystal_project_option_groups: Dict[str, List[Any]] = {
527561
"Goal Options": [Goal, ClamshellGoalQuantity, ExtraClamshellsInPool, AstleyJobQuantity],
528562
"Location Options": [IncludedRegions, JobRando, StartingJobQuantity, DisableSparks, KillBossesMode, Shopsanity, Regionsanity, RegionsanityStarterRegionMinLevel, RegionsanityStarterRegionMaxLevel, HomePointHustle],
529-
"Progression Options": [ProgressiveMountMode, StartingLevel, LevelGating, LevelComparedToEnemies, ProgressiveLevelSize, MaxLevel, KeyMode, ObscureRoutes, HopToIt, PrioritizeCrystals, AutoSpendLP, AutoEquipPassives, EasyLeveling],
563+
"Progression Options": [ProgressiveMountMode, StartingLevel, LevelGating, LevelComparedToEnemies, ProgressiveLevelSize, MaxLevel, StartingPassivePoints, MaximumPassivePoints, PassivePointCapIncreaseSize, KeyMode, ObscureRoutes, HopToIt, PrioritizeCrystals, AutoSpendLP, AutoEquipPassives, EasyLeveling],
530564
"Item Pool Options": [ProgressiveEquipmentMode, StartWithTreasureFinder, StartWithMaps, FillFullMap, IncludeSummonAbilities, IncludeScholarAbilities],
531565
"Bonus Fun": [ItemInfoMode, RandomizeMusic, UseMods]
532566
}

0 commit comments

Comments
 (0)