FF6 Hacking
Boomerang & Sniper 75% - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html)
+--- Thread: Boomerang & Sniper 75% (/thread-3959.html)

Pages: 1 2


Boomerang & Sniper 75% - doofenH - 02-17-2020

Anyone know how to change these above weapon from 50% chance of 300% dmg to floating targets to 75%?

Or 400-500% dmg instead?

Or remove the 150% to non-floating effect, and instead 100% chance to inflict high dmg if target is floating?


RE: Boomerang & Sniper 75% - Subtraction - 02-18-2020

Here's the code for Sniper/Hawk Eye:
Code:
C2/38FE: 20 53 4B     JSR $4B53      (random: 0 or 1 in Carry flag)
C2/3901: 90 FA        BCC $38FD      (50% chance exit)
C2/3903: E6 BC        INC $BC        (Add 1 to damage incrementor)
C2/3905: B9 F9 3E     LDA $3EF9,Y
C2/3908: 10 F3        BPL $38FD      (Exit if not target not Floating)
C2/390A: A5 B5        LDA $B5
C2/390C: C9 00        CMP #$00
C2/390E: D0 ED        BNE $38FD      (Exit if command not Fight?)
C2/3910: E6 BC        INC $BC
C2/3912: E6 BC        INC $BC
C2/3914: E6 BC        INC $BC        (Add another 3 to damage incrementor)
C2/3916: A9 08        LDA #$08
C2/3918: 85 B5        STA $B5        (Store Throw for *purposes of animation*)
C2/391A: A5 B7        LDA $B7        (get graphic index)
C2/391C: 3A           DEC
C2/391D: 85 B6        STA $B6        (undo earlier adjustment, save as Throw parameter)
C2/391F: 4C BB 35     JMP $35BB      (Update a previous entry in ($76) animation buffer
                                     with data in $B4 - $B7)

If you want to change the odds, write a subroutine similar to C2/4B53 that sets the carry 75% of the time instead of 50%.
If you want it to do more damage, you could add more "INC $BC"s, but that'd take up more space and you'd have to move some or all of the code to a subroutine. It's probably better to just replace the "INC $BC"s with something like "LDA $BC, ADC #$05, STA $BC"
If you want to remove the effect for non-floating enemies but give a 100% on floating enemies, remove "LDA $3EF9,Y
BPL $38FD" and move the first INC $BC down below the floating check, like this (I haven't tested it, but it should work.):



Code:
hirom

org $C238FE

