Skip to content

Commit

Permalink
fix generation
Browse files Browse the repository at this point in the history
  • Loading branch information
gaithern committed Jul 22, 2024
1 parent 4793306 commit e17630a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
6 changes: 3 additions & 3 deletions worlds/khbbs/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def get_items_by_category(category: str, exclude: list, characters: list) -> Dic
"Once More": KHBBSItemData("Ability", code = 227_0030027, classification = ItemClassification.useful, characters = "TVA", max_quantity = 1),
#"Scan": KHBBSItemData("Ability", code = 227_0030028, classification = ItemClassification.useful, characters = "TVA", max_quantity = 1),
"Leaf Bracer": KHBBSItemData("Ability", code = 227_0030029, classification = ItemClassification.useful, characters = "TVA", max_quantity = 1),
"(V) Wayward Wind": KHBBSItemData("Key Item", code = 227_0040001, classification = ItemClassification.useful, characters = " V ", max_quantity = 1, khbbsid = "0001"),
#"(V) Wayward Wind": KHBBSItemData("Key Item", code = 227_0040001, classification = ItemClassification.useful, characters = " V ", max_quantity = 1, khbbsid = "0001"),
"(V) Treasure Trove": KHBBSItemData("Key Item", code = 227_0040002, classification = ItemClassification.useful, characters = " V ", max_quantity = 1, khbbsid = "0002"),
"(V) Stroke of Midnight": KHBBSItemData("Key Item", code = 227_0040003, classification = ItemClassification.useful, characters = " V ", max_quantity = 1, khbbsid = "0003"),
"(V) Fairy Stars": KHBBSItemData("Key Item", code = 227_0040004, classification = ItemClassification.useful, characters = " V ", max_quantity = 1, khbbsid = "0004"),
Expand All @@ -303,7 +303,7 @@ def get_items_by_category(category: str, exclude: list, characters: list) -> Dic
"(V) Void Gear": KHBBSItemData("Key Item", code = 227_0040016, classification = ItemClassification.useful, characters = " V ", max_quantity = 1, khbbsid = "0010"),
"(V) No Name": KHBBSItemData("Key Item", code = 227_0040017, classification = ItemClassification.useful, characters = " V ", max_quantity = 1, khbbsid = "0011"),
"(V) Royal Radiance": KHBBSItemData("Key Item", code = 227_0040018, classification = ItemClassification.useful, characters = " V ", max_quantity = 1, khbbsid = "0012"),
"(T) Earthshaker": KHBBSItemData("Key Item", code = 227_0040256, classification = ItemClassification.useful, characters = "T ", max_quantity = 1, khbbsid = "0100"),
#"(T) Earthshaker": KHBBSItemData("Key Item", code = 227_0040256, classification = ItemClassification.useful, characters = "T ", max_quantity = 1, khbbsid = "0100"),
"(T) Treasure Trove": KHBBSItemData("Key Item", code = 227_0040257, classification = ItemClassification.useful, characters = "T ", max_quantity = 1, khbbsid = "0101"),
"(T) Stroke of Midnight": KHBBSItemData("Key Item", code = 227_0040258, classification = ItemClassification.useful, characters = "T ", max_quantity = 1, khbbsid = "0102"),
"(T) Fairy Stars": KHBBSItemData("Key Item", code = 227_0040259, classification = ItemClassification.useful, characters = "T ", max_quantity = 1, khbbsid = "0103"),
Expand All @@ -319,7 +319,7 @@ def get_items_by_category(category: str, exclude: list, characters: list) -> Dic
"(T) Void Gear": KHBBSItemData("Key Item", code = 227_0040272, classification = ItemClassification.useful, characters = "T ", max_quantity = 1, khbbsid = "0110"),
"(T) No Name": KHBBSItemData("Key Item", code = 227_0040273, classification = ItemClassification.useful, characters = "T ", max_quantity = 1, khbbsid = "0111"),
"(T) Royal Radiance": KHBBSItemData("Key Item", code = 227_0040274, classification = ItemClassification.useful, characters = "T ", max_quantity = 1, khbbsid = "0112"),
"(A) Rainfell": KHBBSItemData("Key Item", code = 227_0040512, classification = ItemClassification.useful, characters = " A", max_quantity = 1, khbbsid = "0200"),
#"(A) Rainfell": KHBBSItemData("Key Item", code = 227_0040512, classification = ItemClassification.useful, characters = " A", max_quantity = 1, khbbsid = "0200"),
"(A) Treasure Trove": KHBBSItemData("Key Item", code = 227_0040513, classification = ItemClassification.useful, characters = " A", max_quantity = 1, khbbsid = "0201"),
"(A) Stroke of Midnight": KHBBSItemData("Key Item", code = 227_0040514, classification = ItemClassification.useful, characters = " A", max_quantity = 1, khbbsid = "0202"),
"(A) Fairy Stars": KHBBSItemData("Key Item", code = 227_0040515, classification = ItemClassification.useful, characters = " A", max_quantity = 1, khbbsid = "0203"),
Expand Down
28 changes: 14 additions & 14 deletions worlds/khbbs/OpenKH.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,31 +113,31 @@ def get_sticker_replace(self):
replace_stickers_str = ""
for location in self.multiworld.get_filled_locations(self.player):
location_data = location_table[location.name]
item_data = item_table[location.item.name]
if location_data.type == "Sticker":
write_value = "00000"
replace_stickers_str = replace_stickers_str + (" " * 6) + "WriteInt(field_item_address_pointer + (" + str(location_data.offset) + "), 0x"
if item_data.category == "Key Item":
write_value = get_world_offset(location_data.category) + item_data.khbbsid
else:
write_value = "00000"
if self.player == location.item.player:
item_data = item_table[location.item.name]
if item_data.category == "Key Item":
write_value = get_world_offset(location_data.category) + item_data.khbbsid
replace_stickers_str = replace_stickers_str + write_value + ", true)\n"
return replace_stickers_str

