Skip to content

Commit

Permalink
Logic fixes and invalid level up rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
gaithern committed Jan 3, 2024
1 parent d1670d5 commit 7aebfbc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions worlds/kh1/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ def get_items_by_category(category: str, disclude: list) -> Dict[str, KH1ItemDat
"Max AP Increase": KH1ItemData("Level Up", code = 264_4003, classification = ItemClassification.useful, max_quantity = 15, weight = 10),
"Strength Increase": KH1ItemData("Level Up", code = 264_4004, classification = ItemClassification.useful, max_quantity = 15, weight = 10),
"Defense Increase": KH1ItemData("Level Up", code = 264_4005, classification = ItemClassification.useful, max_quantity = 15, weight = 10),
"Accessory Slot Increase": KH1ItemData("Level Up", code = 264_4006, classification = ItemClassification.useful, max_quantity = 15, weight = 10),
"Item Slot Increase": KH1ItemData("Level Up", code = 264_4007, classification = ItemClassification.useful, max_quantity = 15, weight = 10),
"Accessory Slot Increase": KH1ItemData("Limited Level Up", code = 264_4006, classification = ItemClassification.useful, max_quantity = 15, weight = 10),
"Item Slot Increase": KH1ItemData("Limited Level Up", code = 264_4007, classification = ItemClassification.useful, max_quantity = 15, weight = 10),
"Dumbo": KH1ItemData("Summons", code = 264_5000, classification = ItemClassification.useful, max_quantity = 1, weight = 10),
"Bambi": KH1ItemData("Summons", code = 264_5001, classification = ItemClassification.useful, max_quantity = 1, weight = 10),
"Genie": KH1ItemData("Summons", code = 264_5002, classification = ItemClassification.useful, max_quantity = 1, weight = 10),
Expand Down
6 changes: 3 additions & 3 deletions worlds/kh1/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def set_rules(multiworld: MultiWorld, player: int):
multiworld.get_location("Traverse Town Geppetto's House Chest" , player).access_rule = lambda state: has_item(state, player, "Monstro") and has_item(state, player, "High Jump")
multiworld.get_location("Traverse Town Item Workshop Right Chest" , player).access_rule = lambda state: has_item(state, player, "Green Trinity")
multiworld.get_location("Traverse Town 1st District Blue Trinity Balcony Chest" , player).access_rule = lambda state: has_item(state, player, "Blue Trinity")
multiworld.get_location("Traverse Town Mystical House Glide Chest" , player).access_rule = lambda state: has_item(state, player, "Glide") and has_item(state, player, "Progressive Fire")
multiworld.get_location("Traverse Town Mystical House Glide Chest" , player).access_rule = lambda state: can_glide(state, player) and has_item(state, player, "Progressive Fire")
multiworld.get_location("Traverse Town Alleyway Behind Crates Chest" , player).access_rule = lambda state: has_item(state, player, "Red Trinity")
multiworld.get_location("Traverse Town Item Workshop Left Chest" , player).access_rule = lambda state: has_item(state, player, "Green Trinity")
#multiworld.get_location("Traverse Town Secret Waterway Near Stairs Chest" , player).access_rule = lambda state: has_item(state, player, "Red Trinity")
Expand Down Expand Up @@ -163,7 +163,7 @@ def set_rules(multiworld: MultiWorld, player: int):
multiworld.get_location("Halloween Town Moonlight Hill White Trinity Chest" , player).access_rule = lambda state: has_item(state, player, "White Trinity")
multiworld.get_location("Halloween Town Bridge Under Bridge" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box")
#multiworld.get_location("Halloween Town Boneyard Tombstone Puzzle Chest" , player).access_rule = lambda state: has_item(state, player, "")
multiworld.get_location("Halloween Town Bridge Right of Gate Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box")
multiworld.get_location("Halloween Town Bridge Right of Gate Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box") and can_glide(state, player)
multiworld.get_location("Halloween Town Cemetary Behind Grave Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box") and has_item(state, player, "Progressive Fire")
multiworld.get_location("Halloween Town Cemetary By Cat Shape Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box") and has_item(state, player, "Progressive Fire")
multiworld.get_location("Halloween Town Cemetary Between Graves Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box") and has_item(state, player, "Progressive Fire")
Expand All @@ -175,7 +175,7 @@ def set_rules(multiworld: MultiWorld, player: int):
multiworld.get_location("Halloween Town Guillotine Square Pumpkin Structure Left Chest" , player).access_rule = lambda state: has_item(state, player, "High Jump") and can_glide(state, player)
multiworld.get_location("Halloween Town Oogie's Manor Entrance Steps Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box")
multiworld.get_location("Halloween Town Oogie's Manor Inside Entrance Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box")
multiworld.get_location("Halloween Town Bridge Left of Gate Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box")
multiworld.get_location("Halloween Town Bridge Left of Gate Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box") and can_glide(state, player)
multiworld.get_location("Halloween Town Cemetary By Striped Grave Chest" , player).access_rule = lambda state: has_item(state, player, "Jack-In-The-Box") and has_item(state, player, "Progressive Fire")
#multiworld.get_location("Halloween Town Guillotine Square Under Jack's House Stairs Chest" , player).access_rule = lambda state: has_item(state, player, "")
multiworld.get_location("Halloween Town Guillotine Square Pumpkin Structure Right Chest" , player).access_rule = lambda state: has_item(state, player, "High Jump") and can_glide(state, player)
Expand Down
13 changes: 12 additions & 1 deletion worlds/kh1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,20 @@ def create_items(self):
item_pool: List[KH1Item] = []
level_up_locations = list(get_locations_by_category("Levels").keys())
level_up_rewards = list(get_items_by_category("Level Up", []).keys())
level_up_item_pool = []
i = 0
while i < 100:
self.multiworld.get_location(level_up_locations[i], self.player).place_locked_item(self.create_item(random.choice(level_up_rewards)))
if i < 8:
level_up_item_pool.append("Accessory Slot Increase")
elif i < 15:
level_up_item_pool.append("Item Slot Increase")
else:
level_up_item_pool.append(random.choice(level_up_rewards))
i = i + 1
random.shuffle(level_up_item_pool)
i = 0
while i < 100:
self.multiworld.get_location(level_up_locations[i], self.player).place_locked_item(self.create_item(level_up_item_pool[i]))
i = i + 1
self.multiworld.get_location("End of the World Final Rest Chest", self.player).place_locked_item(self.create_item("Victory"))
total_locations = len(self.multiworld.get_unfilled_locations(self.player))
Expand Down

0 comments on commit 7aebfbc

Please sign in to comment.