Skip to content

Commit

Permalink
Big update
Browse files Browse the repository at this point in the history
  • Loading branch information
gaithern committed Aug 21, 2024
1 parent b90f7fd commit ccb81f2
Show file tree
Hide file tree
Showing 6 changed files with 512 additions and 241 deletions.
27 changes: 11 additions & 16 deletions worlds/khbbs/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,24 @@ class KHBBSItem(Item):
class KHBBSItemData(NamedTuple):
category: str
sub: str = "None"
code: Optional[int] = None
code: int = 0
classification: ItemClassification = ItemClassification.filler
max_quantity: int = 1
weight: int = 1
characters: str = "TVA"
khbbsid: str = None


def get_items_by_category(category: str, exclude: list, characters: list) -> Dict[str, KHBBSItemData]:
def get_items_by_category(category: str, character: str) -> Dict[str, KHBBSItemData]:

item_dict: Dict[str, KHBBSItemData] = {}
for name, data in item_table.items():
add = False
if data.category == category and all(x not in name for x in exclude):
for character in characters:
if character in data.characters:
add = True
if add:
if data.category == category:
if character in data.characters:
item_dict.setdefault(name, data)
return item_dict

item_table: Dict[str, KHBBSItemData] = {
"Victory": KHBBSItemData("Victory", code = 227_0000000, classification = ItemClassification.progression, characters = "TVA", max_quantity = 1),
"Victory": KHBBSItemData("VIC", code = 227_0000000, classification = ItemClassification.progression, characters = "TVA", max_quantity = 1),
"Quick Blitz": KHBBSItemData("Attack Command", code = 227_0010000, classification = ItemClassification.filler, characters = "TVA", khbbsid = "005B"),
"Blitz": KHBBSItemData("Attack Command", code = 227_0010001, classification = ItemClassification.filler, characters = "TVA", khbbsid = "005C"),
"Magic Hour": KHBBSItemData("Attack Command", code = 227_0010002, classification = ItemClassification.filler, characters = " A", khbbsid = "005D"),
Expand Down Expand Up @@ -130,15 +125,15 @@ def get_items_by_category(category: str, exclude: list, characters: list) -> Dic
"Stopra": KHBBSItemData("Magic Command", code = 227_0010094, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00B9"),
"Stopga": KHBBSItemData("Magic Command", code = 227_0010095, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00BA"),
"Sleep": KHBBSItemData("Magic Command", code = 227_0010096, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00BB"),
"Potion": KHBBSItemData("Item Command", code = 227_0010097, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00BC"),
"Hi-Potion": KHBBSItemData("Item Command", code = 227_0010098, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00BD"),
#"Potion": KHBBSItemData("Item Command", code = 227_0010097, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00BC"),
#"Hi-Potion": KHBBSItemData("Item Command", code = 227_0010098, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00BD"),
"Mega-Potion": KHBBSItemData("Item Command", code = 227_0010099, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00BE"),
"Ether": KHBBSItemData("Item Command", code = 227_0010100, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00BF"),
#"Ether": KHBBSItemData("Item Command", code = 227_0010100, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00BF"),
"Mega-Ether": KHBBSItemData("Item Command", code = 227_0010101, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00C0"),
"Panacea": KHBBSItemData("Item Command", code = 227_0010102, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00C1"),
#"Panacea": KHBBSItemData("Item Command", code = 227_0010102, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00C1"),
"Elixir": KHBBSItemData("Item Command", code = 227_0010103, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00C2"),
"Megalixir": KHBBSItemData("Item Command", code = 227_0010104, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00C3"),
"Balloon Letter": KHBBSItemData("Item Command", code = 227_0010105, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00C4"),
#"Balloon Letter": KHBBSItemData("Item Command", code = 227_0010105, classification = ItemClassification.filler, characters = "TVA", khbbsid = "00C4"),
#"Vanilla Glitz": KHBBSItemData("Item Command", code = 227_0010106, classification = ItemClassification.filler, characters = "T ", khbbsid = "00C5"),
#"Fabracadabra": KHBBSItemData("Item Command", code = 227_0010107, classification = ItemClassification.filler, characters = " A", khbbsid = "00C6"),
#"Honeybunny": KHBBSItemData("Item Command", code = 227_0010108, classification = ItemClassification.filler, characters = " V ", khbbsid = "00C7"),
Expand Down Expand Up @@ -352,7 +347,7 @@ def get_items_by_category(category: str, exclude: list, characters: list) -> Dic
"Never Land": KHBBSItemData("World", code = 227_0050010, classification = ItemClassification.progression, characters = "TVA", max_quantity = 1),
"Disney Town": KHBBSItemData("World", code = 227_0050011, classification = ItemClassification.progression, characters = "TVA", max_quantity = 1),
#"The Keyblade Graveyard": KHBBSItemData("World", code = 227_0050012, classification = ItemClassification.progression, characters = "TVA", max_quantity = 1),
"HP Increase": KHBBSItemData("Stat Up", code = 227_0060000, classification = ItemClassification.useful, characters = "TVA", max_quantity = 8),
"HP Increase": KHBBSItemData("Stat Up", code = 227_0060000, classification = ItemClassification.useful, characters = "TVA"),
"Deck Capacity Increase": KHBBSItemData("Stat Up", code = 227_0060001, classification = ItemClassification.useful, characters = "TVA", max_quantity = 5),
"Mickey D-Link": KHBBSItemData("D-Link", code = 227_0070000, classification = ItemClassification.useful, characters = " VA", max_quantity = 1),
"Donald D-Link": KHBBSItemData("D-Link", code = 227_0070001, classification = ItemClassification.useful, characters = " VA", max_quantity = 1),
Expand Down
2 changes: 1 addition & 1 deletion worlds/khbbs/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class KHBBSLocation(Location):
class KHBBSLocationData(NamedTuple):
category: str
type: str
code: Optional[int] = None
code: int
offset: str = None
forced_remote: bool = False

Expand Down
4 changes: 2 additions & 2 deletions worlds/khbbs/OpenKH.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ def get_chest_replace(self):
replace_chests_str = replace_chests_str + (" " * 7) + "WriteInt(field_item_address_pointer + (" + str(location_data.offset) + "), 0x"
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:
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 and "Wayfinder" not in location.item.name:
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:
elif item_data.category in ["Key Item"] and not location_data.forced_remote and "Wayfinder" not in location.item.name:
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"
Expand Down
16 changes: 13 additions & 3 deletions worlds/khbbs/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class EXPMultiplier(NamedRange):
"""
display_name = "EXP Multiplier"
default = 16
range_start = default / 4
range_start = default // 4
range_end = 160
special_range_names = {
"0.25x": default / 4,
"0.5x": default / 2,
"0.25x": default // 4,
"0.5x": default // 2,
"1x": default,
"2x": default * 2,
"3x": default * 3,
Expand Down Expand Up @@ -72,6 +72,15 @@ class SuperBosses(Toggle):
"""
display_name = "Super Bosses"

class MaxHPIncreases(Range):
"""
Number of Max HP Increases are in the item pool.
"""
display_name = "Max HP Increases"
default = 8
range_start = 0
range_end = 9

@dataclass
class KHBBSOptions(PerGameCommonOptions):
character: Character
Expand All @@ -81,3 +90,4 @@ class KHBBSOptions(PerGameCommonOptions):
mirage_arena: MirageArena
command_board: CommandBoard
super_bosses: SuperBosses
max_hp_increases: MaxHPIncreases
Loading

0 comments on commit ccb81f2

Please sign in to comment.