Break items for any ability
#1
Normally, the game uses 6 bits to determine what ability an item breaks for (or a weapon procs for). The two most significant bits are used to determine if the weapon procs and if the item is removed from inventory when used. With 6 bits, items can break/proc for magic and some of the esper summons.

This code instead uses two unused bits in the weapon properties byte (0x04 and 0x08) for those flags, allowing the whole byte to be used for the break/proc ability. Items can break for Blow Fish, Bum Rush, Fallen One, Sneeze, you name it.

While the breaks all seem to work, some abilities don't behave properly when procced. In particular, Blitzes and Swdtechs play the wrong animation (somewhere the offset of Pummel is getting added to the animation id, so it plays the animation for Net or whatever). Bio Blast, Flash, Chocobop, H-Bomb, and 7-Flush all played garbled animations. But all of these work fine as breaks.


Code:
hirom

org $C229ED
JSL copy_proc_info
NOP
NOP

org $C23658
LDA $3A7E       ; load spell number

org $C22735
JSL copy_break_info

org $C22743
BMI load_spell_number

org $C2274A
load_spell_number:
LDA $3410        ; load spell number

org $C3F091     ; arbitrary free space
copy_proc_info:
LDA $3BA4,X     ; load weapon properties
AND #$0C        ; get proc, remove from inventory flags
ASL
ASL
ASL
ASL             ; shift them to position the rest of the code expects
STA $3A89       ; store in normal place
LDA $3D34,X     ; load spell number
STA $3A7E       ; store it
RTL

copy_break_info:
PHP             ; need to save carry flag
LDA $D85012,X
STA $3410       ; store spell number
LDA $D85013,X
ASL
ASL
ASL
ASL             ; shift them to position the rest of the code expects
PLP             ; restore carry flag
AND #$C0        ; get proc, remove from inventory flags. This happens after the shift and PLP so that the N flag is set correctly for C2/2743
RTL
Reply


Messages In This Thread
Break items for any ability - by Subtraction - 10-01-2018, 04:33 AM
RE: Break items for any ability - by PowerPanda - 10-01-2018, 09:44 AM
RE: Break items for any ability - by Subtraction - 10-01-2018, 01:50 PM
RE: Break items for any ability - by PowerPanda - 10-01-2018, 03:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Patch: Restored Ability Names (Update) SilentEnigma 60 57,458 03-24-2025, 09:07 AM
Last Post: kamesennin
  Patch: Battle Dialog Page Break SilentEnigma 4 4,288 09-29-2021, 09:04 PM
Last Post: SilentEnigma
  Natural Ability Extension GrayShadows 2 5,547 04-19-2020, 04:43 PM
Last Post: PowerPanda
  Patch: Custom Items HatZen08 19 30,596 08-18-2017, 08:09 PM
Last Post: Dev J
  Final Fantasy VI: Restored Ability Names Angelo26 114 200,921 02-19-2016, 08:08 PM
Last Post: madsiur
  Stat Increase Items! GrayShadows 7 9,618 07-09-2013, 09:43 PM
Last Post: GrayShadows

Forum Jump:


Users browsing this thread: 1 Guest(s)