mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-07-24 08:10:48 -07:00
1de91fab67
Major Content update for Stardew Valley ### Features - New BundleRandomization Value: Meme Bundles - Over 100 custom bundles, designed to be jokes, references, trolls, etc - New Setting: Bundles Per Room modifier - New Setting: Backpack Size - New Setting: Secretsanity - Checks for triggering easter eggs and secrets - New Setting: Moviesanity - Checks for watching movies and sharing snacks with Villagers - New Setting: Eatsanity - Checks for eating items - New Setting: Hatsanity - Checks for wearing Hats - New Setting: Start Without - Allows you to select any combination of various "starting" items, that you will actually not start with. Notably, tools, backpack slots, Day5 unlocks, etc. - New Setting: Allowed Filler Items - Allows you to customize the filler items you'll get - New Setting: Endgame Locations - Checks for various expensive endgame tasks and purchases - New Shipsanity value: Crops and Fish - New Settings: Jojapocalypse and settings to customize it - Bundle Plando: Replaced with BundleWhitelist and BundleBlacklist, for more customization freedom - Added a couple of Host.yaml settings to help hosts allow or ban specific difficult settings that could cause problems if the people don't know what they are signing up for. Plus a truckload of improvements on the mod side, not seen in this PR. ### Removed features - Integration for Stardew Valley Expanded. It is simply disabled, the code is all still there, but I'm extremely tired of providing tech support for it, plus Stardew Valley 1.7 was announced and that will break it again, so I'm done. When a maintainer steps up, it can be re-enabled.
107 lines
5.1 KiB
Python
107 lines
5.1 KiB
Python
from ...logic.base_logic import BaseLogicMixin, BaseLogic
|
|
from ...stardew_rule import StardewRule, True_, And
|
|
from ...strings.building_names import Building
|
|
from ...strings.craftable_names import ModCraftable, ModMachine
|
|
from ...strings.geode_names import Geode
|
|
from ...strings.machine_names import Machine
|
|
from ...strings.region_names import Region
|
|
from ...strings.skill_names import ModSkill
|
|
from ...strings.spells import MagicSpell
|
|
from ...strings.tool_names import Tool, ToolMaterial
|
|
|
|
|
|
class ModSkillLogicMixin(BaseLogicMixin):
|
|
def __init__(self, *args, **kwargs):
|
|
super().__init__(*args, **kwargs)
|
|
self.skill = ModSkillLogic(*args, **kwargs)
|
|
|
|
|
|
class ModSkillLogic(BaseLogic):
|
|
def has_mod_level(self, skill: str, level: int) -> StardewRule:
|
|
if level <= 0:
|
|
return True_()
|
|
|
|
if self.content.features.skill_progression.is_progressive:
|
|
return self.logic.received(f"{skill} Level", level)
|
|
|
|
return self.can_earn_mod_skill_level(skill, level)
|
|
|
|
def can_earn_mod_skill_level(self, skill: str, level: int) -> StardewRule:
|
|
if not skill in self.content.skills:
|
|
return self.logic.false_
|
|
|
|
if skill == ModSkill.luck:
|
|
return self.can_earn_luck_skill_level(level)
|
|
if skill == ModSkill.magic:
|
|
return self.can_earn_magic_skill_level(level)
|
|
if skill == ModSkill.socializing:
|
|
return self.can_earn_socializing_skill_level(level)
|
|
if skill == ModSkill.archaeology:
|
|
return self.can_earn_archaeology_skill_level(level)
|
|
if skill == ModSkill.cooking:
|
|
return self.can_earn_cooking_skill_level(level)
|
|
if skill == ModSkill.binning:
|
|
return self.can_earn_binning_skill_level(level)
|
|
|
|
return self.logic.false_
|
|
|
|
def can_earn_luck_skill_level(self, level: int) -> StardewRule:
|
|
if level >= 6:
|
|
return self.logic.fishing.can_fish_chests | self.logic.action.can_open_geode(Geode.magma)
|
|
if level >= 3:
|
|
return self.logic.fishing.can_fish_chests | self.logic.action.can_open_geode(Geode.geode)
|
|
return True_() # You can literally wake up and or get them by opening starting chests.
|
|
|
|
def can_earn_magic_skill_level(self, level: int) -> StardewRule:
|
|
spell_count = [self.logic.received(MagicSpell.clear_debris), self.logic.received(MagicSpell.water),
|
|
self.logic.received(MagicSpell.blink), self.logic.received(MagicSpell.fireball),
|
|
self.logic.received(MagicSpell.frostbite),
|
|
self.logic.received(MagicSpell.descend), self.logic.received(MagicSpell.tendrils),
|
|
self.logic.received(MagicSpell.shockwave),
|
|
self.logic.received(MagicSpell.meteor),
|
|
self.logic.received(MagicSpell.spirit)]
|
|
return self.logic.count(level, *spell_count)
|
|
|
|
def can_earn_socializing_skill_level(self, level: int) -> StardewRule:
|
|
villager_count = []
|
|
|
|
for villager in self.content.villagers.values():
|
|
villager_count.append(self.logic.relationship.can_earn_relationship(villager.name, level))
|
|
|
|
return self.logic.count(level * 2, *villager_count)
|
|
|
|
def can_earn_archaeology_skill_level(self, level: int) -> StardewRule:
|
|
shifter_rule = True_()
|
|
preservation_rule = True_()
|
|
if self.content.features.skill_progression.is_progressive:
|
|
shifter_rule = self.logic.has(ModCraftable.water_sifter)
|
|
preservation_rule = self.logic.has(ModMachine.hardwood_preservation_chamber)
|
|
if level > 8:
|
|
tool_rule = self.logic.tool.has_pan(ToolMaterial.iridium) & self.logic.tool.has_tool(Tool.hoe, ToolMaterial.gold)
|
|
return tool_rule & shifter_rule & preservation_rule
|
|
if level > 6:
|
|
tool_rule = self.logic.tool.has_pan(ToolMaterial.gold) & self.logic.tool.has_tool(Tool.hoe, ToolMaterial.iron)
|
|
return tool_rule & preservation_rule
|
|
if level >= 3:
|
|
return self.logic.tool.has_pan(ToolMaterial.iron) | self.logic.tool.has_tool(Tool.hoe, ToolMaterial.copper)
|
|
return self.logic.tool.has_pan() | self.logic.tool.has_tool(Tool.hoe, ToolMaterial.basic)
|
|
|
|
def can_earn_cooking_skill_level(self, level: int) -> StardewRule:
|
|
if level >= 6:
|
|
return self.logic.cooking.can_cook() & self.logic.region.can_reach(Region.saloon) & \
|
|
self.logic.building.has_building(Building.coop) & self.logic.building.has_building(Building.barn)
|
|
else:
|
|
return self.logic.cooking.can_cook()
|
|
|
|
def can_earn_binning_skill_level(self, level: int) -> StardewRule:
|
|
if level <= 2:
|
|
return True_()
|
|
binning_rule = [self.logic.has(ModMachine.trash_bin) & self.logic.has(Machine.recycling_machine)]
|
|
if level > 4:
|
|
binning_rule.append(self.logic.has(ModMachine.composter))
|
|
if level > 7:
|
|
binning_rule.append(self.logic.has(ModMachine.recycling_bin))
|
|
if level > 9:
|
|
binning_rule.append(self.logic.has(ModMachine.advanced_recycling_machine))
|
|
return And(*binning_rule)
|