| 
									
										
										
											
												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 . import content_packs | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  | from .feature import cropsanity, friendsanity, fishsanity, booksanity, building_progression, skill_progression, tool_progression | 
					
						
							| 
									
										
										
											
												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 .game_content import ContentPack, StardewContent, StardewFeatures | 
					
						
							|  |  |  | from .unpacking import unpack_content | 
					
						
							|  |  |  | from .. import options | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  | from ..strings.building_names import Building | 
					
						
							| 
									
										
										
											
												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_content(player_options: options.StardewValleyOptions) -> StardewContent: | 
					
						
							|  |  |  |     active_packs = choose_content_packs(player_options) | 
					
						
							|  |  |  |     features = choose_features(player_options) | 
					
						
							|  |  |  |     return unpack_content(features, active_packs) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def choose_content_packs(player_options: options.StardewValleyOptions): | 
					
						
							|  |  |  |     active_packs = [content_packs.pelican_town, content_packs.the_desert, content_packs.the_farm, content_packs.the_mines] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if player_options.exclude_ginger_island == options.ExcludeGingerIsland.option_false: | 
					
						
							|  |  |  |         active_packs.append(content_packs.ginger_island_content_pack) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if player_options.special_order_locations & options.SpecialOrderLocations.value_qi: | 
					
						
							|  |  |  |             active_packs.append(content_packs.qi_board_content_pack) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-10 14:34:21 -04:00
										 |  |  |     for mod in sorted(player_options.mods.value): | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         active_packs.append(content_packs.by_mod[mod]) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return active_packs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def choose_features(player_options: options.StardewValleyOptions) -> StardewFeatures: | 
					
						
							|  |  |  |     return StardewFeatures( | 
					
						
							|  |  |  |         choose_booksanity(player_options.booksanity), | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  |         choose_building_progression(player_options.building_progression, player_options.farm_type), | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         choose_cropsanity(player_options.cropsanity), | 
					
						
							|  |  |  |         choose_fishsanity(player_options.fishsanity), | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  |         choose_friendsanity(player_options.friendsanity, player_options.friendsanity_heart_size), | 
					
						
							|  |  |  |         choose_skill_progression(player_options.skill_progression), | 
					
						
							| 
									
										
										
										
											2025-03-08 11:19:29 -05:00
										 |  |  |         choose_tool_progression(player_options.tool_progression, player_options.skill_progression), | 
					
						
							| 
									
										
										
											
												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
										 |  |  |     ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | booksanity_by_option = { | 
					
						
							|  |  |  |     options.Booksanity.option_none: booksanity.BooksanityDisabled(), | 
					
						
							|  |  |  |     options.Booksanity.option_power: booksanity.BooksanityPower(), | 
					
						
							|  |  |  |     options.Booksanity.option_power_skill: booksanity.BooksanityPowerSkill(), | 
					
						
							|  |  |  |     options.Booksanity.option_all: booksanity.BooksanityAll(), | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def choose_booksanity(booksanity_option: options.Booksanity) -> booksanity.BooksanityFeature: | 
					
						
							|  |  |  |     booksanity_feature = booksanity_by_option.get(booksanity_option) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if booksanity_feature is None: | 
					
						
							|  |  |  |         raise ValueError(f"No booksanity feature mapped to {str(booksanity_option.value)}") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return booksanity_feature | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cropsanity_by_option = { | 
					
						
							|  |  |  |     options.Cropsanity.option_disabled: cropsanity.CropsanityDisabled(), | 
					
						
							|  |  |  |     options.Cropsanity.option_enabled: cropsanity.CropsanityEnabled(), | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def choose_cropsanity(cropsanity_option: options.Cropsanity) -> cropsanity.CropsanityFeature: | 
					
						
							|  |  |  |     cropsanity_feature = cropsanity_by_option.get(cropsanity_option) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if cropsanity_feature is None: | 
					
						
							|  |  |  |         raise ValueError(f"No cropsanity feature mapped to {str(cropsanity_option.value)}") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return cropsanity_feature | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fishsanity_by_option = { | 
					
						
							|  |  |  |     options.Fishsanity.option_none: fishsanity.FishsanityNone(), | 
					
						
							|  |  |  |     options.Fishsanity.option_legendaries: fishsanity.FishsanityLegendaries(), | 
					
						
							|  |  |  |     options.Fishsanity.option_special: fishsanity.FishsanitySpecial(), | 
					
						
							|  |  |  |     options.Fishsanity.option_randomized: fishsanity.FishsanityAll(randomization_ratio=0.4), | 
					
						
							|  |  |  |     options.Fishsanity.option_all: fishsanity.FishsanityAll(), | 
					
						
							|  |  |  |     options.Fishsanity.option_exclude_legendaries: fishsanity.FishsanityExcludeLegendaries(), | 
					
						
							|  |  |  |     options.Fishsanity.option_exclude_hard_fish: fishsanity.FishsanityExcludeHardFish(), | 
					
						
							|  |  |  |     options.Fishsanity.option_only_easy_fish: fishsanity.FishsanityOnlyEasyFish(), | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def choose_fishsanity(fishsanity_option: options.Fishsanity) -> fishsanity.FishsanityFeature: | 
					
						
							|  |  |  |     fishsanity_feature = fishsanity_by_option.get(fishsanity_option) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if fishsanity_feature is None: | 
					
						
							|  |  |  |         raise ValueError(f"No fishsanity feature mapped to {str(fishsanity_option.value)}") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return fishsanity_feature | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def choose_friendsanity(friendsanity_option: options.Friendsanity, heart_size: options.FriendsanityHeartSize) -> friendsanity.FriendsanityFeature: | 
					
						
							|  |  |  |     if friendsanity_option == options.Friendsanity.option_none: | 
					
						
							|  |  |  |         return friendsanity.FriendsanityNone() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if friendsanity_option == options.Friendsanity.option_bachelors: | 
					
						
							|  |  |  |         return friendsanity.FriendsanityBachelors(heart_size.value) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if friendsanity_option == options.Friendsanity.option_starting_npcs: | 
					
						
							|  |  |  |         return friendsanity.FriendsanityStartingNpc(heart_size.value) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if friendsanity_option == options.Friendsanity.option_all: | 
					
						
							|  |  |  |         return friendsanity.FriendsanityAll(heart_size.value) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if friendsanity_option == options.Friendsanity.option_all_with_marriage: | 
					
						
							|  |  |  |         return friendsanity.FriendsanityAllWithMarriage(heart_size.value) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     raise ValueError(f"No friendsanity feature mapped to {str(friendsanity_option.value)}") | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-08 12:37:45 -04:00
										 |  |  | def choose_building_progression(building_option: options.BuildingProgression, | 
					
						
							|  |  |  |                                 farm_type_option: options.FarmType) -> building_progression.BuildingProgressionFeature: | 
					
						
							|  |  |  |     starting_buildings = {Building.farm_house, Building.pet_bowl, Building.shipping_bin} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if farm_type_option == options.FarmType.option_meadowlands: | 
					
						
							|  |  |  |         starting_buildings.add(Building.coop) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (building_option == options.BuildingProgression.option_vanilla | 
					
						
							|  |  |  |             or building_option == options.BuildingProgression.option_vanilla_cheap | 
					
						
							|  |  |  |             or building_option == options.BuildingProgression.option_vanilla_very_cheap): | 
					
						
							|  |  |  |         return building_progression.BuildingProgressionVanilla( | 
					
						
							|  |  |  |             starting_buildings=starting_buildings, | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     starting_buildings.remove(Building.shipping_bin) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (building_option == options.BuildingProgression.option_progressive | 
					
						
							|  |  |  |             or building_option == options.BuildingProgression.option_progressive_cheap | 
					
						
							|  |  |  |             or building_option == options.BuildingProgression.option_progressive_very_cheap): | 
					
						
							|  |  |  |         return building_progression.BuildingProgressionProgressive( | 
					
						
							|  |  |  |             starting_buildings=starting_buildings, | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     raise ValueError(f"No building progression feature mapped to {str(building_option.value)}") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  | skill_progression_by_option = { | 
					
						
							|  |  |  |     options.SkillProgression.option_vanilla: skill_progression.SkillProgressionVanilla(), | 
					
						
							|  |  |  |     options.SkillProgression.option_progressive: skill_progression.SkillProgressionProgressive(), | 
					
						
							|  |  |  |     options.SkillProgression.option_progressive_with_masteries: skill_progression.SkillProgressionProgressiveWithMasteries(), | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def choose_skill_progression(skill_progression_option: options.SkillProgression) -> skill_progression.SkillProgressionFeature: | 
					
						
							|  |  |  |     skill_progression_feature = skill_progression_by_option.get(skill_progression_option) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if skill_progression_feature is None: | 
					
						
							|  |  |  |         raise ValueError(f"No skill progression feature mapped to {str(skill_progression_option.value)}") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return skill_progression_feature | 
					
						
							| 
									
										
										
										
											2025-03-08 11:19:29 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def choose_tool_progression(tool_option: options.ToolProgression, skill_option: options.SkillProgression) -> tool_progression.ToolProgressionFeature: | 
					
						
							|  |  |  |     if tool_option.is_vanilla: | 
					
						
							|  |  |  |         return tool_progression.ToolProgressionVanilla() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     tools_distribution = tool_progression.get_tools_distribution( | 
					
						
							|  |  |  |         progressive_tools_enabled=True, | 
					
						
							|  |  |  |         skill_masteries_enabled=skill_option == options.SkillProgression.option_progressive_with_masteries, | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if tool_option.is_progressive: | 
					
						
							|  |  |  |         return tool_progression.ToolProgressionProgressive(tools_distribution) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     raise ValueError(f"No tool progression feature mapped to {str(tool_option.value)}") |