| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from dataclasses import dataclass | 
					
						
							|  |  |  | from random import Random | 
					
						
							|  |  |  | from typing import List | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from .bundle import Bundle, BundleTemplate | 
					
						
							| 
									
										
										
											
												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 ..content import StardewContent | 
					
						
							| 
									
										
										
										
											2025-02-01 16:07:08 -05:00
										 |  |  | from ..options import StardewValleyOptions | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @dataclass | 
					
						
							|  |  |  | class BundleRoom: | 
					
						
							|  |  |  |     name: str | 
					
						
							|  |  |  |     bundles: List[Bundle] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @dataclass | 
					
						
							|  |  |  | class BundleRoomTemplate: | 
					
						
							|  |  |  |     name: str | 
					
						
							|  |  |  |     bundles: List[BundleTemplate] | 
					
						
							|  |  |  |     number_bundles: int | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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 create_bundle_room(self, random: Random, content: StardewContent, options: StardewValleyOptions): | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         filtered_bundles = [bundle for bundle in self.bundles if bundle.can_appear(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
										 |  |  | 
 | 
					
						
							|  |  |  |         priority_bundles = [] | 
					
						
							|  |  |  |         unpriority_bundles = [] | 
					
						
							|  |  |  |         for bundle in filtered_bundles: | 
					
						
							|  |  |  |             if bundle.name in options.bundle_plando: | 
					
						
							|  |  |  |                 priority_bundles.append(bundle) | 
					
						
							|  |  |  |             else: | 
					
						
							|  |  |  |                 unpriority_bundles.append(bundle) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if self.number_bundles <= len(priority_bundles): | 
					
						
							|  |  |  |             chosen_bundles = random.sample(priority_bundles, self.number_bundles) | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             chosen_bundles = priority_bundles | 
					
						
							|  |  |  |             num_remaining_bundles = self.number_bundles - len(priority_bundles) | 
					
						
							|  |  |  |             if num_remaining_bundles > len(unpriority_bundles): | 
					
						
							|  |  |  |                 chosen_bundles.extend(random.choices(unpriority_bundles, k=num_remaining_bundles)) | 
					
						
							|  |  |  |             else: | 
					
						
							|  |  |  |                 chosen_bundles.extend(random.sample(unpriority_bundles, num_remaining_bundles)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return BundleRoom(self.name, [bundle.create_bundle(random, content, options) for bundle in chosen_bundles]) |