-
Notifications
You must be signed in to change notification settings - Fork 703
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stardew Valley: Fix a bug where walnutsanity would get deactivated ev…
…en tho ginger island got forced activated (and move some files) (#4311)
- Loading branch information
Showing
25 changed files
with
752 additions
and
660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .options import StardewValleyOption, Goal, FarmType, StartingMoney, ProfitMargin, BundleRandomization, BundlePrice, EntranceRandomization, \ | ||
SeasonRandomization, Cropsanity, BackpackProgression, ToolProgression, ElevatorProgression, SkillProgression, BuildingProgression, FestivalLocations, \ | ||
ArcadeMachineLocations, SpecialOrderLocations, QuestLocations, Fishsanity, Museumsanity, Monstersanity, Shipsanity, Cooksanity, Chefsanity, Craftsanity, \ | ||
Friendsanity, FriendsanityHeartSize, Booksanity, Walnutsanity, NumberOfMovementBuffs, EnabledFillerBuffs, ExcludeGingerIsland, TrapItems, \ | ||
MultipleDaySleepEnabled, MultipleDaySleepCost, ExperienceMultiplier, FriendshipMultiplier, DebrisMultiplier, QuickStart, Gifting, Mods, BundlePlando, \ | ||
StardewValleyOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import logging | ||
|
||
import Options as ap_options | ||
from . import options | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def force_change_options_if_incompatible(world_options: options.StardewValleyOptions, player: int, player_name: str) -> None: | ||
force_ginger_island_inclusion_when_goal_is_ginger_island_related(world_options, player, player_name) | ||
force_walnutsanity_deactivation_when_ginger_island_is_excluded(world_options, player, player_name) | ||
force_accessibility_to_full_when_goal_requires_all_locations(player, player_name, world_options) | ||
|
||
|
||
def force_ginger_island_inclusion_when_goal_is_ginger_island_related(world_options: options.StardewValleyOptions, player: int, player_name: str) -> None: | ||
goal_is_walnut_hunter = world_options.goal == options.Goal.option_greatest_walnut_hunter | ||
goal_is_perfection = world_options.goal == options.Goal.option_perfection | ||
goal_is_island_related = goal_is_walnut_hunter or goal_is_perfection | ||
ginger_island_is_excluded = world_options.exclude_ginger_island == options.ExcludeGingerIsland.option_true | ||
|
||
if goal_is_island_related and ginger_island_is_excluded: | ||
world_options.exclude_ginger_island.value = options.ExcludeGingerIsland.option_false | ||
goal_name = world_options.goal.current_option_name | ||
logger.warning(f"Goal '{goal_name}' requires Ginger Island. " | ||
f"Exclude Ginger Island option forced to 'False' for player {player} ({player_name})") | ||
|
||
|
||
def force_walnutsanity_deactivation_when_ginger_island_is_excluded(world_options: options.StardewValleyOptions, player: int, player_name: str): | ||
ginger_island_is_excluded = world_options.exclude_ginger_island == options.ExcludeGingerIsland.option_true | ||
walnutsanity_is_active = world_options.walnutsanity != options.Walnutsanity.preset_none | ||
|
||
if ginger_island_is_excluded and walnutsanity_is_active: | ||
world_options.walnutsanity.value = options.Walnutsanity.preset_none | ||
logger.warning(f"Walnutsanity requires Ginger Island. " | ||
f"Ginger Island was excluded from {player} ({player_name})'s world, so walnutsanity was force disabled") | ||
|
||
|
||
def force_accessibility_to_full_when_goal_requires_all_locations(player, player_name, world_options): | ||
goal_is_allsanity = world_options.goal == options.Goal.option_allsanity | ||
goal_is_perfection = world_options.goal == options.Goal.option_perfection | ||
goal_requires_all_locations = goal_is_allsanity or goal_is_perfection | ||
accessibility_is_minimal = world_options.accessibility == ap_options.Accessibility.option_minimal | ||
|
||
if goal_requires_all_locations and accessibility_is_minimal: | ||
world_options.accessibility.value = ap_options.Accessibility.option_full | ||
goal_name = world_options.goal.current_option_name | ||
logger.warning(f"Goal '{goal_name}' requires full accessibility. " | ||
f"Accessibility option forced to 'Full' for player {player} ({player_name})") |
Oops, something went wrong.