| 
									
										
										
										
											2021-08-29 14:02:02 -04:00
										 |  |  | import typing | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  | from Options import Option, DefaultOnToggle, Range, Choice | 
					
						
							| 
									
										
										
										
											2021-08-29 14:02:02 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TotalLocations(Range): | 
					
						
							|  |  |  |     """Number of location checks which are added to the Risk of Rain playthrough.""" | 
					
						
							|  |  |  |     displayname = "Total Locations" | 
					
						
							|  |  |  |     range_start = 10 | 
					
						
							| 
									
										
										
										
											2021-09-26 14:22:46 -05:00
										 |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 20 | 
					
						
							| 
									
										
										
										
											2021-08-29 14:02:02 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TotalRevivals(Range): | 
					
						
							|  |  |  |     """Number of `Dio's Best Friend` item put in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Total Revivals Available" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 10 | 
					
						
							|  |  |  |     default = 4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ItemPickupStep(Range): | 
					
						
							|  |  |  |     """Number of items to pick up before an AP Check is completed.
 | 
					
						
							|  |  |  |     Setting to 1 means every other pickup. | 
					
						
							|  |  |  |     Setting to 2 means every third pickup. So on..."""
 | 
					
						
							|  |  |  |     displayname = "Item Pickup Step" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 5 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 2 | 
					
						
							| 
									
										
										
										
											2021-08-29 14:02:02 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | class AllowLunarItems(DefaultOnToggle): | 
					
						
							| 
									
										
										
										
											2021-08-31 20:38:44 -04:00
										 |  |  |     """Allows Lunar items in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Enable Lunar Item Shuffling" | 
					
						
							| 
									
										
										
										
											2021-08-29 14:02:02 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | class StartWithRevive(DefaultOnToggle): | 
					
						
							| 
									
										
										
										
											2021-08-29 14:02:02 -04:00
										 |  |  |     """Start the game with a `Dio's Best Friend` item.""" | 
					
						
							|  |  |  |     displayname = "Start with a Revive" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | class GreenScrap(Range): | 
					
						
							|  |  |  |     """Weight of Green Scraps in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Green Scraps" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 16 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class RedScrap(Range): | 
					
						
							|  |  |  |     """Weight of Red Scraps in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Red Scraps" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 4 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class YellowScrap(Range): | 
					
						
							|  |  |  |     """Weight of yellow scraps in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Yellow Scraps" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							|  |  |  |     default = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class WhiteScrap(Range): | 
					
						
							|  |  |  |     """Weight of white scraps in the item pool.""" | 
					
						
							|  |  |  |     displayname = "White Scraps" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 32 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class CommonItem(Range): | 
					
						
							|  |  |  |     """Weight of common items in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Common Items" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 64 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class UncommonItem(Range): | 
					
						
							|  |  |  |     """Weight of uncommon items in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Uncommon Items" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 32 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class LegendaryItem(Range): | 
					
						
							|  |  |  |     """Weight of legendary items in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Legendary Items" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 8 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BossItem(Range): | 
					
						
							|  |  |  |     """Weight of boss items in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Boss Items" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 4 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class LunarItem(Range): | 
					
						
							|  |  |  |     """Weight of lunar items in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Lunar Items" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 16 | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Equipment(Range): | 
					
						
							|  |  |  |     """Weight of equipment items in the item pool.""" | 
					
						
							|  |  |  |     displayname = "Equipment" | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 100 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     default = 32 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ItemPoolPresetToggle(DefaultOnToggle): | 
					
						
							|  |  |  |     """Will use the item weight presets when set to true, otherwise will use the custom set item pool weights.""" | 
					
						
							|  |  |  |     displayname = "Item Weight Presets" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ItemWeights(Choice): | 
					
						
							| 
									
										
										
										
											2021-09-26 14:28:25 -05:00
										 |  |  |     """Preset choices for determining the weights of the item pool.<br>
 | 
					
						
							|  |  |  |     New is a test for a potential adjustment to the default weights.<br> | 
					
						
							|  |  |  |     Uncommon puts a large number of uncommon items in the pool.<br> | 
					
						
							|  |  |  |     Legendary puts a large number of legendary items in the pool.<br> | 
					
						
							|  |  |  |     Lunartic makes everything a lunar item.<br> | 
					
						
							|  |  |  |     Chaos generates the pool completely at random with rarer items having a slight cap to prevent this option being too easy.<br> | 
					
						
							|  |  |  |     No Scraps removes all scrap items from the item pool.<br> | 
					
						
							| 
									
										
										
										
											2021-10-04 22:28:40 -05:00
										 |  |  |     Even generates the item pool with every item having an even weight.<br> | 
					
						
							|  |  |  |     Scraps Only will be only scrap items in the item pool."""
 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     displayname = "Item Weights" | 
					
						
							|  |  |  |     option_default = 0 | 
					
						
							|  |  |  |     option_new = 1 | 
					
						
							|  |  |  |     option_uncommon = 2 | 
					
						
							|  |  |  |     option_legendary = 3 | 
					
						
							|  |  |  |     option_lunartic = 4 | 
					
						
							|  |  |  |     option_chaos = 5 | 
					
						
							|  |  |  |     option_no_scraps = 6 | 
					
						
							|  |  |  |     option_even = 7 | 
					
						
							| 
									
										
										
										
											2021-10-04 22:28:40 -05:00
										 |  |  |     option_scraps_only = 8 | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define a dictionary for the weights of the generated item pool. | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  | ror2_weights: typing.Dict[str, type(Option)] = { | 
					
						
							|  |  |  |     "green_scrap":          GreenScrap, | 
					
						
							|  |  |  |     "red_scrap":            RedScrap, | 
					
						
							|  |  |  |     "yellow_scrap":         YellowScrap, | 
					
						
							|  |  |  |     "white_scrap":          WhiteScrap, | 
					
						
							|  |  |  |     "common_item":          CommonItem, | 
					
						
							|  |  |  |     "uncommon_item":        UncommonItem, | 
					
						
							|  |  |  |     "legendary_item":       LegendaryItem, | 
					
						
							|  |  |  |     "boss_item":            BossItem, | 
					
						
							|  |  |  |     "lunar_item":           LunarItem, | 
					
						
							|  |  |  |     "equipment":            Equipment | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 14:02:02 -04:00
										 |  |  | ror2_options: typing.Dict[str, type(Option)] = { | 
					
						
							|  |  |  |     "total_locations":      TotalLocations, | 
					
						
							|  |  |  |     "total_revivals":       TotalRevivals, | 
					
						
							|  |  |  |     "start_with_revive":    StartWithRevive, | 
					
						
							| 
									
										
										
										
											2021-08-31 20:38:44 -04:00
										 |  |  |     "item_pickup_step":     ItemPickupStep, | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  |     "enable_lunar":         AllowLunarItems, | 
					
						
							| 
									
										
										
										
											2021-09-07 17:14:20 -05:00
										 |  |  |     "item_weights":         ItemWeights, | 
					
						
							|  |  |  |     "item_pool_presets":    ItemPoolPresetToggle, | 
					
						
							| 
									
										
										
										
											2021-09-06 23:40:39 -05:00
										 |  |  |     **ror2_weights | 
					
						
							|  |  |  | } |