LDA $3EF9,Y
BPL $38FD     ; (Exit if not target not Floating)
INC $BC       ; (Add 1 to damage incrementor; this keeps the behavior the same for cases where you attack
              ; a flying enemy with a command other than fight, but you can move it down with the others
              ; if you don't care about that.
LDA $B5
CMP #$00
BNE $38FD     ; (Exit if command not Fight?)
INC $BC
INC $BC
INC $BC       ; (Add another 3 to damage incrementor)
LDA #$08
STA $B5       ; (Store Throw for *purposes of animation*)
LDA $B7       ; (get graphic index)
DEC
STA $B6       ; (undo earlier adjustment, save as Throw parameter)
JMP $35BB     ; (Update a previous entry in ($76) animation buffer
              ;                       with data in $B4 - $B7)



RE: Boomerang & Sniper 75% - doofenH - 02-18-2020

(02-18-2020, 04:07 AM)Subtraction Wrote:
Code:
hirom

org $C238FE

LDA $3EF9,Y
BPL $38FD     ; (Exit if not target not Floating)
INC $BC       ; (Add 1 to damage incrementor; this keeps the behavior the same for cases where you attack
             ; a flying enemy with a command other than fight, but you can move it down with the others
             ; if you don't care about that.
LDA $B5
CMP #$00
BNE $38FD     ; (Exit if command not Fight?)
INC $BC
INC $BC
INC $BC       ; (Add another 3 to damage incrementor)
LDA #$08
STA $B5       ; (Store Throw for *purposes of animation*)
LDA $B7       ; (get graphic index)
DEC
STA $B6       ; (undo earlier adjustment, save as Throw parameter)
JMP $35BB     ; (Update a previous entry in ($76) animation buffer
              ;                       with data in $B4 - $B7)
Do you happened to know the

header

!freespace = **********

It seem like I need this part above the asm.


RE: Boomerang & Sniper 75% - madsiur - 02-18-2020

(02-18-2020, 09:28 AM)doofenH Wrote: It seem like I need this part above the asm.

"header" instruction is only needed at the top if you ROM has a header. "!freespace" is only a tag used to specify an offset, you don't need it here since there is no other offset to specify, the code doesn't take extra space and is all contained within the "org $C238FE".


RE: Boomerang & Sniper 75% - doofenH - 02-18-2020

(02-18-2020, 09:34 AM)madsiur Wrote:
(02-18-2020, 09:28 AM)doofenH Wrote: It seem like I need this part above the asm.

"header" instruction is only needed at the top if you ROM has a header. "!freespace" is only a tag used to specify an offset, you don't need it here since there is no other offset to specify, the code doesn't take extra space and is all contained within the "org $C238FE".

Still have problem & this is the result.

error.patch.asm: Invalid opcode or command

BPL $38FD     ; (Exit if not target not Floating)

BNE $38FD     ; (Exit if command not Fight?)


RE: Boomerang & Sniper 75% - madsiur - 02-18-2020

You need to add tags and label your branches:

Code:
org $C238FD
branch1:
org $C235BB
branch2:
...
BPL branch1
...
BNE branch1
...
JMP branch2



RE: Boomerang & Sniper 75% - doofenH - 02-18-2020

(02-18-2020, 09:58 AM)madsiur Wrote: You need to add tags and label your branches:

Code:
org $C238FD
branch1:
org $C235BB
branch2:
...
BPL branch1
...
BNE branch1
...
JMP branch2
Now the error are the BPL branch1, BNE branch 1, JMP branch2. 


header

org $C238FE

org $C238FD
branch1:
org $C235BB
branch2:

LDA $3EF9,Y
BPL branch1 $38FD     ; (Exit if not target not Floating)
INC $BC       ; (Add 1 to damage incrementor; this keeps the behavior the same for cases where you attack
             ; a flying enemy with a command other than fight, but you can move it down with the others
             ; if you don't care about that.
LDA $B5
CMP #$00
BNE branch1 $38FD     ; (Exit if command not Fight?)
INC $BC
INC $BC
INC $BC       ; (Add another 3 to damage incrementor)
LDA #$08
STA $B5       ; (Store Throw for *purposes of animation*)
LDA $B7       ; (get graphic index)
DEC
STA $B6       ; (undo earlier adjustment, save as Throw parameter)
JMP branch2 $35BB     ; (Update a previous entry in ($76) animation buffer
              ;                       with data in $B4 - $B7)

(02-18-2020, 04:07 AM)Subtraction Wrote: If you want to change the odds, write a subroutine similar to C2/4B53 that sets the carry 75% of the time instead of 50%.
If you want it to do more damage, you could add more "INC $BC"s, but that'd take up more space and you'd have to move some or all of the code to a subroutine. It's probably better to just replace the "INC $BC"s with something like "LDA $BC, ADC #$05, STA $BC"

I don't get the "ADC #$05", I assume the 05 is the dmg x5, but what is "ADC" in hex? Which game spec docs do I find this?


RE: Boomerang & Sniper 75% - madsiur - 02-18-2020

You need to remove the "$35BB" and "$38FD" from the lines and just leave the "branch1" and "branch2" like my example above. You also need to leave the "org $C238FE" above the LDA $3EF8,Y.

Edit: Just use this:

Code:
hirom

org $C238FD
branch1:

org $C235BB
branch2:

org $C238FE

LDA $3EF9,Y
BPL branch1     ; (Exit if not target not Floating)
INC $BC       ; (Add 1 to damage incrementor; this keeps the behavior the same for cases where you attack
              ; a flying enemy with a command other than fight, but you can move it down with the others
              ; if you don't care about that.
LDA $B5
CMP #$00
BNE branch1     ; (Exit if command not Fight?)
INC $BC
INC $BC
INC $BC       ; (Add another 3 to damage incrementor)
LDA #$08
STA $B5       ; (Store Throw for *purposes of animation*)
LDA $B7       ; (get graphic index)
DEC
STA $B6       ; (undo earlier adjustment, save as Throw parameter)
JMP branch2    ; (Update a previous entry in ($76) animation buffer
              ;                       with data in $B4 - $B7)



RE: Boomerang & Sniper 75% - doofenH - 02-18-2020

It work. Tq madsiur & subtraction. This one below is without checking the floating tgt & max dmg all the time.


header

org $C238FD
branch1:

org $C238FE

INC $BC ; (Add 1 to damage incrementor; this keeps the behavior the same for cases where you attack
; a flying enemy with a command other than fight, but you can move it down with the others
; if you don't care about that.
LDA $B5
CMP #$00
BNE branch1 ; (Exit if command not Fight?)

INC $BC
INC $BC
INC $BC ; (Add another 3 to damage incrementor)
LDA #$08
STA $B5 ; (Store Throw for *purposes of animation*)
LDA $B7 ; (get graphic index)
DEC
STA $B6 ; (undo earlier adjustment, save as Throw parameter)
JMP $35BB ; (Update a previous entry in ($76) animation buffer
; with data in $B4 - $B7)

(02-18-2020, 04:07 AM)Subtraction Wrote: If you want it to do more damage, you could add more "INC $BC"s, but that'd take up more space and you'd have to move some or all of the code to a subroutine. It's probably better to just replace the "INC $BC"s with something like "LDA $BC, ADC #$05, STA $BC".
It work Subtraction, it hit "floating" atk with I assume x6 dmg all the time. And now it is too OP, lol.

Now I'm going to test 50-50 on 600% dmg, but correct me if I'm wrong below.

"ADC #$05" is x6 dmg (I think), but what about "LDS $BC" & "STA $BC"?


RE: Boomerang & Sniper 75% - madsiur - 02-18-2020

(02-18-2020, 10:44 AM)doofenH Wrote: "ADC #$05" is x6 dmg (I think), but what about "LDS $BC" & "STA $BC"?

You'll need to replace this:

Code:
INC $BC
INC $BC
INC $BC       ; (Add another 3 to damage incrementor)

by this:

Code:
LDA $BC    ; load damage incrementor in accumulator
ADC #$05   ; add 5 to it
STA $BC    ; save accumulator to $BC