Implement Vi suggestion on webhost-capable friendly limits.

This commit is contained in:
massimilianodelliubaldini
2025-05-20 01:05:25 -04:00
parent 5c4afc5b1e
commit 2d012b7f4a
3 changed files with 20 additions and 14 deletions

View File

@@ -20,6 +20,7 @@ from pymem.exception import ProcessNotFound
# Archipelago imports
import ModuleUpdate
import Utils
import settings
from CommonClient import ClientCommandProcessor, CommonContext, server_loop, gui_enabled
from NetUtils import ClientStatus
@@ -433,11 +434,12 @@ async def run_game(ctx: JakAndDaxterContext):
ctx.on_log_warn(logger, "Compiler not running, attempting to start.")
try:
auto_detect_root_directory = JakAndDaxterWorld.settings.auto_detect_root_directory
host_settings = settings.get_settings()["jakanddaxter_options"]
auto_detect_root_directory = host_settings["auto_detect_root_directory"]
if auto_detect_root_directory:
root_path = find_root_directory(ctx)
else:
root_path = JakAndDaxterWorld.settings.root_directory
root_path = host_settings["root_directory"]
# Always trust your instincts... the user may not have entered their root_directory properly.
# We don't have to do this check if the root directory was auto-detected.

View File

@@ -1,9 +1,13 @@
from dataclasses import dataclass
from functools import cached_property
from Options import PerGameCommonOptions, StartInventoryPool, Toggle, Choice, Range, DefaultOnToggle, OptionCounter
from settings import get_settings
from .Items import trap_item_table
enforce_friendly_options: bool = get_settings()["jakanddaxter_options"]["enforce_friendly_options"]
class EnableMoveRandomizer(Toggle):
"""Include movement options as items in the randomizer. Until you find his other moves, Jak is limited to
running, swimming, single-jumping, and shooting yellow eco through his goggles.
@@ -83,10 +87,10 @@ class FireCanyonCellCount(Range):
Multiplayer Maximum: 30
Singleplayer Maximum: 34"""
display_name = "Fire Canyon Cell Count"
range_start = 0
range_end = 100
multiplayer_maximum = 30
singleplayer_maximum = 34
range_start = 0
range_end = multiplayer_maximum if enforce_friendly_options else 100
default = 20
@@ -96,10 +100,10 @@ class MountainPassCellCount(Range):
Multiplayer Maximum: 60
Singleplayer Maximum: 63"""
display_name = "Mountain Pass Cell Count"
range_start = 0
range_end = 100
multiplayer_maximum = 60
singleplayer_maximum = 63
range_start = 0
range_end = multiplayer_maximum if enforce_friendly_options else 100
default = 45
@@ -109,10 +113,10 @@ class LavaTubeCellCount(Range):
Multiplayer Maximum: 90
Singleplayer Maximum: 99"""
display_name = "Lava Tube Cell Count"
range_start = 0
range_end = 100
multiplayer_maximum = 90
singleplayer_maximum = 99
range_start = 0
range_end = multiplayer_maximum if enforce_friendly_options else 100
default = 72
@@ -139,9 +143,9 @@ class CitizenOrbTradeAmount(Range):
Multiplayer Maximum: 120"""
display_name = "Citizen Orb Trade Amount"
range_start = 0
range_end = 222
multiplayer_maximum = 120
range_start = 0
range_end = multiplayer_maximum if enforce_friendly_options else 222
default = 90
@@ -154,9 +158,9 @@ class OracleOrbTradeAmount(Range):
Multiplayer Maximum: 150"""
display_name = "Oracle Orb Trade Amount"
range_start = 0
range_end = 333
multiplayer_maximum = 150
range_start = 0
range_end = multiplayer_maximum if enforce_friendly_options else 333
default = 120

View File

@@ -15,7 +15,7 @@ from BaseClasses import (Item,
from Options import OptionGroup
# Jak imports
from .Options import *
from . import Options
from .GameID import jak1_id, jak1_name, jak1_max
from .Items import (JakAndDaxterItem,
OrbAssoc,
@@ -265,7 +265,7 @@ class JakAndDaxterWorld(World):
# For the fairness of other players in a multiworld game, enforce some friendly limitations on our options,
# so we don't cause chaos during seed generation. These friendly limits should **guarantee** a successful gen.
# We would have done this earlier, but we needed to sort the power cell thresholds first.
enforce_friendly_options = self.settings.enforce_friendly_options
enforce_friendly_options = settings.get_settings()["jakanddaxter_options"]["enforce_friendly_options"]
if enforce_friendly_options:
if self.multiworld.players > 1:
enforce_multiplayer_limits(self)