mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Stardew Valley 6.x.x: The Content Update (#3478)
Focus of the Update: Compatibility with Stardew Valley 1.6 Released on March 19th 2024 This includes randomization for pretty much all of the new content, including but not limited to - Raccoon Bundles - Booksanity - Skill Masteries - New Recipes, Craftables, Fish, Maps, Farm Type, Festivals and Quests This also includes a significant reorganisation of the code into "Content Packs", to allow for easier modularity of various game mechanics between the settings and the supported mods. This improves maintainability quite a bit. In addition to that, a few **very** requested new features have been introduced, although they weren't the focus of this update - Walnutsanity - Player Buffs - More customizability in settings, such as shorter special orders, ER without farmhouse - New Remixed Bundles
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Union, Iterable
|
||||
from typing import Union, Iterable, Tuple
|
||||
|
||||
from Utils import cache_self1
|
||||
from .base_logic import BaseLogicMixin, BaseLogic
|
||||
@@ -42,9 +42,17 @@ class ToolLogicMixin(BaseLogicMixin):
|
||||
|
||||
|
||||
class ToolLogic(BaseLogic[Union[ToolLogicMixin, HasLogicMixin, ReceivedLogicMixin, RegionLogicMixin, SeasonLogicMixin, MoneyLogicMixin, MagicLogicMixin]]):
|
||||
|
||||
def has_all_tools(self, tools: Iterable[Tuple[str, str]]):
|
||||
return self.logic.and_(*(self.logic.tool.has_tool(tool, material) for tool, material in tools))
|
||||
|
||||
# Should be cached
|
||||
def has_tool(self, tool: str, material: str = ToolMaterial.basic) -> StardewRule:
|
||||
assert tool != Tool.fishing_rod, "Use `has_fishing_rod` instead of `has_tool`."
|
||||
if tool == Tool.fishing_rod:
|
||||
return self.logic.tool.has_fishing_rod(tool_materials[material])
|
||||
|
||||
if tool == Tool.pan and material == ToolMaterial.basic:
|
||||
material = ToolMaterial.copper # The first Pan is the copper one, so the basic one does not exist
|
||||
|
||||
if material == ToolMaterial.basic or tool == Tool.scythe:
|
||||
return True_()
|
||||
@@ -52,7 +60,14 @@ class ToolLogic(BaseLogic[Union[ToolLogicMixin, HasLogicMixin, ReceivedLogicMixi
|
||||
if self.options.tool_progression & ToolProgression.option_progressive:
|
||||
return self.logic.received(f"Progressive {tool}", tool_materials[material])
|
||||
|
||||
return self.logic.has(f"{material} Bar") & self.logic.money.can_spend_at(Region.blacksmith, tool_upgrade_prices[material])
|
||||
can_upgrade_rule = self.logic.has(f"{material} Bar") & self.logic.money.can_spend_at(Region.blacksmith, tool_upgrade_prices[material])
|
||||
if tool == Tool.pan:
|
||||
has_base_pan = self.logic.received("Glittering Boulder Removed") & self.logic.region.can_reach(Region.mountain)
|
||||
if material == ToolMaterial.copper:
|
||||
return has_base_pan
|
||||
return has_base_pan & can_upgrade_rule
|
||||
|
||||
return can_upgrade_rule
|
||||
|
||||
def can_use_tool_at(self, tool: str, material: str, region: str) -> StardewRule:
|
||||
return self.has_tool(tool, material) & self.logic.region.can_reach(region)
|
||||
|
||||
Reference in New Issue
Block a user