| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from functools import cached_property | 
					
						
							|  |  |  | from typing import Union, Tuple | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from Utils import cache_self1 | 
					
						
							|  |  |  | from .base_logic import BaseLogicMixin, BaseLogic | 
					
						
							|  |  |  | from .combat_logic import CombatLogicMixin | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  | from .harvesting_logic import HarvestingLogicMixin | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from .has_logic import HasLogicMixin | 
					
						
							|  |  |  | from .received_logic import ReceivedLogicMixin | 
					
						
							|  |  |  | from .region_logic import RegionLogicMixin | 
					
						
							|  |  |  | from .season_logic import SeasonLogicMixin | 
					
						
							|  |  |  | from .time_logic import TimeLogicMixin | 
					
						
							|  |  |  | from .tool_logic import ToolLogicMixin | 
					
						
							|  |  |  | from .. import options | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  | from ..data.harvest import HarvestCropSource | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from ..mods.logic.magic_logic import MagicLogicMixin | 
					
						
							|  |  |  | from ..mods.logic.mod_skills_levels import get_mod_skill_levels | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  | from ..stardew_rule import StardewRule, True_, False_, true_, And | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from ..strings.craftable_names import Fishing | 
					
						
							|  |  |  | from ..strings.machine_names import Machine | 
					
						
							|  |  |  | from ..strings.performance_names import Performance | 
					
						
							|  |  |  | from ..strings.quality_names import ForageQuality | 
					
						
							|  |  |  | from ..strings.region_names import Region | 
					
						
							|  |  |  | from ..strings.skill_names import Skill, all_mod_skills | 
					
						
							|  |  |  | from ..strings.tool_names import ToolMaterial, Tool | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  | from ..strings.wallet_item_names import Wallet | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | fishing_regions = (Region.beach, Region.town, Region.forest, Region.mountain, Region.island_south, Region.island_west) | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  | vanilla_skill_items = ("Farming Level", "Mining Level", "Foraging Level", "Fishing Level", "Combat Level") | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SkillLogicMixin(BaseLogicMixin): | 
					
						
							|  |  |  |     def __init__(self, *args, **kwargs): | 
					
						
							|  |  |  |         super().__init__(*args, **kwargs) | 
					
						
							|  |  |  |         self.skill = SkillLogic(*args, **kwargs) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SkillLogic(BaseLogic[Union[HasLogicMixin, ReceivedLogicMixin, RegionLogicMixin, SeasonLogicMixin, TimeLogicMixin, ToolLogicMixin, SkillLogicMixin, | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  | CombatLogicMixin, MagicLogicMixin, HarvestingLogicMixin]]): | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |     # Should be cached | 
					
						
							|  |  |  |     def can_earn_level(self, skill: str, level: int) -> StardewRule: | 
					
						
							|  |  |  |         if level <= 0: | 
					
						
							|  |  |  |             return True_() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         tool_level = (level - 1) // 2 | 
					
						
							|  |  |  |         tool_material = ToolMaterial.tiers[tool_level] | 
					
						
							|  |  |  |         months = max(1, level - 1) | 
					
						
							|  |  |  |         months_rule = self.logic.time.has_lived_months(months) | 
					
						
							| 
									
										
										
										
											2024-03-28 04:42:35 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if self.options.skill_progression != options.SkillProgression.option_vanilla: | 
					
						
							|  |  |  |             previous_level_rule = self.logic.skill.has_level(skill, level - 1) | 
					
						
							|  |  |  |         else: | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |             previous_level_rule = true_ | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if skill == Skill.fishing: | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |             xp_rule = self.logic.tool.has_fishing_rod(max(tool_level, 3)) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         elif skill == Skill.farming: | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |             xp_rule = self.can_get_farming_xp & self.logic.tool.has_tool(Tool.hoe, tool_material) & self.logic.tool.can_water(tool_level) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         elif skill == Skill.foraging: | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |             xp_rule = (self.can_get_foraging_xp & self.logic.tool.has_tool(Tool.axe, tool_material)) |\ | 
					
						
							|  |  |  |                       self.logic.magic.can_use_clear_debris_instead_of_tool_level(tool_level) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         elif skill == Skill.mining: | 
					
						
							|  |  |  |             xp_rule = self.logic.tool.has_tool(Tool.pickaxe, tool_material) | \ | 
					
						
							|  |  |  |                       self.logic.magic.can_use_clear_debris_instead_of_tool_level(tool_level) | 
					
						
							|  |  |  |             xp_rule = xp_rule & self.logic.region.can_reach(Region.mines_floor_5) | 
					
						
							|  |  |  |         elif skill == Skill.combat: | 
					
						
							|  |  |  |             combat_tier = Performance.tiers[tool_level] | 
					
						
							|  |  |  |             xp_rule = self.logic.combat.can_fight_at_level(combat_tier) | 
					
						
							|  |  |  |             xp_rule = xp_rule & self.logic.region.can_reach(Region.mines_floor_5) | 
					
						
							|  |  |  |         elif skill in all_mod_skills: | 
					
						
							|  |  |  |             # Ideal solution would be to add a logic registry, but I'm too lazy. | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |             return previous_level_rule & months_rule & self.logic.mod.skill.can_earn_mod_skill_level(skill, level) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         else: | 
					
						
							|  |  |  |             raise Exception(f"Unknown skill: {skill}") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return previous_level_rule & months_rule & xp_rule | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Should be cached | 
					
						
							|  |  |  |     def has_level(self, skill: str, level: int) -> StardewRule: | 
					
						
							|  |  |  |         if level <= 0: | 
					
						
							|  |  |  |             return True_() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |         if self.options.skill_progression == options.SkillProgression.option_vanilla: | 
					
						
							|  |  |  |             return self.logic.skill.can_earn_level(skill, level) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03: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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |         return self.logic.received(f"{skill} Level", level) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @cache_self1 | 
					
						
							|  |  |  |     def has_farming_level(self, level: int) -> StardewRule: | 
					
						
							|  |  |  |         return self.logic.skill.has_level(Skill.farming, level) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Should be cached | 
					
						
							|  |  |  |     def has_total_level(self, level: int, allow_modded_skills: bool = False) -> StardewRule: | 
					
						
							|  |  |  |         if level <= 0: | 
					
						
							|  |  |  |             return True_() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |         if self.options.skill_progression >= options.SkillProgression.option_progressive: | 
					
						
							|  |  |  |             skills_items = vanilla_skill_items | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |             if allow_modded_skills: | 
					
						
							|  |  |  |                 skills_items += get_mod_skill_levels(self.options.mods) | 
					
						
							|  |  |  |             return self.logic.received_n(*skills_items, count=level) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         months_with_4_skills = max(1, (level // 4) - 1) | 
					
						
							|  |  |  |         months_with_5_skills = max(1, (level // 5) - 1) | 
					
						
							|  |  |  |         rule_with_fishing = self.logic.time.has_lived_months(months_with_5_skills) & self.logic.skill.can_get_fishing_xp | 
					
						
							|  |  |  |         if level > 40: | 
					
						
							|  |  |  |             return rule_with_fishing | 
					
						
							|  |  |  |         return self.logic.time.has_lived_months(months_with_4_skills) | rule_with_fishing | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |     def has_all_skills_maxed(self, included_modded_skills: bool = True) -> StardewRule: | 
					
						
							|  |  |  |         if self.options.skill_progression == options.SkillProgression.option_vanilla: | 
					
						
							|  |  |  |             return self.has_total_level(50) | 
					
						
							|  |  |  |         skills_items = vanilla_skill_items | 
					
						
							|  |  |  |         if included_modded_skills: | 
					
						
							|  |  |  |             skills_items += get_mod_skill_levels(self.options.mods) | 
					
						
							|  |  |  |         return And(*[self.logic.received(skill, 10) for skill in skills_items]) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def can_enter_mastery_cave(self) -> StardewRule: | 
					
						
							|  |  |  |         if self.options.skill_progression == options.SkillProgression.option_progressive_with_masteries: | 
					
						
							|  |  |  |             return self.logic.received(Wallet.mastery_of_the_five_ways) | 
					
						
							|  |  |  |         return self.has_all_skills_maxed() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |     @cached_property | 
					
						
							|  |  |  |     def can_get_farming_xp(self) -> StardewRule: | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |         sources = self.content.find_sources_of_type(HarvestCropSource) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         crop_rules = [] | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |         for crop_source in sources: | 
					
						
							|  |  |  |             crop_rules.append(self.logic.harvesting.can_harvest_crop_from(crop_source)) | 
					
						
							|  |  |  |         return self.logic.or_(*crop_rules) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @cached_property | 
					
						
							|  |  |  |     def can_get_foraging_xp(self) -> StardewRule: | 
					
						
							|  |  |  |         tool_rule = self.logic.tool.has_tool(Tool.axe) | 
					
						
							|  |  |  |         tree_rule = self.logic.region.can_reach(Region.forest) & self.logic.season.has_any_not_winter() | 
					
						
							|  |  |  |         stump_rule = self.logic.region.can_reach(Region.secret_woods) & self.logic.tool.has_tool(Tool.axe, ToolMaterial.copper) | 
					
						
							|  |  |  |         return tool_rule & (tree_rule | stump_rule) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @cached_property | 
					
						
							|  |  |  |     def can_get_mining_xp(self) -> StardewRule: | 
					
						
							|  |  |  |         tool_rule = self.logic.tool.has_tool(Tool.pickaxe) | 
					
						
							|  |  |  |         stone_rule = self.logic.region.can_reach_any((Region.mines_floor_5, Region.quarry, Region.skull_cavern_25, Region.volcano_floor_5)) | 
					
						
							|  |  |  |         return tool_rule & stone_rule | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @cached_property | 
					
						
							|  |  |  |     def can_get_combat_xp(self) -> StardewRule: | 
					
						
							|  |  |  |         tool_rule = self.logic.combat.has_any_weapon() | 
					
						
							|  |  |  |         enemy_rule = self.logic.region.can_reach_any((Region.mines_floor_5, Region.skull_cavern_25, Region.volcano_floor_5)) | 
					
						
							|  |  |  |         return tool_rule & enemy_rule | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @cached_property | 
					
						
							|  |  |  |     def can_get_fishing_xp(self) -> StardewRule: | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |         if self.options.skill_progression >= options.SkillProgression.option_progressive: | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |             return self.logic.skill.can_fish() | self.logic.skill.can_crab_pot | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return self.logic.skill.can_fish() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Should be cached | 
					
						
							|  |  |  |     def can_fish(self, regions: Union[str, Tuple[str, ...]] = None, difficulty: int = 0) -> StardewRule: | 
					
						
							|  |  |  |         if isinstance(regions, str): | 
					
						
							|  |  |  |             regions = regions, | 
					
						
							| 
									
										
										
										
											2024-03-28 04:42:35 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         if regions is None or len(regions) == 0: | 
					
						
							|  |  |  |             regions = fishing_regions | 
					
						
							| 
									
										
										
										
											2024-03-28 04:42:35 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         skill_required = min(10, max(0, int((difficulty / 10) - 1))) | 
					
						
							|  |  |  |         if difficulty <= 40: | 
					
						
							|  |  |  |             skill_required = 0 | 
					
						
							| 
									
										
										
										
											2024-03-28 04:42:35 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         skill_rule = self.logic.skill.has_level(Skill.fishing, skill_required) | 
					
						
							|  |  |  |         region_rule = self.logic.region.can_reach_any(regions) | 
					
						
							| 
									
										
										
										
											2024-03-28 04:42:35 -04:00
										 |  |  |         # Training rod only works with fish < 50. Fiberglass does not help you to catch higher difficulty fish, so it's skipped in logic. | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         number_fishing_rod_required = 1 if difficulty < 50 else (2 if difficulty < 80 else 4) | 
					
						
							|  |  |  |         return self.logic.tool.has_fishing_rod(number_fishing_rod_required) & skill_rule & region_rule | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @cache_self1 | 
					
						
							|  |  |  |     def can_crab_pot_at(self, region: str) -> StardewRule: | 
					
						
							|  |  |  |         return self.logic.skill.can_crab_pot & self.logic.region.can_reach(region) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @cached_property | 
					
						
							|  |  |  |     def can_crab_pot(self) -> StardewRule: | 
					
						
							|  |  |  |         crab_pot_rule = self.logic.has(Fishing.bait) | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  |         if self.options.skill_progression >= options.SkillProgression.option_progressive: | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |             crab_pot_rule = crab_pot_rule & self.logic.has(Machine.crab_pot) | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             crab_pot_rule = crab_pot_rule & self.logic.skill.can_get_fishing_xp | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         water_region_rules = self.logic.region.can_reach_any(fishing_regions) | 
					
						
							|  |  |  |         return crab_pot_rule & water_region_rules | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def can_forage_quality(self, quality: str) -> StardewRule: | 
					
						
							|  |  |  |         if quality == ForageQuality.basic: | 
					
						
							|  |  |  |             return True_() | 
					
						
							|  |  |  |         if quality == ForageQuality.silver: | 
					
						
							|  |  |  |             return self.has_level(Skill.foraging, 5) | 
					
						
							|  |  |  |         if quality == ForageQuality.gold: | 
					
						
							|  |  |  |             return self.has_level(Skill.foraging, 9) | 
					
						
							|  |  |  |         return False_() | 
					
						
							| 
									
										
										
											
												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
											
										 
											2024-07-07 16:04:25 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @cached_property | 
					
						
							|  |  |  |     def can_earn_mastery_experience(self) -> StardewRule: | 
					
						
							|  |  |  |         if self.options.skill_progression != options.SkillProgression.option_progressive_with_masteries: | 
					
						
							|  |  |  |             return self.has_all_skills_maxed() & self.logic.time.has_lived_max_months | 
					
						
							|  |  |  |         return self.logic.time.has_lived_max_months | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def has_mastery(self, skill: str) -> StardewRule: | 
					
						
							|  |  |  |         if self.options.skill_progression != options.SkillProgression.option_progressive_with_masteries: | 
					
						
							|  |  |  |             return self.can_earn_mastery_experience and self.logic.region.can_reach(Region.mastery_cave) | 
					
						
							|  |  |  |         return self.logic.received(f"{skill} Mastery") |