From 530b65cd647bad1346e8d15b391278198d710bf3 Mon Sep 17 00:00:00 2001 From: CookieCat Date: Wed, 15 May 2024 20:40:05 -0400 Subject: [PATCH] make ship shape task goal equal to number of tasksanity checks if set to 0 --- worlds/ahit/Options.py | 20 +++++++++++++++----- worlds/ahit/Rules.py | 4 ++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/worlds/ahit/Options.py b/worlds/ahit/Options.py index d08fe99081..00ed716bdc 100644 --- a/worlds/ahit/Options.py +++ b/worlds/ahit/Options.py @@ -42,6 +42,13 @@ def adjust_options(world: "HatInTimeWorld"): if world.options.FinalChapterMinCost > total_tps: world.options.FinalChapterMinCost.value = min(50, total_tps) + if world.is_dlc1() and world.options.ShipShapeCustomTaskGoal <= 0: + # automatically determine task count based on Tasksanity settings + if world.options.Tasksanity: + world.options.ShipShapeCustomTaskGoal = world.options.TasksanityCheckCount * world.options.TasksanityTaskStep + else: + world.options.ShipShapeCustomTaskGoal = 18 + # Don't allow Rush Hour goal if DLC2 content is disabled if world.options.EndGoal == EndGoal.option_rush_hour and not world.options.EnableDLC2: world.options.EndGoal.value = 1 @@ -388,7 +395,7 @@ class TasksanityTaskStep(Range): class TasksanityCheckCount(Range): """How many Tasksanity checks there will be in total.""" display_name = "Tasksanity Check Count" - range_start = 5 + range_start = 1 range_end = 30 default = 18 @@ -401,11 +408,14 @@ class ExcludeTour(Toggle): class ShipShapeCustomTaskGoal(Range): - """Change the number of tasks required to complete Ship Shape. This will not affect Cruisin' for a Bruisin'.""" + """Change the number of tasks required to complete Ship Shape. If this option's value is 0, the number of tasks + required will be TasksanityTaskStep x TasksanityCheckCount, if Tasksanity is enabled. If Tasksanity is disabled, + it will use the game's default of 18. + This option will not affect Cruisin' for a Bruisin'.""" display_name = "Ship Shape Custom Task Goal" - range_start = 1 - range_end = 30 - default = 18 + range_start = 0 + range_end = 90 + default = 0 class EnableDLC2(Toggle): diff --git a/worlds/ahit/Rules.py b/worlds/ahit/Rules.py index f88fe3f950..d97e6d73b3 100644 --- a/worlds/ahit/Rules.py +++ b/worlds/ahit/Rules.py @@ -5,7 +5,7 @@ from .Locations import location_table, zipline_unlocks, is_location_valid, contr from .Types import HatType, ChapterIndex, hat_type_to_item, Difficulty, HitType from BaseClasses import Location, Entrance, Region from typing import TYPE_CHECKING, List, Callable, Union, Dict -from .Options import EndGoal, CTRLogic +from .Options import EndGoal, CTRLogic, NoTicketSkips if TYPE_CHECKING: from . import HatInTimeWorld @@ -515,7 +515,7 @@ def set_hard_rules(world: "HatInTimeWorld"): lambda state: can_use_hat(state, world, HatType.ICE)) # Hard: clear Rush Hour with Brewing Hat only - if not world.options.NoTicketSkips: + if world.options.NoTicketSkips is not NoTicketSkips.option_true: set_rule(world.multiworld.get_location("Act Completion (Rush Hour)", world.player), lambda state: can_use_hat(state, world, HatType.BREWING)) else: