Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions worlds/jakanddaxter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
special_item_table,
move_item_table,
orb_item_table,
trap_item_table)
trap_item_table, eco_item_table)
from .levels import level_table, level_table_with_global
from .locations import (JakAndDaxterLocation,
location_table,
Expand Down Expand Up @@ -116,6 +116,12 @@ class JakAndDaxterWebWorld(WebWorld):
options.CitizenOrbTradeAmount,
options.OracleOrbTradeAmount,
]),
OptionGroup("Eco Randomizer", [
options.EnableEcoRandomizer,
options.GeyserRockDoorSkip,
options.KlawwFightSkip,
options.LavaTubeOrangesSkip,
], True),
OptionGroup("Tricks & Glitches - Easy", [
options.AttackWithRollJump, # Use Roll Jump instead of regular attacks to hit certain targets.
options.AttacklessLurkerCannons, # Shoot the lurkers with their own cannon.
Expand Down Expand Up @@ -192,6 +198,7 @@ class JakAndDaxterWorld(World):
"Scout Flies": set(scout_item_table.values()),
"Specials": set(special_item_table.values()),
"Moves": set(move_item_table.values()),
"Eco": set(eco_item_table.values()),
"Precursor Orbs": set(orb_item_table.values()),
"Traps": set(trap_item_table.values()),
}
Expand Down Expand Up @@ -447,10 +454,10 @@ def create_items(self) -> None:
for item_name in self.item_name_to_id:
item_id = self.item_name_to_id[item_name]

# Handle Move Randomizer option.
# Handle Move/Eco Randomizer option.
# If it is OFF, put all moves in your starting inventory instead of the item pool,
# then fill the item pool with a corresponding amount of filler items.
if item_name in self.item_name_groups["Moves"] and not self.options.enable_move_randomizer:
if (item_name in self.item_name_groups["Moves"] and not self.options.enable_move_randomizer) or (item_name in self.item_name_groups["Eco"] and not self.options.enable_eco_randomizer):
self.multiworld.push_precollected(self.create_item(item_name))
self.multiworld.itempool.append(self.create_filler())
items_made += 1
Expand Down Expand Up @@ -561,6 +568,10 @@ def fill_slot_data(self) -> dict[str, Any]:
"trap_weights",
"jak_completion_condition",
"require_punch_for_klaww",
# Eco Randomizer
"enable_eco_randomizer",
"geyser_rock_door_skip",
"klaww_fight_skip",
# Tricks & Glitches
"boosted_and_extended_uppercuts",
"punch_uppercut_scout_flies",
Expand Down
3 changes: 3 additions & 0 deletions worlds/jakanddaxter/agents/memory_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def define(self, size: int, length: int = 1) -> int:
# Trap information.
trap_duration_offset = offsets.define(sizeof_float)

# Eco randomizer information.
ecorando_enabled_offset = offsets.define(sizeof_uint8)

# The End.
end_marker_offset = offsets.define(sizeof_uint8, 4)

Expand Down
12 changes: 9 additions & 3 deletions worlds/jakanddaxter/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,14 @@ def __init__(self, name: str,
23348: "Punch",
23349: "Punch Uppercut",
23350: "Kick",
# 24038: "Orb Cache at End of Blast Furnace", # Hold onto these ID's for future use.
# 24039: "Orb Cache at End of Launch Pad Room",
# 24040: "Orb Cache at Start of Launch Pad Room",
}

# Same as above, but contains the eco items for eco randomizer. These are treated like moves in GOAL,
# but defined separately to correctly pre-collect them depending on the player options.
eco_item_table = {
24038: "Blue Eco",
24039: "Red Eco",
24040: "Yellow Eco",
}

# These are trap items. Their Item ID is to be subtracted from the base game ID. They do not have corresponding
Expand Down Expand Up @@ -150,6 +155,7 @@ def __init__(self, name: str,
**{scouts.to_ap_id(k): name for k, name in scout_item_table.items()},
**{specials.to_ap_id(k): name for k, name in special_item_table.items()},
**{caches.to_ap_id(k): name for k, name in move_item_table.items()},
**{caches.to_ap_id(k): name for k, name in eco_item_table.items()},
**{orbs.to_ap_id(k): name for k, name in orb_item_table.items()},
**{jak1_max - k: name for k, name in trap_item_table.items()},
jak1_max: "Green Eco Pill" # Filler item.
Expand Down
47 changes: 47 additions & 0 deletions worlds/jakanddaxter/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,47 @@ class TrapWeights(OptionCounter):
def weights_pair(self) -> tuple[list[str], list[int]]:
return list(self.value.keys()), list(self.value.values())

# region Eco Randomizer
class EnableEcoRandomizer(Toggle):
"""Include eco collection as items in the randomizer. Until you find other eco colors, Jak can only collect green
eco.

This adds 3 items to the pool."""
display_name = "Enable Eco Randomizer"


class GeyserRockDoorSkip(Toggle):
"""
Create an alternative path through the precursor door in geyser rock.

Enabling this setting may require Jak to reach the area behind the door with no *Blue Eco* unlocked.

If "Enable Move Randomizer" is ON, Jak may be required to do the trick with *Jump Kick* and either *Crouch Jump*
or *Jump Dive* + *Double Jump*.
"""
display_name = "Geyser Rock Door Skip"


class KlawwFightSkip(Toggle):
"""
Create an alternative path to Mountain Pass without having to fight Klaww.

Enabling this setting may require Jak to reach Mountain Pass by skipping the Klaww fight, without *Blue Eco* or
*Yellow Eco* unlocked.
"""
display_name = "Klaww Fight Skip"

class LavaTubeOrangesSkip(Toggle):
"""
Create an alternative path through Lava Tube.

Enabling this setting may require Jak to skip the door in the room with the "oranges" in lava tube, without using
*Yellow Eco*.
"""
display_name = "Lava Tube Oranges Skip"
# endregion

# region Advanced Movement

class BoostedAndExtendedUppercuts(Toggle):
"""
Expand Down Expand Up @@ -663,6 +704,8 @@ class SentinelBeachBlueEcoSwitchSkip(Toggle):
"""
display_name = "Sentinel Beach Blue Eco Switch Skip"

# endregion

class CompletionCondition(Choice):
"""Set the goal for completing the game."""
display_name = "Completion Condition"
Expand Down Expand Up @@ -693,6 +736,10 @@ class JakAndDaxterOptions(PerGameCommonOptions):
filler_orb_bundles_replaced_with_traps: FillerOrbBundlesReplacedWithTraps
trap_effect_duration: TrapEffectDuration
trap_weights: TrapWeights
enable_eco_randomizer: EnableEcoRandomizer
geyser_rock_door_skip: GeyserRockDoorSkip
klaww_fight_skip: KlawwFightSkip
lava_tube_oranges_skip: LavaTubeOrangesSkip
boosted_and_extended_uppercuts: BoostedAndExtendedUppercuts
punch_uppercut_scout_flies: PunchUppercutScoutFlies
geyser_rock_cliff_climb: GeyserRockCliffClimb
Expand Down
5 changes: 3 additions & 2 deletions worlds/jakanddaxter/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def create_regions(world: "JakAndDaxterWorld"):
sc = spider_cave.build_regions("Spider Cave", world)
sm = snowy_mountain.build_regions("Snowy Mountain", world)

lt = lava_tube.build_regions("Lava Tube", world)
lt, lt_end = lava_tube.build_regions("Lava Tube", world)
gmc, fb, fd = gol_and_maias_citadel.build_regions("Gol and Maia's Citadel", world)

# Configurable counts of cells for connector levels.
Expand Down Expand Up @@ -108,7 +108,8 @@ def create_regions(world: "JakAndDaxterWorld"):
vc.connect(sc)
vc.connect(sm, rule=lambda state: state.has("Snowy Mountain Gondola", player))
vc.connect(lt, rule=lambda state: state.has("Power Cell", player, lt_count)) # Normally 72.
lt.connect(gmc) # gmc->fb connection defined internally by GolAndMaiasCitadelRegions.
# lt -> lt_end connection defined internally by LavaTubeRegions.
lt_end.connect(gmc) # gmc->fb connection defined internally by GolAndMaiasCitadelRegions.

# Set the completion condition.
if options.jak_completion_condition == CompletionCondition.option_cross_fire_canyon:
Expand Down
Loading
Loading