| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  | from ... import HasProgressionPercent, StardewLogic | 
					
						
							| 
									
										
										
											
												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 ToolProgression, SkillProgression, Mods | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  | from ...strings.skill_names import all_skills, all_vanilla_skills, Skill | 
					
						
							| 
									
										
										
											
												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 ...test import SVTestBase | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  | class TestSkillProgressionVanilla(SVTestBase): | 
					
						
							| 
									
										
										
											
												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: SkillProgression.option_vanilla, | 
					
						
							|  |  |  |         ToolProgression.internal_name: ToolProgression.option_progressive, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_skill_logic_has_level_only_uses_one_has_progression_percent(self): | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  |         rule = self.multiworld.worlds[1].logic.skill.has_level(Skill.farming, 8) | 
					
						
							|  |  |  |         self.assertEqual(1, sum(1 for i in rule.current_rules if type(i) is HasProgressionPercent)) | 
					
						
							| 
									
										
										
											
												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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  |     def test_has_mastery_requires_month_equivalent_to_10_levels(self): | 
					
						
							|  |  |  |         logic: StardewLogic = self.multiworld.worlds[1].logic | 
					
						
							|  |  |  |         rule = logic.skill.has_mastery(Skill.farming) | 
					
						
							|  |  |  |         time_rule = logic.time.has_lived_months(10) | 
					
						
							| 
									
										
										
											
												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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  |         self.assertIn(time_rule, rule.current_rules) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TestSkillProgressionProgressive(SVTestBase): | 
					
						
							| 
									
										
										
											
												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 = { | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  |         SkillProgression.internal_name: SkillProgression.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
										 |  |  |         Mods.internal_name: frozenset(Mods.valid_keys), | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_all_skill_levels_require_previous_level(self): | 
					
						
							|  |  |  |         for skill in all_skills: | 
					
						
							|  |  |  |             self.collect_everything() | 
					
						
							|  |  |  |             self.remove_by_name(f"{skill} Level") | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04: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
										 |  |  |             for level in range(1, 11): | 
					
						
							|  |  |  |                 location_name = f"Level {level} {skill}" | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  |                 location = self.multiworld.get_location(location_name, self.player) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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.subTest(location_name): | 
					
						
							|  |  |  |                     if level > 1: | 
					
						
							| 
									
										
										
										
											2025-02-04 02:27:23 -05:00
										 |  |  |                         self.assert_cannot_reach_location(location, self.multiworld.state) | 
					
						
							| 
									
										
										
											
												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
										 |  |  |                         self.collect(f"{skill} Level") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-04 02:27:23 -05:00
										 |  |  |                     self.assert_can_reach_location(location, self.multiworld.state) | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |             self.reset_collection_state() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_has_level_requires_exact_amount_of_levels(self): | 
					
						
							|  |  |  |         logic: StardewLogic = self.multiworld.worlds[1].logic | 
					
						
							|  |  |  |         rule = logic.skill.has_level(Skill.farming, 8) | 
					
						
							|  |  |  |         level_rule = logic.received("Farming Level", 8) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.assertEqual(level_rule, rule) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_has_previous_level_requires_one_less_level_than_requested(self): | 
					
						
							|  |  |  |         logic: StardewLogic = self.multiworld.worlds[1].logic | 
					
						
							|  |  |  |         rule = logic.skill.has_previous_level(Skill.farming, 8) | 
					
						
							|  |  |  |         level_rule = logic.received("Farming Level", 7) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.assertEqual(level_rule, rule) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_has_mastery_requires_10_levels(self): | 
					
						
							|  |  |  |         logic: StardewLogic = self.multiworld.worlds[1].logic | 
					
						
							|  |  |  |         rule = logic.skill.has_mastery(Skill.farming) | 
					
						
							|  |  |  |         level_rule = logic.received("Farming Level", 10) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.assertIn(level_rule, rule.current_rules) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TestSkillProgressionProgressiveWithMasteryWithoutMods(SVTestBase): | 
					
						
							|  |  |  |     options = { | 
					
						
							|  |  |  |         SkillProgression.internal_name: SkillProgression.option_progressive_with_masteries, | 
					
						
							|  |  |  |         ToolProgression.internal_name: ToolProgression.option_progressive, | 
					
						
							|  |  |  |         Mods.internal_name: frozenset(), | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_has_mastery_requires_the_item(self): | 
					
						
							|  |  |  |         logic: StardewLogic = self.multiworld.worlds[1].logic | 
					
						
							|  |  |  |         rule = logic.skill.has_mastery(Skill.farming) | 
					
						
							|  |  |  |         received_mastery = logic.received("Farming Mastery") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.assertEqual(received_mastery, rule) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_given_all_levels_when_can_earn_mastery_then_can_earn_mastery(self): | 
					
						
							|  |  |  |         self.collect_everything() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         for skill in all_vanilla_skills: | 
					
						
							|  |  |  |             with self.subTest(skill): | 
					
						
							|  |  |  |                 location = self.multiworld.get_location(f"{skill} Mastery", self.player) | 
					
						
							| 
									
										
										
										
											2025-02-04 02:27:23 -05:00
										 |  |  |                 self.assert_can_reach_location(location, self.multiworld.state) | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |         self.reset_collection_state() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_given_one_level_missing_when_can_earn_mastery_then_cannot_earn_mastery(self): | 
					
						
							|  |  |  |         for skill in all_vanilla_skills: | 
					
						
							|  |  |  |             with self.subTest(skill): | 
					
						
							|  |  |  |                 self.collect_everything() | 
					
						
							|  |  |  |                 self.remove_one_by_name(f"{skill} Level") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 location = self.multiworld.get_location(f"{skill} Mastery", self.player) | 
					
						
							| 
									
										
										
										
											2025-02-04 02:27:23 -05:00
										 |  |  |                 self.assert_cannot_reach_location(location, self.multiworld.state) | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 self.reset_collection_state() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def test_given_one_tool_missing_when_can_earn_mastery_then_cannot_earn_mastery(self): | 
					
						
							|  |  |  |         self.collect_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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  |         self.remove_one_by_name(f"Progressive Pickaxe") | 
					
						
							|  |  |  |         location = self.multiworld.get_location("Mining Mastery", self.player) | 
					
						
							| 
									
										
										
										
											2025-02-04 02:27:23 -05:00
										 |  |  |         self.assert_cannot_reach_location(location, self.multiworld.state) | 
					
						
							| 
									
										
										
											
												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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-08 12:46:58 -04:00
										 |  |  |         self.reset_collection_state() |