mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00

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>
87 lines
3.9 KiB
Python
87 lines
3.9 KiB
Python
from typing import Union
|
|
|
|
from Utils import cache_self1
|
|
from .base_logic import BaseLogicMixin, BaseLogic
|
|
from .combat_logic import CombatLogicMixin
|
|
from .received_logic import ReceivedLogicMixin
|
|
from .region_logic import RegionLogicMixin
|
|
from .skill_logic import SkillLogicMixin
|
|
from .tool_logic import ToolLogicMixin
|
|
from .. import options
|
|
from ..options import ToolProgression
|
|
from ..stardew_rule import StardewRule, And, True_
|
|
from ..strings.performance_names import Performance
|
|
from ..strings.region_names import Region
|
|
from ..strings.skill_names import Skill
|
|
from ..strings.tool_names import Tool, ToolMaterial
|
|
|
|
|
|
class MineLogicMixin(BaseLogicMixin):
|
|
def __init__(self, *args, **kwargs):
|
|
super().__init__(*args, **kwargs)
|
|
self.mine = MineLogic(*args, **kwargs)
|
|
|
|
|
|
class MineLogic(BaseLogic[Union[MineLogicMixin, RegionLogicMixin, ReceivedLogicMixin, CombatLogicMixin, ToolLogicMixin, SkillLogicMixin]]):
|
|
# Regions
|
|
def can_mine_in_the_mines_floor_1_40(self) -> StardewRule:
|
|
return self.logic.region.can_reach(Region.mines_floor_5)
|
|
|
|
def can_mine_in_the_mines_floor_41_80(self) -> StardewRule:
|
|
return self.logic.region.can_reach(Region.mines_floor_45)
|
|
|
|
def can_mine_in_the_mines_floor_81_120(self) -> StardewRule:
|
|
return self.logic.region.can_reach(Region.mines_floor_85)
|
|
|
|
def can_mine_in_the_skull_cavern(self) -> StardewRule:
|
|
return (self.logic.mine.can_progress_in_the_mines_from_floor(120) &
|
|
self.logic.region.can_reach(Region.skull_cavern))
|
|
|
|
@cache_self1
|
|
def get_weapon_rule_for_floor_tier(self, tier: int):
|
|
if tier >= 4:
|
|
return self.logic.combat.can_fight_at_level(Performance.galaxy)
|
|
if tier >= 3:
|
|
return self.logic.combat.can_fight_at_level(Performance.great)
|
|
if tier >= 2:
|
|
return self.logic.combat.can_fight_at_level(Performance.good)
|
|
if tier >= 1:
|
|
return self.logic.combat.can_fight_at_level(Performance.decent)
|
|
return self.logic.combat.can_fight_at_level(Performance.basic)
|
|
|
|
@cache_self1
|
|
def can_progress_in_the_mines_from_floor(self, floor: int) -> StardewRule:
|
|
tier = floor // 40
|
|
rules = []
|
|
weapon_rule = self.logic.mine.get_weapon_rule_for_floor_tier(tier)
|
|
rules.append(weapon_rule)
|
|
if self.options.tool_progression & ToolProgression.option_progressive:
|
|
rules.append(self.logic.tool.has_tool(Tool.pickaxe, ToolMaterial.tiers[tier]))
|
|
if self.options.skill_progression == options.SkillProgression.option_progressive:
|
|
skill_tier = min(10, max(0, tier * 2))
|
|
rules.append(self.logic.skill.has_level(Skill.combat, skill_tier))
|
|
rules.append(self.logic.skill.has_level(Skill.mining, skill_tier))
|
|
return And(*rules)
|
|
|
|
@cache_self1
|
|
def has_mine_elevator_to_floor(self, floor: int) -> StardewRule:
|
|
if floor < 0:
|
|
floor = 0
|
|
if self.options.elevator_progression != options.ElevatorProgression.option_vanilla:
|
|
return self.logic.received("Progressive Mine Elevator", floor // 5)
|
|
return True_()
|
|
|
|
@cache_self1
|
|
def can_progress_in_the_skull_cavern_from_floor(self, floor: int) -> StardewRule:
|
|
tier = floor // 50
|
|
rules = []
|
|
weapon_rule = self.logic.combat.has_great_weapon
|
|
rules.append(weapon_rule)
|
|
if self.options.tool_progression & ToolProgression.option_progressive:
|
|
rules.append(self.logic.received("Progressive Pickaxe", min(4, max(0, tier + 2))))
|
|
if self.options.skill_progression == options.SkillProgression.option_progressive:
|
|
skill_tier = min(10, max(0, tier * 2 + 6))
|
|
rules.extend({self.logic.skill.has_level(Skill.combat, skill_tier),
|
|
self.logic.skill.has_level(Skill.mining, skill_tier)})
|
|
return And(*rules)
|