| 
									
										
										
											
												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 typing import Union, TYPE_CHECKING | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from Utils import cache_self1 | 
					
						
							|  |  |  | from .base_logic import BaseLogic, BaseLogicMixin | 
					
						
							|  |  |  | from .book_logic import BookLogicMixin | 
					
						
							|  |  |  | from .has_logic import HasLogicMixin | 
					
						
							|  |  |  | from .received_logic import ReceivedLogicMixin | 
					
						
							| 
									
										
										
										
											2024-08-31 21:57:43 +03:00
										 |  |  | from .region_logic import RegionLogicMixin | 
					
						
							| 
									
										
										
											
												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 .time_logic import TimeLogicMixin | 
					
						
							|  |  |  | from ..stardew_rule import StardewRule, HasProgressionPercent | 
					
						
							|  |  |  | from ..strings.book_names import Book | 
					
						
							|  |  |  | from ..strings.craftable_names import Consumable | 
					
						
							|  |  |  | from ..strings.currency_names import Currency | 
					
						
							|  |  |  | from ..strings.fish_names import WaterChest | 
					
						
							|  |  |  | from ..strings.geode_names import Geode | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  | from ..strings.material_names import Material | 
					
						
							| 
									
										
										
										
											2024-08-31 21:57:43 +03:00
										 |  |  | from ..strings.region_names import Region | 
					
						
							| 
									
										
										
											
												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.tool_names import Tool | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if TYPE_CHECKING: | 
					
						
							|  |  |  |     from .tool_logic import ToolLogicMixin | 
					
						
							|  |  |  | else: | 
					
						
							|  |  |  |     ToolLogicMixin = object | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  | MIN_MEDIUM_ITEMS = 10 | 
					
						
							|  |  |  | MAX_MEDIUM_ITEMS = 999 | 
					
						
							|  |  |  | PERCENT_REQUIRED_FOR_MAX_MEDIUM_ITEM = 24 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | EASY_ITEMS = {Material.wood, Material.stone, Material.fiber, Material.sap} | 
					
						
							|  |  |  | MIN_EASY_ITEMS = 300 | 
					
						
							|  |  |  | MAX_EASY_ITEMS = 2997 | 
					
						
							|  |  |  | PERCENT_REQUIRED_FOR_MAX_EASY_ITEM = 6 | 
					
						
							| 
									
										
										
											
												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 GrindLogicMixin(BaseLogicMixin): | 
					
						
							|  |  |  |     def __init__(self, *args, **kwargs): | 
					
						
							|  |  |  |         super().__init__(*args, **kwargs) | 
					
						
							|  |  |  |         self.grind = GrindLogic(*args, **kwargs) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-31 21:57:43 +03:00
										 |  |  | class GrindLogic(BaseLogic[Union[GrindLogicMixin, HasLogicMixin, ReceivedLogicMixin, RegionLogicMixin, BookLogicMixin, TimeLogicMixin, ToolLogicMixin]]): | 
					
						
							| 
									
										
										
											
												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 can_grind_mystery_boxes(self, quantity: int) -> StardewRule: | 
					
						
							| 
									
										
										
										
											2024-08-31 21:57:43 +03:00
										 |  |  |         opening_rule = self.logic.region.can_reach(Region.blacksmith) | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         mystery_box_rule = self.logic.has(Consumable.mystery_box) | 
					
						
							|  |  |  |         book_of_mysteries_rule = self.logic.true_ \ | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  |             if not self.content.features.booksanity.is_enabled \ | 
					
						
							| 
									
										
										
											
												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
										 |  |  |             else self.logic.book.has_book_power(Book.book_of_mysteries) | 
					
						
							|  |  |  |         # Assuming one box per day, but halved because we don't know how many months have passed before Mr. Qi's Plane Ride. | 
					
						
							|  |  |  |         time_rule = self.logic.time.has_lived_months(quantity // 14) | 
					
						
							| 
									
										
										
										
											2024-08-31 21:57:43 +03:00
										 |  |  |         return self.logic.and_(opening_rule, mystery_box_rule, | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  |                                book_of_mysteries_rule, time_rule, ) | 
					
						
							| 
									
										
										
											
												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 can_grind_artifact_troves(self, quantity: int) -> StardewRule: | 
					
						
							| 
									
										
										
										
											2024-08-31 21:57:43 +03:00
										 |  |  |         opening_rule = self.logic.region.can_reach(Region.blacksmith) | 
					
						
							|  |  |  |         return self.logic.and_(opening_rule, self.logic.has(Geode.artifact_trove), | 
					
						
							| 
									
										
										
											
												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
										 |  |  |                                # Assuming one per month if the player does not grind it. | 
					
						
							|  |  |  |                                self.logic.time.has_lived_months(quantity)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def can_grind_prize_tickets(self, quantity: int) -> StardewRule: | 
					
						
							| 
									
										
										
										
											2024-08-31 21:57:43 +03:00
										 |  |  |         claiming_rule = self.logic.region.can_reach(Region.mayor_house) | 
					
						
							|  |  |  |         return self.logic.and_(claiming_rule, self.logic.has(Currency.prize_ticket), | 
					
						
							| 
									
										
										
											
												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
										 |  |  |                                # Assuming two per month if the player does not grind it. | 
					
						
							|  |  |  |                                self.logic.time.has_lived_months(quantity // 2)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def can_grind_fishing_treasure_chests(self, quantity: int) -> StardewRule: | 
					
						
							|  |  |  |         return self.logic.and_(self.logic.has(WaterChest.fishing_chest), | 
					
						
							|  |  |  |                                # Assuming one per week if the player does not grind it. | 
					
						
							|  |  |  |                                self.logic.time.has_lived_months(quantity // 4)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def can_grind_artifact_spots(self, quantity: int) -> StardewRule: | 
					
						
							|  |  |  |         return self.logic.and_(self.logic.tool.has_tool(Tool.hoe), | 
					
						
							|  |  |  |                                # Assuming twelve per month if the player does not grind it. | 
					
						
							|  |  |  |                                self.logic.time.has_lived_months(quantity // 12)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  |     def can_grind_item(self, quantity: int, item: str | None = None) -> StardewRule: | 
					
						
							|  |  |  |         if item in EASY_ITEMS: | 
					
						
							|  |  |  |             return self.logic.grind.can_grind_easy_item(quantity) | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             return self.logic.grind.can_grind_medium_item(quantity) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @cache_self1 | 
					
						
							|  |  |  |     def can_grind_medium_item(self, quantity: int) -> StardewRule: | 
					
						
							|  |  |  |         if quantity <= MIN_MEDIUM_ITEMS: | 
					
						
							|  |  |  |             return self.logic.true_ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         quantity = min(quantity, MAX_MEDIUM_ITEMS) | 
					
						
							|  |  |  |         price = max(1, quantity * PERCENT_REQUIRED_FOR_MAX_MEDIUM_ITEM // MAX_MEDIUM_ITEMS) | 
					
						
							|  |  |  |         return HasProgressionPercent(self.player, price) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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
										 |  |  |     @cache_self1 | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  |     def can_grind_easy_item(self, quantity: int) -> StardewRule: | 
					
						
							|  |  |  |         if quantity <= MIN_EASY_ITEMS: | 
					
						
							| 
									
										
										
											
												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.true_ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  |         quantity = min(quantity, MAX_EASY_ITEMS) | 
					
						
							|  |  |  |         price = max(1, quantity * PERCENT_REQUIRED_FOR_MAX_EASY_ITEM // MAX_EASY_ITEMS) | 
					
						
							| 
									
										
										
											
												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 HasProgressionPercent(self.player, price) |