I also noticed there's no code to set the colour of an enemy's confusion attack. It will use the colour of the last spell/weapon used.
I can look into making a stand-alone patch for both things...
Gosh I hope I don't get carried away again. I kinda want to make it display the name of the spell the weapon/armour item is casting, too...
So--I'm not gonna make a bunch of patches for things... but I like pointing out ways to do things, so I did this.
In the disassembly, Bank C, look for "BattleSubMenu_Item:", and at the end...
@GetSpellCast:
STA $88 ; store pointer to wep/armor data in $88,89
STX $89
LDY #$03 ; Y=3 to index, since byte 3 in both wep/armor data is the "spell cast" entry
LDA ($88), Y ; get spell cast
TAX ; put it in X
DEX ; DEX to make it 0-based (FF becomes "no spell")
; LDY btlcmd_curchar ; Y=cur char -- default to targetting yourself
JSR SetItemCastSpellPalette ; <-- insert this in place of LDY btlcm_curchar
LDA #$10
JMP SetCharacterBattleCommand
And then, somewhere that fits...
SetItemCastSpellPalette:
TXA ; bring spell ID back from X
PHA ; back it up
JSR GetPointerToMagicData
STA $80 ; $80,81 points to this spell's data
STX $81
LDY #$06 ; 06 = spell's palette
LDA ($80), Y ; get the palette and put it in X
TAX
LDA btlcmd_curchar ; get current character to act
ASL A ; double the ID and put in Y
TAY
TXA ; bring the spell palette from X
STA btlcmd_magicgfx+1, Y ; save it here--when walking forward, the variable palette will be updated to this
PLA ; bring back the spell ID
TAX ; put it in X
LDY btlcm_curchar ; Y=cur char -- default to targetting yourself
RTS
This is like... 29 bytes. Its hard to find that much uninterrupted space when you want to use other patches alongside... FF Restored seems really popular. Wish I had time to disassemble that so I could make all kinds of battle system changes that support that patch. Then just shove code around willy-nilly and re-assemble Bank C. %50 of the time I end up with more free space to keep playing around with, too!