- Fixed unintentional button presses when leaving menus caused by Quality_of_Life\Run_After_Area_Change; hopefully no other side effects
- Added Miscellaneous\Wiggly_Balloons; makes balloons over balloon'd enemies wiggle the way balloons over balloon'd players wiggle
, in the case of Dark Funks, see the 0xC1 just before the "CastSpell" AI command (which is 3 bytes)? In the AI scripting, 0xC1 means "set spell_target to melee_target" and the melee_target was set earlier in the AI.
Following it is 0xC0, which means "clear spell_target".
The "CastSpell" AI command is 3 bytes. Using the Dark Funk as an example (0xE9 0x04 0x11):
- 0xE9 is the byte that means: "cast a spell, the next two bytes are arguments"
- 0x04, the second byte, is which animation to play
- 0x11 is which spell number to cast
- normal enemies have a "spell_target" while bosses use a different AI script format that specifies the target as part of their spell casting command
Anyway, 0xC4 should be "set spell_target to self", so with the Dark Funk as the example, if you changed the 0xC1 to 0xC4 (at $D05C9D, i.e. 0x105C9D as seen in the hex editor), the Dark Funk would cast that spell on itself.
The complication is if you want an enemy who normally casts a spell on themself to instead cast on a target, since you have to make sure their AI actually picks a target before using 0xC1. Most AI scripts use:
0xFF 0x6A 0xE1
where 0xFF means call AI function and 0x6A 0xE1 = 0x6AE1 + $D04F15 = $D0B9F6; no, I'm not sure why they used such a weird system to address AI script functions. Anyway, $D0B9F6 = Target_Nearest_Enemy.
As for finding and making these changes, all normal enemy AI is in bank 0x10, and most AI sets the spell_target just before the associated CastSpell, but not every enemy who casts a given spell is going to use the same animation number, so you'll be searching for the byte pattern C1 E9 ?? ## where C1 is to set the spell target, E9 is cast a spell, ?? is some animation number, and ## is the spell number.
Edit: new version uploaded, added info to beginning of this post.