def get_chest_replace(self):
replace_chests_str = ""
for location in self.multiworld.get_filled_locations(self.player):
location_data = location_table[location.name]
item_data = item_table[location.item.name]
if location_data.type == "Chest":
write_value = "0000000"
replace_chests_str = replace_chests_str + (" " * 6) + "WriteInt(field_item_address_pointer + (" + str(location_data.offset) + "), 0x"
if item_data.category in ["Attack Command", "Magic Command", "Item Command", "Friendship Command", "Movement Command", "Defense Command", "Reprisal Command", "Shotlock Command"] and not location_data.forced_remote:
item_prefix = "01"
write_value = get_world_offset(location_data.category) + item_prefix + item_data.khbbsid
elif item_data.category in ["Key Item"] and not location_data.forced_remote:
item_prefix = "00"
write_value = get_world_offset(location_data.category) + item_prefix + item_data.khbbsid
else:
write_value = "0000000"
if self.player == location.item.player:
item_data = item_table[location.item.name]
if item_data.category in ["Attack Command", "Magic Command", "Item Command", "Friendship Command", "Movement Command", "Defense Command", "Reprisal Command", "Shotlock Command"] and not location_data.forced_remote:
item_prefix = "01"
write_value = get_world_offset(location_data.category) + item_prefix + item_data.khbbsid
elif item_data.category in ["Key Item"] and not location_data.forced_remote:
item_prefix = "00"
write_value = get_world_offset(location_data.category) + item_prefix + item_data.khbbsid
replace_chests_str = replace_chests_str + write_value + ", true)\n"
return replace_chests_str

Expand Down
17 changes: 9 additions & 8 deletions worlds/khbbs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def create_items(self):
#Handle starting worlds
starting_worlds = []
if self.options.starting_worlds > 0:
possible_starting_worlds = ["The Land of Departure", "Dwarf Woodlands",
possible_starting_worlds = ["Dwarf Woodlands",
"Castle of Dreams", "Enchanted Dominion", "The Mysterious Tower",
"Radiant Garden", "Olympus Coliseum", "Deep Space",
"Never Land", "Disney Town"]
Expand Down Expand Up @@ -139,11 +139,12 @@ def get_non_remote_location_ids(self):
non_remote_location_ids = []
for location in self.multiworld.get_filled_locations(self.player):
location_data = location_table[location.name]
item_data = item_table[location.item.name]
if location_data.type == "Chest":
if item_data.category in ["Attack Command", "Magic Command", "Item Command", "Friendship Command", "Movement Command", "Defense Command", "Reprisal Command", "Shotlock Command", "Key Item"] and not location_data.forced_remote:
non_remote_location_ids.append(location_data.code)
if location_data.type == "Sticker":
if item_data.category in ["Key Item"]:
non_remote_location_ids.append(location_data.code)
if self.player == location.item.player:
item_data = item_table[location.item.name]
if location_data.type == "Chest":
if item_data.category in ["Attack Command", "Magic Command", "Item Command", "Friendship Command", "Movement Command", "Defense Command", "Reprisal Command", "Shotlock Command", "Key Item"] and not location_data.forced_remote:
non_remote_location_ids.append(location_data.code)
if location_data.type == "Sticker":
if item_data.category in ["Key Item"]:
non_remote_location_ids.append(location_data.code)
return non_remote_location_ids

0 comments on commit e17630a

Please sign in to comment.