TUNIC: Update victory condition (#3579)
* Add hero relics to victory condition * Update __init__.py * Remove unneeded local variables for options * Use has_group_unique * fix spacing
This commit is contained in:
		
							parent
							
								
									2424fb0c5b
								
							
						
					
					
						commit
						55cb81d487
					
				|  | @ -156,9 +156,6 @@ class TunicWorld(World): | |||
|         return TunicItem(name, item_data.classification, self.item_name_to_id[name], self.player) | ||||
| 
 | ||||
|     def create_items(self) -> None: | ||||
|         keys_behind_bosses = self.options.keys_behind_bosses | ||||
|         hexagon_quest = self.options.hexagon_quest | ||||
|         sword_progression = self.options.sword_progression | ||||
| 
 | ||||
|         tunic_items: List[TunicItem] = [] | ||||
|         self.slot_data_items = [] | ||||
|  | @ -172,7 +169,7 @@ class TunicWorld(World): | |||
|         if self.options.start_with_sword: | ||||
|             self.multiworld.push_precollected(self.create_item("Sword")) | ||||
| 
 | ||||
|         if sword_progression: | ||||
|         if self.options.sword_progression: | ||||
|             items_to_create["Stick"] = 0 | ||||
|             items_to_create["Sword"] = 0 | ||||
|         else: | ||||
|  | @ -189,9 +186,9 @@ class TunicWorld(World): | |||
|             self.slot_data_items.append(laurels) | ||||
|             items_to_create["Hero's Laurels"] = 0 | ||||
| 
 | ||||
|         if keys_behind_bosses: | ||||
|         if self.options.keys_behind_bosses: | ||||
|             for rgb_hexagon, location in hexagon_locations.items(): | ||||
|                 hex_item = self.create_item(gold_hexagon if hexagon_quest else rgb_hexagon) | ||||
|                 hex_item = self.create_item(gold_hexagon if self.options.hexagon_quest else rgb_hexagon) | ||||
|                 self.multiworld.get_location(location, self.player).place_locked_item(hex_item) | ||||
|                 self.slot_data_items.append(hex_item) | ||||
|                 items_to_create[rgb_hexagon] = 0 | ||||
|  | @ -222,7 +219,7 @@ class TunicWorld(World): | |||
|                     ladder_count += 1 | ||||
|             remove_filler(ladder_count) | ||||
| 
 | ||||
|         if hexagon_quest: | ||||
|         if self.options.hexagon_quest: | ||||
|             # Calculate number of hexagons in item pool | ||||
|             hexagon_goal = self.options.hexagon_goal | ||||
|             extra_hexagons = self.options.extra_hexagon_percentage | ||||
|  | @ -238,6 +235,18 @@ class TunicWorld(World): | |||
| 
 | ||||
|             remove_filler(items_to_create[gold_hexagon]) | ||||
| 
 | ||||
|             for hero_relic in item_name_groups["Hero Relics"]: | ||||
|                 relic_item = TunicItem(hero_relic, ItemClassification.useful, self.item_name_to_id[hero_relic], self.player) | ||||
|                 tunic_items.append(relic_item) | ||||
|                 items_to_create[hero_relic] = 0 | ||||
| 
 | ||||
|         if not self.options.ability_shuffling: | ||||
|             for page in item_name_groups["Abilities"]: | ||||
|                 if items_to_create[page] > 0: | ||||
|                     page_item = TunicItem(page, ItemClassification.useful, self.item_name_to_id[page], self.player) | ||||
|                     tunic_items.append(page_item) | ||||
|                     items_to_create[page] = 0 | ||||
| 
 | ||||
|         if self.options.maskless: | ||||
|             mask_item = TunicItem("Scavenger Mask", ItemClassification.useful, self.item_name_to_id["Scavenger Mask"], self.player) | ||||
|             tunic_items.append(mask_item) | ||||
|  |  | |||
|  | @ -991,7 +991,8 @@ def set_er_region_rules(world: "TunicWorld", ability_unlocks: Dict[str, int], re | |||
|         connecting_region=regions["Spirit Arena Victory"], | ||||
|         rule=lambda state: (state.has(gold_hexagon, player, world.options.hexagon_goal.value) if | ||||
|                             world.options.hexagon_quest else | ||||
|                             state.has_all({red_hexagon, green_hexagon, blue_hexagon, "Unseal the Heir"}, player))) | ||||
|                             (state.has_all({red_hexagon, green_hexagon, blue_hexagon, "Unseal the Heir"}, player) | ||||
|                             and state.has_group_unique("Hero Relics", player, 6)))) | ||||
| 
 | ||||
