| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from functools import cached_property | 
					
						
							| 
									
										
										
										
											2025-04-23 11:31:08 -04:00
										 |  |  | from typing import List | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | from .base_logic import BaseLogicMixin, BaseLogic | 
					
						
							|  |  |  | from ..bundles.bundle import Bundle | 
					
						
							| 
									
										
										
											
												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_ | 
					
						
							|  |  |  | from ..strings.ap_names.community_upgrade_names import CommunityUpgrade | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from ..strings.currency_names import Currency | 
					
						
							|  |  |  | from ..strings.machine_names import Machine | 
					
						
							|  |  |  | from ..strings.quality_names import CropQuality, ForageQuality, FishQuality, ArtisanQuality | 
					
						
							| 
									
										
										
											
												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.quest_names import Quest | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from ..strings.region_names import Region | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BundleLogicMixin(BaseLogicMixin): | 
					
						
							|  |  |  |     def __init__(self, *args, **kwargs): | 
					
						
							|  |  |  |         super().__init__(*args, **kwargs) | 
					
						
							|  |  |  |         self.bundle = BundleLogic(*args, **kwargs) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-23 11:31:08 -04:00
										 |  |  | class BundleLogic(BaseLogic): | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |     # Should be cached | 
					
						
							|  |  |  |     def can_complete_bundle(self, bundle: Bundle) -> StardewRule: | 
					
						
							|  |  |  |         item_rules = [] | 
					
						
							|  |  |  |         qualities = [] | 
					
						
							| 
									
										
										
											
												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_to_grind = 0 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         can_speak_junimo = self.logic.region.can_reach(Region.wizard_tower) | 
					
						
							|  |  |  |         for bundle_item in bundle.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
										 |  |  |             if Currency.is_currency(bundle_item.get_item()): | 
					
						
							|  |  |  |                 return can_speak_junimo & self.logic.money.can_trade(bundle_item.get_item(), bundle_item.amount) | 
					
						
							| 
									
										
										
										
											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
										 |  |  |             item_rules.append(bundle_item.get_item()) | 
					
						
							|  |  |  |             if bundle_item.amount > 50: | 
					
						
							|  |  |  |                 time_to_grind = bundle_item.amount // 50 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |             qualities.append(bundle_item.quality) | 
					
						
							|  |  |  |         quality_rules = self.get_quality_rules(qualities) | 
					
						
							|  |  |  |         item_rules = self.logic.has_n(*item_rules, count=bundle.number_required) | 
					
						
							| 
									
										
										
										
											2024-07-20 15:24:24 -04:00
										 |  |  |         time_rule = self.logic.time.has_lived_months(time_to_grind) | 
					
						
							| 
									
										
										
											
												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 can_speak_junimo & item_rules & quality_rules & time_rule | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def get_quality_rules(self, qualities: List[str]) -> StardewRule: | 
					
						
							|  |  |  |         crop_quality = CropQuality.get_highest(qualities) | 
					
						
							|  |  |  |         fish_quality = FishQuality.get_highest(qualities) | 
					
						
							|  |  |  |         forage_quality = ForageQuality.get_highest(qualities) | 
					
						
							|  |  |  |         artisan_quality = ArtisanQuality.get_highest(qualities) | 
					
						
							|  |  |  |         quality_rules = [] | 
					
						
							|  |  |  |         if crop_quality != CropQuality.basic: | 
					
						
							| 
									
										
										
											
												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
										 |  |  |             quality_rules.append(self.logic.quality.can_grow_crop_quality(crop_quality)) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         if fish_quality != FishQuality.basic: | 
					
						
							|  |  |  |             quality_rules.append(self.logic.fishing.can_catch_quality_fish(fish_quality)) | 
					
						
							|  |  |  |         if forage_quality != ForageQuality.basic: | 
					
						
							|  |  |  |             quality_rules.append(self.logic.skill.can_forage_quality(forage_quality)) | 
					
						
							|  |  |  |         if artisan_quality != ArtisanQuality.basic: | 
					
						
							|  |  |  |             quality_rules.append(self.logic.has(Machine.cask)) | 
					
						
							|  |  |  |         if not quality_rules: | 
					
						
							|  |  |  |             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
										 |  |  |         return self.logic.and_(*quality_rules) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @cached_property | 
					
						
							|  |  |  |     def can_complete_community_center(self) -> StardewRule: | 
					
						
							|  |  |  |         return (self.logic.region.can_reach_location("Complete Crafts Room") & | 
					
						
							|  |  |  |                 self.logic.region.can_reach_location("Complete Pantry") & | 
					
						
							|  |  |  |                 self.logic.region.can_reach_location("Complete Fish Tank") & | 
					
						
							|  |  |  |                 self.logic.region.can_reach_location("Complete Bulletin Board") & | 
					
						
							|  |  |  |                 self.logic.region.can_reach_location("Complete Vault") & | 
					
						
							|  |  |  |                 self.logic.region.can_reach_location("Complete Boiler Room")) | 
					
						
							| 
									
										
										
											
												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_access_raccoon_bundles(self) -> StardewRule: | 
					
						
							| 
									
										
										
										
											2025-03-10 18:39:35 +03:00
										 |  |  |         if self.options.quest_locations.has_no_story_quests(): | 
					
						
							| 
									
										
										
											
												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(CommunityUpgrade.raccoon, 1) & self.logic.quest.can_complete_quest(Quest.giant_stump) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # 1 - Break the tree | 
					
						
							|  |  |  |         # 2 - Build the house, which summons the bundle racoon. This one is done manually if quests are turned off | 
					
						
							|  |  |  |         return self.logic.received(CommunityUpgrade.raccoon, 2) |