Skip to content

Commit

Permalink
lufia2ac: use an appropriate dungeon sprite and battle theme for each…
Browse files Browse the repository at this point in the history
  • Loading branch information
el-u authored Jun 30, 2023
1 parent 7ecb1e6 commit 51a639c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions worlds/lufia2ac/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,39 @@ class Boss(RandomGroupsChoice):
option_master = 0x26
default = option_master

_sprite: Dict[int, int] = {
option_lizard_man: 0x9E,
option_big_catfish: 0xC5,
option_regal_goblin: 0x9D,
option_follower_x2: 0x76,
option_camu: 0x75,
option_tarantula: 0xC6,
option_pierre: 0x77,
option_daniele: 0x78,
option_gades_a: 0x7A,
option_mummy_x4: 0xA8,
option_troll_x3: 0xA9,
option_gades_b: 0x7A,
option_idura_a: 0x74,
option_lion_x2: 0xB7,
option_idura_b: 0x74,
option_idura_c: 0x74,
option_rogue_flower: 0x96,
option_soldier_x4: 0x18,
option_gargoyle_x4: 0xC4,
option_venge_ghost: 0xD0,
option_white_dragon_x3: 0xC3,
option_fire_dragon: 0xC0,
option_ghost_ship: 0xC8,
option_tank: 0xC7,
option_gades_c: 0x7A,
option_amon: 0x79,
option_erim: 0x38,
option_daos: 0x7B,
option_egg_dragon: 0xC0,
option_master: 0x94,
}

random_groups = {
"random-low": ["lizard_man", "big_catfish", "regal_goblin", "follower_x2", "camu", "tarantula", "pierre",
"daniele", "mummy_x4", "troll_x3"],
Expand All @@ -187,6 +220,15 @@ class Boss(RandomGroupsChoice):
def flag(self) -> int:
return 0xFE if self.value == Boss.option_master else 0xFF

@property
def music(self) -> int:
return 0x1B if self.value in {Boss.option_master, Boss.option_gades_a, Boss.option_gades_b, Boss.option_gades_c,
Boss.option_amon, Boss.option_erim, Boss.option_daos} else 0x19

@property
def sprite(self) -> int:
return Boss._sprite[self.value]


class CapsuleCravingsJPStyle(Toggle):
"""Make capsule monster cravings behave as in the Japanese version.
Expand Down
2 changes: 2 additions & 0 deletions worlds/lufia2ac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ def generate_output(self, output_directory: str) -> None:
rom_bytearray[offset:offset + 1] = self.o.party_starting_level.value.to_bytes(1, "little")
for offset in range(0x02B39A, 0x02B457, 0x1B):
rom_bytearray[offset:offset + 3] = self.o.party_starting_level.xp.to_bytes(3, "little")
rom_bytearray[0x03AE49:0x03AE49 + 1] = self.o.boss.sprite.to_bytes(1, "little")
rom_bytearray[0x05699E:0x05699E + 147] = self.get_goal_text_bytes()
rom_bytearray[0x056AA3:0x056AA3 + 24] = self.o.default_party.event_script
rom_bytearray[0x072740:0x072740 + 1] = self.o.boss.music.to_bytes(1, "little")
rom_bytearray[0x072742:0x072742 + 1] = self.o.boss.value.to_bytes(1, "little")
rom_bytearray[0x072748:0x072748 + 1] = self.o.boss.flag.to_bytes(1, "little")
rom_bytearray[0x09D59B:0x09D59B + 256] = self.get_node_connection_table()
Expand Down

0 comments on commit 51a639c

Please sign in to comment.