|     # connecting the regions portals are in to other portals you can access via ladder storage | ||||
|     # using has_stick instead of can_ladder_storage since it's already checking the logic rules | ||||
|  |  | |||
|  | @ -64,12 +64,12 @@ item_table: Dict[str, TunicItemData] = { | |||
|     "HP Offering": TunicItemData(ItemClassification.useful, 6, 48, "Offerings"), | ||||
|     "MP Offering": TunicItemData(ItemClassification.useful, 3, 49, "Offerings"), | ||||
|     "SP Offering": TunicItemData(ItemClassification.useful, 2, 50, "Offerings"), | ||||
|     "Hero Relic - ATT": TunicItemData(ItemClassification.useful, 1, 51, "Hero Relics"), | ||||
|     "Hero Relic - DEF": TunicItemData(ItemClassification.useful, 1, 52, "Hero Relics"), | ||||
|     "Hero Relic - HP": TunicItemData(ItemClassification.useful, 1, 53, "Hero Relics"), | ||||
|     "Hero Relic - MP": TunicItemData(ItemClassification.useful, 1, 54, "Hero Relics"), | ||||
|     "Hero Relic - POTION": TunicItemData(ItemClassification.useful, 1, 55, "Hero Relics"), | ||||
|     "Hero Relic - SP": TunicItemData(ItemClassification.useful, 1, 56, "Hero Relics"), | ||||
|     "Hero Relic - ATT": TunicItemData(ItemClassification.progression_skip_balancing, 1, 51, "Hero Relics"), | ||||
|     "Hero Relic - DEF": TunicItemData(ItemClassification.progression_skip_balancing, 1, 52, "Hero Relics"), | ||||
|     "Hero Relic - HP": TunicItemData(ItemClassification.progression_skip_balancing, 1, 53, "Hero Relics"), | ||||
|     "Hero Relic - MP": TunicItemData(ItemClassification.progression_skip_balancing, 1, 54, "Hero Relics"), | ||||
|     "Hero Relic - POTION": TunicItemData(ItemClassification.progression_skip_balancing, 1, 55, "Hero Relics"), | ||||
|     "Hero Relic - SP": TunicItemData(ItemClassification.progression_skip_balancing, 1, 56, "Hero Relics"), | ||||
|     "Orange Peril Ring": TunicItemData(ItemClassification.useful, 1, 57, "Cards"), | ||||
|     "Tincture": TunicItemData(ItemClassification.useful, 1, 58, "Cards"), | ||||
|     "Scavenger Mask": TunicItemData(ItemClassification.progression, 1, 59, "Cards"), | ||||
|  | @ -143,7 +143,6 @@ item_table: Dict[str, TunicItemData] = { | |||
|     "Pages 50-51": TunicItemData(ItemClassification.useful, 1, 127, "Pages"), | ||||
|     "Pages 52-53 (Icebolt)": TunicItemData(ItemClassification.progression, 1, 128, "Pages"), | ||||
|     "Pages 54-55": TunicItemData(ItemClassification.useful, 1, 129, "Pages"), | ||||
|      | ||||
|     "Ladders near Weathervane": TunicItemData(ItemClassification.progression, 0, 130, "Ladders"), | ||||
|     "Ladders near Overworld Checkpoint": TunicItemData(ItemClassification.progression, 0, 131, "Ladders"), | ||||
|     "Ladders near Patrol Cave": TunicItemData(ItemClassification.progression, 0, 132, "Ladders"), | ||||
|  |  | |||
|  | @ -128,7 +128,7 @@ def set_region_rules(world: "TunicWorld", ability_unlocks: Dict[str, int]) -> No | |||
|         or has_ice_grapple_logic(False, state, player, options, ability_unlocks) | ||||
|     multiworld.get_entrance("Overworld -> Spirit Arena", player).access_rule = \ | ||||
|         lambda state: (state.has(gold_hexagon, player, options.hexagon_goal.value) if options.hexagon_quest.value | ||||
|                        else state.has_all({red_hexagon, green_hexagon, blue_hexagon}, player)) and \ | ||||
|                        else state.has_all({red_hexagon, green_hexagon, blue_hexagon}, player) and state.has_group_unique("Hero Relics", player, 6)) and \ | ||||
|         has_ability(state, player, prayer, options, ability_unlocks) and has_sword(state, player) and \ | ||||
|         state.has_any({lantern, laurels}, player) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue