| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  | import random | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-10 18:39:35 +03:00
										 |  |  | from BaseClasses import get_seed, ItemClassification | 
					
						
							| 
									
										
										
										
											2025-03-23 22:32:34 -04:00
										 |  |  | from .. import SVTestBase, SVTestCase | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from ..assertion import ModAssertMixin, WorldAssertMixin | 
					
						
							| 
									
										
										
										
											2025-03-23 22:32:34 -04:00
										 |  |  | from ..options.presets import allsanity_mods_6_x_x | 
					
						
							|  |  |  | from ..options.utils import fill_dataclass_with_default | 
					
						
							| 
									
										
										
										
											2025-03-10 18:39:35 +03:00
										 |  |  | from ... import options, items, Group, create_content | 
					
						
							| 
									
										
										
										
											2025-01-28 17:19:20 -05:00
										 |  |  | from ...mods.mod_data import ModNames | 
					
						
							| 
									
										
										
											
												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 ...options import SkillProgression, Walnutsanity | 
					
						
							| 
									
										
										
										
											2025-01-28 17:19:20 -05:00
										 |  |  | from ...options.options import all_mods | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from ...regions import RandomizationFlag, randomize_connections, create_final_connections_and_regions | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | class TestGenerateModsOptions(WorldAssertMixin, ModAssertMixin, SVTestCase): | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_given_single_mods_when_generate_then_basic_checks(self): | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         for mod in options.Mods.valid_keys: | 
					
						
							| 
									
										
										
										
											2024-07-25 02:22:46 -05:00
										 |  |  |             world_options = {options.Mods: mod, options.ExcludeGingerIsland: options.ExcludeGingerIsland.option_false} | 
					
						
							|  |  |  |             with self.solo_world_sub_test(f"Mod: {mod}", world_options) as (multi_world, _): | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |                 self.assert_basic_checks(multi_world) | 
					
						
							|  |  |  |                 self.assert_stray_mod_items(mod, multi_world) | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-28 17:19:20 -05:00
										 |  |  |     # The following tests validate that ER still generates winnable and logically-sane games with given mods. | 
					
						
							|  |  |  |     # Mods that do not interact with entrances are skipped | 
					
						
							|  |  |  |     # Not all ER settings are tested, because 'buildings' is, essentially, a superset of all others | 
					
						
							|  |  |  |     def test_deepwoods_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.deepwoods, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_juna_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.juna, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_jasper_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.jasper, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_alec_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.alec, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_yoba_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.yoba, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_eugene_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.eugene, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_ayeisha_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.ayeisha, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_riley_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.riley, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_sve_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.sve, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_alecto_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.alecto, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_lacey_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.lacey, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_boarding_house_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(ModNames.boarding_house, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_all_mods_entrance_randomization_buildings(self): | 
					
						
							|  |  |  |         self.perform_basic_checks_on_mod_with_er(all_mods, options.EntranceRandomization.option_buildings) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def perform_basic_checks_on_mod_with_er(self, mods: str | set[str], er_option: int) -> None: | 
					
						
							|  |  |  |         if isinstance(mods, str): | 
					
						
							|  |  |  |             mods = {mods} | 
					
						
							|  |  |  |         world_options = { | 
					
						
							|  |  |  |             options.EntranceRandomization: er_option, | 
					
						
							|  |  |  |             options.Mods: frozenset(mods), | 
					
						
							|  |  |  |             options.ExcludeGingerIsland: options.ExcludeGingerIsland.option_false | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         with self.solo_world_sub_test(f"entrance_randomization: {er_option}, Mods: {mods}", world_options) as (multi_world, _): | 
					
						
							|  |  |  |             self.assert_basic_checks(multi_world) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_allsanity_all_mods_when_generate_then_basic_checks(self): | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         with self.solo_world_sub_test(world_options=allsanity_mods_6_x_x()) as (multi_world, _): | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |             self.assert_basic_checks(multi_world) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_allsanity_all_mods_exclude_island_when_generate_then_basic_checks(self): | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         world_options = allsanity_mods_6_x_x() | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         world_options.update({options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_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
										 |  |  |         with self.solo_world_sub_test(world_options=world_options) as (multi_world, _): | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |             self.assert_basic_checks(multi_world) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TestBaseLocationDependencies(SVTestBase): | 
					
						
							|  |  |  |     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
										 |  |  |         options.Mods.internal_name: frozenset(options.Mods.valid_keys), | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         options.ToolProgression.internal_name: options.ToolProgression.option_progressive, | 
					
						
							|  |  |  |         options.SeasonRandomization.internal_name: options.SeasonRandomization.option_randomized | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TestBaseItemGeneration(SVTestBase): | 
					
						
							|  |  |  |     options = { | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         options.SeasonRandomization.internal_name: options.SeasonRandomization.option_progressive, | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         options.SkillProgression.internal_name: options.SkillProgression.option_progressive_with_masteries, | 
					
						
							|  |  |  |         options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_false, | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         options.SpecialOrderLocations.internal_name: options.SpecialOrderLocations.option_board_qi, | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         options.Friendsanity.internal_name: options.Friendsanity.option_all_with_marriage, | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         options.Shipsanity.internal_name: options.Shipsanity.option_everything, | 
					
						
							|  |  |  |         options.Chefsanity.internal_name: options.Chefsanity.option_all, | 
					
						
							|  |  |  |         options.Craftsanity.internal_name: options.Craftsanity.option_all, | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         options.Booksanity.internal_name: options.Booksanity.option_all, | 
					
						
							|  |  |  |         Walnutsanity.internal_name: Walnutsanity.preset_all, | 
					
						
							|  |  |  |         options.Mods.internal_name: frozenset(options.Mods.valid_keys) | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_all_progression_items_are_added_to_the_pool(self): | 
					
						
							|  |  |  |         all_created_items = [item.name for item in self.multiworld.itempool] | 
					
						
							|  |  |  |         # Ignore all the stuff that the algorithm chooses one of, instead of all, to fulfill logical progression | 
					
						
							|  |  |  |         items_to_ignore = [event.name for event in items.events] | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         items_to_ignore.extend(deprecated.name for deprecated in items.items_by_group[Group.DEPRECATED]) | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |         items_to_ignore.extend(season.name for season in items.items_by_group[Group.SEASON]) | 
					
						
							|  |  |  |         items_to_ignore.extend(weapon.name for weapon in items.items_by_group[Group.WEAPON]) | 
					
						
							|  |  |  |         items_to_ignore.extend(baby.name for baby in items.items_by_group[Group.BABY]) | 
					
						
							|  |  |  |         items_to_ignore.extend(resource_pack.name for resource_pack in items.items_by_group[Group.RESOURCE_PACK]) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         items_to_ignore.append("The Gateway Gazette") | 
					
						
							| 
									
										
										
										
											2024-11-26 18:44:33 -05:00
										 |  |  |         progression_items = [item for item in items.all_items if item.classification & ItemClassification.progression | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |                              and item.name not in items_to_ignore] | 
					
						
							|  |  |  |         for progression_item in progression_items: | 
					
						
							|  |  |  |             with self.subTest(f"{progression_item.name}"): | 
					
						
							|  |  |  |                 self.assertIn(progression_item.name, all_created_items) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TestNoGingerIslandModItemGeneration(SVTestBase): | 
					
						
							|  |  |  |     options = { | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         options.SeasonRandomization.internal_name: options.SeasonRandomization.option_progressive, | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         options.SkillProgression.internal_name: options.SkillProgression.option_progressive_with_masteries, | 
					
						
							|  |  |  |         options.Friendsanity.internal_name: options.Friendsanity.option_all_with_marriage, | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         options.Shipsanity.internal_name: options.Shipsanity.option_everything, | 
					
						
							|  |  |  |         options.Chefsanity.internal_name: options.Chefsanity.option_all, | 
					
						
							|  |  |  |         options.Craftsanity.internal_name: options.Craftsanity.option_all, | 
					
						
							| 
									
										
										
											
												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
										 |  |  |         options.Booksanity.internal_name: options.Booksanity.option_all, | 
					
						
							|  |  |  |         options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_true, | 
					
						
							|  |  |  |         options.Mods.internal_name: frozenset(options.Mods.valid_keys) | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_all_progression_items_except_island_are_added_to_the_pool(self): | 
					
						
							|  |  |  |         all_created_items = [item.name for item in self.multiworld.itempool] | 
					
						
							|  |  |  |         # Ignore all the stuff that the algorithm chooses one of, instead of all, to fulfill logical progression | 
					
						
							|  |  |  |         items_to_ignore = [event.name for event in items.events] | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         items_to_ignore.extend(deprecated.name for deprecated in items.items_by_group[Group.DEPRECATED]) | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |         items_to_ignore.extend(season.name for season in items.items_by_group[Group.SEASON]) | 
					
						
							|  |  |  |         items_to_ignore.extend(weapon.name for weapon in items.items_by_group[Group.WEAPON]) | 
					
						
							|  |  |  |         items_to_ignore.extend(baby.name for baby in items.items_by_group[Group.BABY]) | 
					
						
							|  |  |  |         items_to_ignore.extend(resource_pack.name for resource_pack in items.items_by_group[Group.RESOURCE_PACK]) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         items_to_ignore.append("The Gateway Gazette") | 
					
						
							| 
									
										
										
										
											2024-11-26 18:44:33 -05:00
										 |  |  |         progression_items = [item for item in items.all_items if item.classification & ItemClassification.progression | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |                              and item.name not in items_to_ignore] | 
					
						
							|  |  |  |         for progression_item in progression_items: | 
					
						
							|  |  |  |             with self.subTest(f"{progression_item.name}"): | 
					
						
							|  |  |  |                 if Group.GINGER_ISLAND in progression_item.groups: | 
					
						
							|  |  |  |                     self.assertNotIn(progression_item.name, all_created_items) | 
					
						
							|  |  |  |                 else: | 
					
						
							|  |  |  |                     self.assertIn(progression_item.name, all_created_items) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-28 00:18:33 +02:00
										 |  |  | class TestModEntranceRando(SVTestCase): | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_mod_entrance_randomization(self): | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         for option, flag in [(options.EntranceRandomization.option_pelican_town, RandomizationFlag.PELICAN_TOWN), | 
					
						
							|  |  |  |                              (options.EntranceRandomization.option_non_progression, RandomizationFlag.NON_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
										 |  |  |                              (options.EntranceRandomization.option_buildings_without_house, RandomizationFlag.BUILDINGS), | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |                              (options.EntranceRandomization.option_buildings, RandomizationFlag.BUILDINGS)]: | 
					
						
							| 
									
										
										
										
											2024-12-08 21:00:30 -05:00
										 |  |  |             sv_options = fill_dataclass_with_default({ | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |                 options.EntranceRandomization.internal_name: option, | 
					
						
							|  |  |  |                 options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_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
										 |  |  |                 SkillProgression.internal_name: SkillProgression.option_progressive_with_masteries, | 
					
						
							|  |  |  |                 options.Mods.internal_name: frozenset(options.Mods.valid_keys) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |             }) | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  |             content = create_content(sv_options) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |             seed = get_seed() | 
					
						
							|  |  |  |             rand = random.Random(seed) | 
					
						
							|  |  |  |             with self.subTest(option=option, flag=flag, seed=seed): | 
					
						
							|  |  |  |                 final_connections, final_regions = create_final_connections_and_regions(sv_options) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-30 21:52:07 -05:00
										 |  |  |                 _, randomized_connections = randomize_connections(rand, sv_options, content, final_regions, final_connections) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 for connection_name in final_connections: | 
					
						
							|  |  |  |                     connection = final_connections[connection_name] | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |                     if flag in connection.flag: | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |                         connection_in_randomized = connection_name in randomized_connections | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |                         reverse_in_randomized = connection.reverse in randomized_connections | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |                         self.assertTrue(connection_in_randomized, f"Connection {connection_name} should be randomized but it is not in the output") | 
					
						
							|  |  |  |                         self.assertTrue(reverse_in_randomized, f"Connection {connection.reverse} should be randomized but it is not in the output.") | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 self.assertEqual(len(set(randomized_connections.values())), len(randomized_connections.values()), | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |                                  f"Connections are duplicated in randomization.") | 
					
						
							| 
									
										
										
										
											2025-03-10 18:39:35 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TestVanillaLogicAlternativeWhenQuestsAreNotRandomized(WorldAssertMixin, SVTestBase): | 
					
						
							|  |  |  |     """We often forget to add an alternative rule that works when quests are not randomized. When this happens, some
 | 
					
						
							|  |  |  |     Location are not reachable because they depend on items that are only added to the pool when quests are randomized. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     options = allsanity_mods_6_x_x() | { | 
					
						
							|  |  |  |         options.QuestLocations.internal_name: options.QuestLocations.special_range_names["none"], | 
					
						
							|  |  |  |         options.Goal.internal_name: options.Goal.option_perfection, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_given_no_quest_all_mods_when_generate_then_can_reach_everything(self): | 
					
						
							|  |  |  |         self.collect_everything() | 
					
						
							|  |  |  |         self.assert_can_reach_everything(self.multiworld) |