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

#1
Posts: 145
Threads: 47
Thanks Received: 0
Thanks Given: 0
Joined: Jan 2020
Reputation: 0
Status
None
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?
  Find
Quote  

#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)

#3
Posts: 145
Threads: 47
Thanks Received: 0
Thanks Given: 0
Joined: Jan 2020
Reputation: 0
Status
None
(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.
  Find
Quote  

#4
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(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".
  Find
Quote  

#5
Posts: 145
Threads: 47
Thanks Received: 0
Thanks Given: 0
Joined: Jan 2020
Reputation: 0
Status
None
(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?)
  Find
Quote  

#6
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
You need to add tags and label your branches:

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

#7
Posts: 145
Threads: 47
Thanks Received: 0
Thanks Given: 0
Joined: Jan 2020
Reputation: 0
Status
None
(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?
  Find
Quote  

#8
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
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)
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • doofenH (02-18-2020)

#9
Posts: 145
Threads: 47
Thanks Received: 0
Thanks Given: 0
Joined: Jan 2020
Reputation: 0
Status
None
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"?
  Find
Quote  

#10
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(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
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite