| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from typing import Union | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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 .cooking_logic import CookingLogicMixin | 
					
						
							|  |  |  | from .has_logic import HasLogicMixin | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from .received_logic import ReceivedLogicMixin | 
					
						
							|  |  |  | from .region_logic import RegionLogicMixin | 
					
						
							|  |  |  | from .skill_logic import SkillLogicMixin | 
					
						
							|  |  |  | 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 ..stardew_rule import StardewRule, True_ | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from ..strings.performance_names import Performance | 
					
						
							|  |  |  | from ..strings.region_names import Region | 
					
						
							|  |  |  | from ..strings.skill_names import Skill | 
					
						
							| 
									
										
										
										
											2025-03-08 11:19:29 -05:00
										 |  |  | from ..strings.tool_names import ToolMaterial | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class MineLogicMixin(BaseLogicMixin): | 
					
						
							|  |  |  |     def __init__(self, *args, **kwargs): | 
					
						
							|  |  |  |         super().__init__(*args, **kwargs) | 
					
						
							|  |  |  |         self.mine = MineLogic(*args, **kwargs) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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
										 |  |  | class MineLogic(BaseLogic[Union[HasLogicMixin, MineLogicMixin, RegionLogicMixin, ReceivedLogicMixin, CombatLogicMixin, ToolLogicMixin, | 
					
						
							|  |  |  | SkillLogicMixin, CookingLogicMixin]]): | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |     # 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 = [] | 
					
						
							| 
									
										
										
										
											2025-03-08 11:19:29 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         weapon_rule = self.logic.mine.get_weapon_rule_for_floor_tier(tier) | 
					
						
							|  |  |  |         rules.append(weapon_rule) | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-08 11:19:29 -05:00
										 |  |  |         tool_rule = self.logic.tool.can_mine_using(ToolMaterial.tiers[tier]) | 
					
						
							|  |  |  |         rules.append(tool_rule) | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # No alternative for vanilla because we assume that you will grind the levels in the mines. | 
					
						
							|  |  |  |         if self.content.features.skill_progression.is_progressive: | 
					
						
							|  |  |  |             skill_level = min(10, max(0, tier * 2)) | 
					
						
							|  |  |  |             rules.append(self.logic.skill.has_level(Skill.combat, skill_level)) | 
					
						
							|  |  |  |             rules.append(self.logic.skill.has_level(Skill.mining, skill_level)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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 tier >= 4: | 
					
						
							|  |  |  |             rules.append(self.logic.cooking.can_cook()) | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05: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.and_(*rules) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @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 = [] | 
					
						
							| 
									
										
										
										
											2025-03-08 11:19:29 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         weapon_rule = self.logic.combat.has_great_weapon | 
					
						
							|  |  |  |         rules.append(weapon_rule) | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-08 11:19:29 -05:00
										 |  |  |         tool_rule = self.logic.tool.can_mine_using(ToolMaterial.tiers[min(4, max(0, tier + 2))]) | 
					
						
							|  |  |  |         rules.append(tool_rule) | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # No alternative for vanilla because we assume that you will grind the levels in the mines. | 
					
						
							|  |  |  |         if self.content.features.skill_progression.is_progressive: | 
					
						
							|  |  |  |             skill_level = min(10, max(0, tier * 2 + 6)) | 
					
						
							|  |  |  |             rules.extend((self.logic.skill.has_level(Skill.combat, skill_level), | 
					
						
							|  |  |  |                           self.logic.skill.has_level(Skill.mining, skill_level))) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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.and_(*rules) |