Users browsing this thread: 1 Guest(s)
Break items for any ability

#1
Posts: 22
Threads: 3
Thanks Received: 33
Thanks Given: 0
Joined: Apr 2018
Reputation: 2
Status
Shell
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
  Find
Quote  
[-] The following 3 users say Thank You to Subtraction for this post:
  • madsiur (10-01-2018), Robo Jesus (05-20-2019), Tenkarider (10-01-2018)

#2
Posts: 276
Threads: 33
Thanks Received: 97
Thanks Given: 65
Joined: Feb 2017
Reputation: 19
Status
None
Not sure how this works, but I've been looking for code that allows Tools to break when used. Could I use this code for that purpose?


Projects:
Divergent Paths: The 3 Scenarios (Completed) - a redo of the 3 scenarios in the original game that gives equal time to each group. Meant to be a basis for future mods.
FFVI: Divergent Paths (In Progress) - a hack built off of the 3 scenarios that changes other events in the same, such as making Leo permanently recruitable, bringing Banon's story closure, and adding 1 more secret character.
  Find
Quote  

#3
Posts: 22
Threads: 3
Thanks Received: 33
Thanks Given: 0
Joined: Apr 2018
Reputation: 2
Status
Shell
This code won't help you with that, unless you want the tools to do something other than magic or the first few esper summons when they break.

But is making tools breakable not just a matter of setting the usable-in-battle bit? At any rate, Beyond Chaos makes tools breakable (sometimes), so it's a solved problem.
  Find
Quote  

#4
Posts: 276
Threads: 33
Thanks Received: 97
Thanks Given: 65
Joined: Feb 2017
Reputation: 19
Status
None
It's not a high priority. It won't make v.1, and I haven't even scoped it yet. I was just trying to understand the purpose of what you posted.


Projects:
Divergent Paths: The 3 Scenarios (Completed) - a redo of the 3 scenarios in the original game that gives equal time to each group. Meant to be a basis for future mods.
FFVI: Divergent Paths (In Progress) - a hack built off of the 3 scenarios that changes other events in the same, such as making Leo permanently recruitable, bringing Banon's story closure, and adding 1 more secret character.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite