| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from typing import Union | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from Utils import cache_self1 | 
					
						
							|  |  |  | from .action_logic import ActionLogicMixin | 
					
						
							|  |  |  | from .base_logic import BaseLogic, BaseLogicMixin | 
					
						
							|  |  |  | from .has_logic import HasLogicMixin | 
					
						
							|  |  |  | from .received_logic import ReceivedLogicMixin | 
					
						
							|  |  |  | 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 .tool_logic import ToolLogicMixin | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from .. import options | 
					
						
							|  |  |  | from ..data.museum_data import MuseumItem, all_museum_items, all_museum_artifacts, all_museum_minerals | 
					
						
							| 
									
										
										
											
												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, False_ | 
					
						
							|  |  |  | from ..strings.metal_names import Mineral | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +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, ToolMaterial | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class MuseumLogicMixin(BaseLogicMixin): | 
					
						
							|  |  |  |     def __init__(self, *args, **kwargs): | 
					
						
							|  |  |  |         super().__init__(*args, **kwargs) | 
					
						
							|  |  |  |         self.museum = MuseumLogic(*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 MuseumLogic(BaseLogic[Union[ReceivedLogicMixin, HasLogicMixin, TimeLogicMixin, RegionLogicMixin, ActionLogicMixin, ToolLogicMixin, MuseumLogicMixin]]): | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def can_donate_museum_items(self, number: int) -> StardewRule: | 
					
						
							|  |  |  |         return self.logic.region.can_reach(Region.museum) & self.logic.museum.can_find_museum_items(number) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def can_donate_museum_artifacts(self, number: int) -> StardewRule: | 
					
						
							|  |  |  |         return self.logic.region.can_reach(Region.museum) & self.logic.museum.can_find_museum_artifacts(number) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @cache_self1 | 
					
						
							|  |  |  |     def can_find_museum_item(self, item: MuseumItem) -> StardewRule: | 
					
						
							|  |  |  |         if item.locations: | 
					
						
							|  |  |  |             region_rule = self.logic.region.can_reach_all_except_one(item.locations) | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             region_rule = False_() | 
					
						
							|  |  |  |         if item.geodes: | 
					
						
							| 
									
										
										
											
												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
										 |  |  |             geodes_rule = self.logic.and_(*(self.logic.action.can_open_geode(geode) for geode in item.geodes)) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         else: | 
					
						
							|  |  |  |             geodes_rule = False_() | 
					
						
							|  |  |  |         # monster_rule = self.can_farm_monster(item.monsters) | 
					
						
							| 
									
										
										
										
											2024-07-20 15:24:24 -04:00
										 |  |  |         time_needed_to_grind = int((20 - item.difficulty) // 2) | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         time_rule = self.logic.time.has_lived_months(time_needed_to_grind) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         pan_rule = 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
										 |  |  |         if item.item_name == Mineral.earth_crystal or item.item_name == Mineral.fire_quartz or item.item_name == Mineral.frozen_tear: | 
					
						
							|  |  |  |             pan_rule = self.logic.tool.has_tool(Tool.pan, ToolMaterial.iridium) | 
					
						
							|  |  |  |         return (pan_rule | region_rule | geodes_rule) & time_rule  # & monster_rule & extra_rule | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def can_find_museum_artifacts(self, number: int) -> StardewRule: | 
					
						
							|  |  |  |         rules = [] | 
					
						
							|  |  |  |         for artifact in all_museum_artifacts: | 
					
						
							|  |  |  |             rules.append(self.logic.museum.can_find_museum_item(artifact)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return self.logic.count(number, *rules) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def can_find_museum_minerals(self, number: int) -> StardewRule: | 
					
						
							|  |  |  |         rules = [] | 
					
						
							|  |  |  |         for mineral in all_museum_minerals: | 
					
						
							|  |  |  |             rules.append(self.logic.museum.can_find_museum_item(mineral)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return self.logic.count(number, *rules) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def can_find_museum_items(self, number: int) -> StardewRule: | 
					
						
							|  |  |  |         rules = [] | 
					
						
							|  |  |  |         for donation in all_museum_items: | 
					
						
							|  |  |  |             rules.append(self.logic.museum.can_find_museum_item(donation)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return self.logic.count(number, *rules) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def can_complete_museum(self) -> StardewRule: | 
					
						
							|  |  |  |         rules = [self.logic.region.can_reach(Region.museum)] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if self.options.museumsanity == options.Museumsanity.option_none: | 
					
						
							|  |  |  |             rules.append(self.logic.received("Traveling Merchant Metal Detector", 2)) | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             rules.append(self.logic.received("Traveling Merchant Metal Detector", 3)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         for donation in all_museum_items: | 
					
						
							|  |  |  |             rules.append(self.logic.museum.can_find_museum_item(donation)) | 
					
						
							| 
									
										
										
											
												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) & self.logic.region.can_reach(Region.museum) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def can_donate(self, item: str) -> StardewRule: | 
					
						
							|  |  |  |         return self.logic.has(item) & self.logic.region.can_reach(Region.museum) |