| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from BaseClasses import MultiWorld, get_seed | 
					
						
							| 
									
										
										
											
												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 setup_solo_multiworld, SVTestCase, allsanity_no_mods_6_x_x, get_minsanity_options, solo_multiworld | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from .. import StardewValleyWorld | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  | from ..items import Group, item_table | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | from ..options import Friendsanity, SeasonRandomization, Museumsanity, Shipsanity, Goal | 
					
						
							|  |  |  | from ..strings.wallet_item_names import Wallet | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | all_seasons = ["Spring", "Summer", "Fall", "Winter"] | 
					
						
							| 
									
										
										
										
											2023-02-26 19:19:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-28 00:18:33 +02:00
										 |  |  | class TestItems(SVTestCase): | 
					
						
							| 
									
										
										
										
											2023-02-26 19:19:15 -05:00
										 |  |  |     def test_can_create_item_of_resource_pack(self): | 
					
						
							|  |  |  |         item_name = "Resource Pack: 500 Money" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         multi_world = MultiWorld(1) | 
					
						
							|  |  |  |         multi_world.game[1] = "Stardew Valley" | 
					
						
							|  |  |  |         multi_world.player_name = {1: "Tester"} | 
					
						
							|  |  |  |         world = StardewValleyWorld(multi_world, 1) | 
					
						
							|  |  |  |         item = world.create_item(item_name) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         assert item.name == item_name | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |     def test_items_table_footprint_is_between_717000_and_737000(self): | 
					
						
							| 
									
										
										
										
											2023-02-26 19:19:15 -05:00
										 |  |  |         item_with_lowest_id = min((item for item in item_table.values() if item.code is not None), key=lambda x: x.code) | 
					
						
							|  |  |  |         item_with_highest_id = max((item for item in item_table.values() if item.code is not None), | 
					
						
							|  |  |  |                                    key=lambda x: x.code) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         assert item_with_lowest_id.code >= 717000 | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |         assert item_with_highest_id.code < 737000 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_babies_come_in_all_shapes_and_sizes(self): | 
					
						
							|  |  |  |         baby_permutations = set() | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |         options = {Friendsanity.internal_name: Friendsanity.option_bachelors} | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |         for attempt_number in range(50): | 
					
						
							|  |  |  |             if len(baby_permutations) >= 4: | 
					
						
							|  |  |  |                 print(f"Already got all 4 baby permutations, breaking early [{attempt_number} generations]") | 
					
						
							|  |  |  |                 break | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  |             seed = get_seed() | 
					
						
							|  |  |  |             multiworld = setup_solo_multiworld(options, seed=seed, _cache={}) | 
					
						
							| 
									
										
										
										
											2023-07-19 14:26:38 -04:00
										 |  |  |             baby_items = [item for item in multiworld.get_items() if "Baby" in item.name] | 
					
						
							|  |  |  |             self.assertEqual(len(baby_items), 2) | 
					
						
							|  |  |  |             baby_permutations.add(f"{baby_items[0]} - {baby_items[1]}") | 
					
						
							|  |  |  |         self.assertEqual(len(baby_permutations), 4) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_correct_number_of_stardrops(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
										 |  |  |         allsanity_options = allsanity_no_mods_6_x_x() | 
					
						
							|  |  |  |         with solo_multiworld(allsanity_options) as (multiworld, _): | 
					
						
							|  |  |  |             stardrop_items = [item for item in multiworld.get_items() if item.name == "Stardrop"] | 
					
						
							|  |  |  |             self.assertEqual(len(stardrop_items), 7) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_no_duplicate_rings(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
										 |  |  |         allsanity_options = allsanity_no_mods_6_x_x() | 
					
						
							|  |  |  |         with solo_multiworld(allsanity_options) as (multiworld, _): | 
					
						
							|  |  |  |             ring_items = [item.name for item in multiworld.get_items() if Group.RING in item_table[item.name].groups] | 
					
						
							|  |  |  |             self.assertEqual(len(ring_items), len(set(ring_items))) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_can_start_in_any_season(self): | 
					
						
							|  |  |  |         starting_seasons_rolled = set() | 
					
						
							|  |  |  |         options = {SeasonRandomization.internal_name: SeasonRandomization.option_randomized} | 
					
						
							|  |  |  |         for attempt_number in range(50): | 
					
						
							|  |  |  |             if len(starting_seasons_rolled) >= 4: | 
					
						
							|  |  |  |                 print(f"Already got all 4 starting seasons, breaking early [{attempt_number} generations]") | 
					
						
							|  |  |  |                 break | 
					
						
							|  |  |  |             seed = get_seed() | 
					
						
							|  |  |  |             multiworld = setup_solo_multiworld(options, seed=seed, _cache={}) | 
					
						
							|  |  |  |             starting_season_items = [item for item in multiworld.precollected_items[1] if item.name in all_seasons] | 
					
						
							|  |  |  |             season_items = [item for item in multiworld.get_items() if item.name in all_seasons] | 
					
						
							|  |  |  |             self.assertEqual(len(starting_season_items), 1) | 
					
						
							|  |  |  |             self.assertEqual(len(season_items), 3) | 
					
						
							|  |  |  |             starting_seasons_rolled.add(f"{starting_season_items[0]}") | 
					
						
							|  |  |  |         self.assertEqual(len(starting_seasons_rolled), 4) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TestMetalDetectors(SVTestCase): | 
					
						
							|  |  |  |     def test_minsanity_1_metal_detector(self): | 
					
						
							|  |  |  |         options = get_minsanity_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
										 |  |  |         with solo_multiworld(options) as (multiworld, _): | 
					
						
							|  |  |  |             items = [item.name for item in multiworld.get_items() if item.name == Wallet.metal_detector] | 
					
						
							|  |  |  |             self.assertEqual(len(items), 1) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_museumsanity_2_metal_detector(self): | 
					
						
							|  |  |  |         options = get_minsanity_options().copy() | 
					
						
							|  |  |  |         options[Museumsanity.internal_name] = Museumsanity.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
										 |  |  |         with solo_multiworld(options) as (multiworld, _): | 
					
						
							|  |  |  |             items = [item.name for item in multiworld.get_items() if item.name == Wallet.metal_detector] | 
					
						
							|  |  |  |             self.assertEqual(len(items), 2) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_shipsanity_full_shipment_1_metal_detector(self): | 
					
						
							|  |  |  |         options = get_minsanity_options().copy() | 
					
						
							|  |  |  |         options[Shipsanity.internal_name] = Shipsanity.option_full_shipment | 
					
						
							| 
									
										
										
											
												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 solo_multiworld(options) as (multiworld, _): | 
					
						
							|  |  |  |             items = [item.name for item in multiworld.get_items() if item.name == Wallet.metal_detector] | 
					
						
							|  |  |  |             self.assertEqual(len(items), 1) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_shipsanity_everything_2_metal_detector(self): | 
					
						
							|  |  |  |         options = get_minsanity_options().copy() | 
					
						
							|  |  |  |         options[Shipsanity.internal_name] = Shipsanity.option_everything | 
					
						
							| 
									
										
										
											
												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 solo_multiworld(options) as (multiworld, _): | 
					
						
							|  |  |  |             items = [item.name for item in multiworld.get_items() if item.name == Wallet.metal_detector] | 
					
						
							|  |  |  |             self.assertEqual(len(items), 2) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_complete_collection_2_metal_detector(self): | 
					
						
							|  |  |  |         options = get_minsanity_options().copy() | 
					
						
							|  |  |  |         options[Goal.internal_name] = Goal.option_complete_collection | 
					
						
							| 
									
										
										
											
												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 solo_multiworld(options) as (multiworld, _): | 
					
						
							|  |  |  |             items = [item.name for item in multiworld.get_items() if item.name == Wallet.metal_detector] | 
					
						
							|  |  |  |             self.assertEqual(len(items), 2) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_perfection_2_metal_detector(self): | 
					
						
							|  |  |  |         options = get_minsanity_options().copy() | 
					
						
							|  |  |  |         options[Goal.internal_name] = Goal.option_perfection | 
					
						
							| 
									
										
										
											
												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 solo_multiworld(options) as (multiworld, _): | 
					
						
							|  |  |  |             items = [item.name for item in multiworld.get_items() if item.name == Wallet.metal_detector] | 
					
						
							|  |  |  |             self.assertEqual(len(items), 2) | 
					
						
							| 
									
										
										
										
											2024-03-15 15:05:14 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def test_maxsanity_4_metal_detector(self): | 
					
						
							|  |  |  |         options = get_minsanity_options().copy() | 
					
						
							|  |  |  |         options[Museumsanity.internal_name] = Museumsanity.option_all | 
					
						
							|  |  |  |         options[Shipsanity.internal_name] = Shipsanity.option_everything | 
					
						
							|  |  |  |         options[Goal.internal_name] = Goal.option_perfection | 
					
						
							| 
									
										
										
											
												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 solo_multiworld(options) as (multiworld, _): | 
					
						
							|  |  |  |             items = [item.name for item in multiworld.get_items() if item.name == Wallet.metal_detector] | 
					
						
							|  |  |  |             self.assertEqual(len(items), 4) |