| 
									
										
										
										
											2022-04-01 03:23:52 +02:00
										 |  |  | from typing import Dict, Set, NamedTuple | 
					
						
							|  |  |  | from .ExtractedData import items, logic_items, item_effects | 
					
						
							| 
									
										
										
										
											2021-02-21 20:17:24 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-01 03:23:52 +02:00
										 |  |  | item_table = {} | 
					
						
							| 
									
										
										
										
											2021-02-24 06:02:51 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-01 03:23:52 +02:00
										 |  |  | class HKItemData(NamedTuple): | 
					
						
							|  |  |  |     advancement: bool | 
					
						
							|  |  |  |     id: int | 
					
						
							|  |  |  |     type: str | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | for i, (item_name, item_type) in enumerate(items.items(), start=0x1000000): | 
					
						
							|  |  |  |     item_table[item_name] = HKItemData(advancement=item_name in logic_items or item_name in item_effects, | 
					
						
							|  |  |  |                                        id=i, type=item_type) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | lookup_id_to_name: Dict[int, str] = {data.id: item_name for item_name, data in item_table.items()} | 
					
						
							|  |  |  | lookup_type_to_names: Dict[str, Set[str]] = {} | 
					
						
							| 
									
										
										
										
											2021-02-26 21:03:16 +01:00
										 |  |  | for item, item_data in item_table.items(): | 
					
						
							| 
									
										
										
										
											2022-04-01 03:23:52 +02:00
										 |  |  |     lookup_type_to_names.setdefault(item_data.type, set()).add(item) | 
					
						
							| 
									
										
										
										
											2022-04-04 00:15:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Hollow Knight updates (goals, WP/POP, etc.) (#438)
* Hollow Knight updates:
- Add configurable goals (Any, THK, Siblings, Radiance)
  - Change base logic to require Opened_Black_Egg_Temple instead of
    requiring 3 dreamers.  This is future-proof for transition rando,
    where Black Egg might not have been located yet.
  - Add combat logic for THK and Radiance on par with Rando4's boss logic,
    so itemless HK shouldn't be required.
- Existing completion logic now uses Black_Egg_te
- Add White Palace options
  (Exclude, King Fragment Only, No Path of Pain, Include)
  - Excluded WP may still be required for King Fragment if Charms are
    not randomized
  - Simply don't place WP locations that are excluded
  - Distinguish between POP locations (required for POP), WP checks (
    actual item locations), WP transitions (relevant for future transition
    rando), and WP events (logically required to reach King Fragment)
  - Many transitions were listed twice.  Remove duplicates.
  - Sort transitions by scene
- For randomizable locations that have no logical significance when not
    randomized, simply skip adding them to the pool entirely for
    theoretically faster generation.
* Hollow Knight updates
  - Support random starting geo up to 1000 geo.
  - Always include locations rather than dropping unrandomized "logicless"
    ones, as it is required to best support same-slot coop.
											
										 
											2022-06-12 23:23:03 -07:00
										 |  |  | directionals = ('', 'Left_', 'Right_') | 
					
						
							| 
									
										
										
										
											2023-10-28 05:30:18 -06:00
										 |  |  | item_name_groups = ({ | 
					
						
							|  |  |  |     "BossEssence": lookup_type_to_names["DreamWarrior"] | lookup_type_to_names["DreamBoss"], | 
					
						
							|  |  |  |     "BossGeo": lookup_type_to_names["Boss_Geo"], | 
					
						
							|  |  |  |     "CDash": {x + "Crystal_Heart" for x in directionals}, | 
					
						
							|  |  |  |     "Charms": lookup_type_to_names["Charm"], | 
					
						
							|  |  |  |     "CharmNotches": lookup_type_to_names["Notch"], | 
					
						
							|  |  |  |     "Claw": {x + "Mantis_Claw" for x in directionals}, | 
					
						
							|  |  |  |     "Cloak": {x + "Mothwing_Cloak" for x in directionals} | {"Shade_Cloak", "Split_Shade_Cloak"}, | 
					
						
							|  |  |  |     "Dive": {"Desolate_Dive", "Descending_Dark"}, | 
					
						
							|  |  |  |     "LifebloodCocoons": lookup_type_to_names["Cocoon"], | 
					
						
							| 
									
										
										
										
											2023-01-18 15:45:48 +01:00
										 |  |  |     "Dreamers": {"Herrah", "Monomon", "Lurien"}, | 
					
						
							| 
									
										
										
										
											2023-10-28 05:30:18 -06:00
										 |  |  |     "Fireball": {"Vengeful_Spirit", "Shade_Soul"}, | 
					
						
							|  |  |  |     "GeoChests": lookup_type_to_names["Geo"], | 
					
						
							|  |  |  |     "GeoRocks": lookup_type_to_names["Rock"], | 
					
						
							|  |  |  |     "GrimmkinFlames": lookup_type_to_names["Flame"], | 
					
						
							| 
									
										
										
										
											2024-03-13 06:45:43 -05:00
										 |  |  |     "Grimmchild": {"Grimmchild1", "Grimmchild2"}, | 
					
						
							| 
									
										
										
										
											2023-10-28 05:30:18 -06:00
										 |  |  |     "Grubs": lookup_type_to_names["Grub"], | 
					
						
							|  |  |  |     "JournalEntries": lookup_type_to_names["Journal"], | 
					
						
							|  |  |  |     "JunkPitChests": lookup_type_to_names["JunkPitChest"], | 
					
						
							|  |  |  |     "Keys": lookup_type_to_names["Key"], | 
					
						
							|  |  |  |     "LoreTablets": lookup_type_to_names["Lore"] | lookup_type_to_names["PalaceLore"], | 
					
						
							|  |  |  |     "Maps": lookup_type_to_names["Map"], | 
					
						
							|  |  |  |     "MaskShards": lookup_type_to_names["Mask"], | 
					
						
							|  |  |  |     "Mimics": lookup_type_to_names["Mimic"], | 
					
						
							|  |  |  |     "Nail": lookup_type_to_names["CursedNail"], | 
					
						
							|  |  |  |     "PalaceJournal": {"Journal_Entry-Seal_of_Binding"}, | 
					
						
							|  |  |  |     "PalaceLore": lookup_type_to_names["PalaceLore"], | 
					
						
							|  |  |  |     "PalaceTotem": {"Soul_Totem-Palace", "Soul_Totem-Path_of_Pain"}, | 
					
						
							|  |  |  |     "RancidEggs": lookup_type_to_names["Egg"], | 
					
						
							|  |  |  |     "Relics": lookup_type_to_names["Relic"], | 
					
						
							|  |  |  |     "Scream": {"Howling_Wraiths", "Abyss_Shriek"}, | 
					
						
							|  |  |  |     "Skills": lookup_type_to_names["Skill"], | 
					
						
							|  |  |  |     "SoulTotems": lookup_type_to_names["Soul"], | 
					
						
							|  |  |  |     "Stags": lookup_type_to_names["Stag"], | 
					
						
							|  |  |  |     "VesselFragments": lookup_type_to_names["Vessel"], | 
					
						
							|  |  |  |     "WhisperingRoots": lookup_type_to_names["Root"], | 
					
						
							|  |  |  |     "WhiteFragments": {"Queen_Fragment", "King_Fragment", "Void_Heart"}, | 
					
						
							| 
									
										
											  
											
												Hollow Knight updates (goals, WP/POP, etc.) (#438)
* Hollow Knight updates:
- Add configurable goals (Any, THK, Siblings, Radiance)
  - Change base logic to require Opened_Black_Egg_Temple instead of
    requiring 3 dreamers.  This is future-proof for transition rando,
    where Black Egg might not have been located yet.
  - Add combat logic for THK and Radiance on par with Rando4's boss logic,
    so itemless HK shouldn't be required.
- Existing completion logic now uses Black_Egg_te
- Add White Palace options
  (Exclude, King Fragment Only, No Path of Pain, Include)
  - Excluded WP may still be required for King Fragment if Charms are
    not randomized
  - Simply don't place WP locations that are excluded
  - Distinguish between POP locations (required for POP), WP checks (
    actual item locations), WP transitions (relevant for future transition
    rando), and WP events (logically required to reach King Fragment)
  - Many transitions were listed twice.  Remove duplicates.
  - Sort transitions by scene
- For randomizable locations that have no logical significance when not
    randomized, simply skip adding them to the pool entirely for
    theoretically faster generation.
* Hollow Knight updates
  - Support random starting geo up to 1000 geo.
  - Always include locations rather than dropping unrandomized "logicless"
    ones, as it is required to best support same-slot coop.
											
										 
											2022-06-12 23:23:03 -07:00
										 |  |  | }) | 
					
						
							|  |  |  | item_name_groups['Horizontal'] = item_name_groups['Cloak'] | item_name_groups['CDash'] | 
					
						
							|  |  |  | item_name_groups['Vertical'] = item_name_groups['Claw'] | {'Monarch_Wings'} |