The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.3.33 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




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

#1
Posts: 51
Threads: 5
Thanks Received: 2
Thanks Given: 0
Joined: Apr 2018
Reputation: 8
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)



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

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite