Users browsing this thread: 1 Guest(s)
Boomerang & Sniper 75%

#2
Posts: 51
Threads: 5
Thanks Received: 2
Thanks Given: 0
Joined: Apr 2018
Reputation: 8
Status
Shell
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)
  Find
Quote  
[-] The following 2 users say Thank You to Subtraction for this post:
  • doofenH (02-18-2020), madsiur (02-18-2020)



Messages In This Thread
Boomerang & Sniper 75% - by doofenH - 02-17-2020, 11:11 AM
RE: Boomerang & Sniper 75% - by Subtraction - 02-18-2020, 04:07 AM
RE: Boomerang & Sniper 75% - by doofenH - 02-18-2020, 09:28 AM
RE: Boomerang & Sniper 75% - by madsiur - 02-18-2020, 09:34 AM
RE: Boomerang & Sniper 75% - by doofenH - 02-18-2020, 09:52 AM
RE: Boomerang & Sniper 75% - by madsiur - 02-18-2020, 09:58 AM
RE: Boomerang & Sniper 75% - by doofenH - 02-18-2020, 10:19 AM
RE: Boomerang & Sniper 75% - by madsiur - 02-18-2020, 10:27 AM
RE: Boomerang & Sniper 75% - by doofenH - 02-18-2020, 10:44 AM
RE: Boomerang & Sniper 75% - by madsiur - 02-18-2020, 01:28 PM
RE: Boomerang & Sniper 75% - by Subtraction - 02-20-2020, 04:00 AM
RE: Boomerang & Sniper 75% - by doofenH - 02-19-2020, 01:16 AM
RE: Boomerang & Sniper 75% - by madsiur - 02-19-2020, 01:27 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite