Files
Grinch-AP/worlds/stardew_valley/mods/logic/magic_logic.py
agilbert1412 52e65e208e Stardew Valley: 5.x.x - The Allsanity Update (#2764)
Major Content update for Stardew Valley, including the following features

- Major performance improvements all across the Stardew Valley apworld, including a significant reduction in the test time
- Randomized Farm Type
- Bundles rework (Remixed Bundles and Missing Bundle!)
- New Settings:
  * Shipsanity - Shipping individual items
  * Monstersanity - Slaying monsters
  * Cooksanity - Cooking individual recipes
  * Chefsanity - Learning individual recipes
  * Craftsanity - Crafting individual items
- New Goals:
  * Protector of the Valley - Complete every monster slayer goal
  * Full Shipment - Ship every item
  * Craftmaster - Craft every item
  * Gourmet Chef - Cook every recipe
  * Legend - Earn 10 000 000g
  * Mystery of the Stardrops - Find every stardrop (Maguffin Hunt)
  * Allsanity - Complete every check in your slot
- Building Shuffle: Cheaper options
- Tool Shuffle: Cheaper options
- Money rework
- New traps
- New isolated checks and items, including the farm cave, the movie theater, etc
- Mod Support: SVE [Albrekka]
- Mod Support: Distant Lands [Albrekka]
- Mod Support: Hat Mouse Lacey [Albrekka]
- Mod Support: Boarding House [Albrekka]

Co-authored-by: Witchybun <elnendil@gmail.com>
Co-authored-by: Witchybun <96719127+Witchybun@users.noreply.github.com>
Co-authored-by: Jouramie <jouramie@hotmail.com>
Co-authored-by: Alchav <59858495+Alchav@users.noreply.github.com>
2024-03-15 13:05:14 +01:00

83 lines
4.1 KiB
Python

from typing import Union
from ...logic.base_logic import BaseLogicMixin, BaseLogic
from ...logic.has_logic import HasLogicMixin
from ...logic.received_logic import ReceivedLogicMixin
from ...logic.region_logic import RegionLogicMixin
from ...mods.mod_data import ModNames
from ...stardew_rule import StardewRule, False_
from ...strings.ap_names.skill_level_names import ModSkillLevel
from ...strings.region_names import MagicRegion
from ...strings.spells import MagicSpell
class MagicLogicMixin(BaseLogicMixin):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.magic = MagicLogic(*args, **kwargs)
# TODO add logic.mods.magic for altar
class MagicLogic(BaseLogic[Union[RegionLogicMixin, ReceivedLogicMixin, HasLogicMixin]]):
def can_use_clear_debris_instead_of_tool_level(self, level: int) -> StardewRule:
if ModNames.magic not in self.options.mods:
return False_()
return self.logic.received(MagicSpell.clear_debris) & self.can_use_altar() & self.logic.received(ModSkillLevel.magic_level, level)
def can_use_altar(self) -> StardewRule:
if ModNames.magic not in self.options.mods:
return False_()
return self.logic.region.can_reach(MagicRegion.altar)
def has_any_spell(self) -> StardewRule:
if ModNames.magic not in self.options.mods:
return False_()
return self.can_use_altar()
def has_attack_spell_count(self, count: int) -> StardewRule:
attack_spell_rule = [self.logic.received(MagicSpell.fireball), self.logic.received(MagicSpell.frostbite), self.logic.received(MagicSpell.shockwave),
self.logic.received(MagicSpell.spirit), self.logic.received(MagicSpell.meteor)]
return self.logic.count(count, *attack_spell_rule)
def has_support_spell_count(self, count: int) -> StardewRule:
support_spell_rule = [self.can_use_altar(), self.logic.received(ModSkillLevel.magic_level, 2),
self.logic.received(MagicSpell.descend), self.logic.received(MagicSpell.heal),
self.logic.received(MagicSpell.tendrils)]
return self.logic.count(count, *support_spell_rule)
def has_decent_spells(self) -> StardewRule:
if ModNames.magic not in self.options.mods:
return False_()
magic_resource_rule = self.can_use_altar() & self.logic.received(ModSkillLevel.magic_level, 2)
magic_attack_options_rule = self.has_attack_spell_count(1)
return magic_resource_rule & magic_attack_options_rule
def has_good_spells(self) -> StardewRule:
if ModNames.magic not in self.options.mods:
return False_()
magic_resource_rule = self.can_use_altar() & self.logic.received(ModSkillLevel.magic_level, 4)
magic_attack_options_rule = self.has_attack_spell_count(2)
magic_support_options_rule = self.has_support_spell_count(1)
return magic_resource_rule & magic_attack_options_rule & magic_support_options_rule
def has_great_spells(self) -> StardewRule:
if ModNames.magic not in self.options.mods:
return False_()
magic_resource_rule = self.can_use_altar() & self.logic.received(ModSkillLevel.magic_level, 6)
magic_attack_options_rule = self.has_attack_spell_count(3)
magic_support_options_rule = self.has_support_spell_count(1)
return magic_resource_rule & magic_attack_options_rule & magic_support_options_rule
def has_amazing_spells(self) -> StardewRule:
if ModNames.magic not in self.options.mods:
return False_()
magic_resource_rule = self.can_use_altar() & self.logic.received(ModSkillLevel.magic_level, 8)
magic_attack_options_rule = self.has_attack_spell_count(4)
magic_support_options_rule = self.has_support_spell_count(2)
return magic_resource_rule & magic_attack_options_rule & magic_support_options_rule
def can_blink(self) -> StardewRule:
if ModNames.magic not in self.options.mods:
return False_()
return self.logic.received(MagicSpell.blink) & self.can_use_altar()