FF6 Hacking
What makes Spears do double damage on Jump? - 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: What makes Spears do double damage on Jump? (/thread-2913.html)



What makes Spears do double damage on Jump? - Kugawattan - 07-08-2015

Basically what the title says. I turned a few Kunai into Spears, but I can't find what makes a Spear do double damage on jump, at least on FFusME, as on the item editor there doesn't seem to be any option checked that is different from the non-spear weapons.

Also, I'm making half of the recent threads here :D


RE: What makes Spears do double damage on Jump? - Gi Nattak - 07-08-2015

Anything in-battle related is handled in the C2 bank, so I'd look in the C2 disassembly first.
Searching for 'spear' brought up this:

Set $BD to 2 if A is between #$1D and #$24 (inclusive)
Increment damage if weapon is spear

C2/1512: C9 1D CMP #$1D
C2/1514: 90 08 BCC $151E (Exit)
C2/1516: C9 25 CMP #$25
C2/1518: B0 04 BCS $151E (Exit)
C2/151A: A9 02 LDA #$02
C2/151C: 85 BD STA $BD
C2/151E: 60 RTS

Then you can see from more instances of 'spear' searching that the STA $BD (the stored incremental damage) is placed in the Jump code:

C2/1817: 20 12 15 JSR $1512 (Set $BD to 2 if spear)
C2/181A: BD A9 3C LDA $3CA9,X (Weapon in left hand)
C2/181D: 20 12 15 JSR $1512 (Set $BD to 2 if spear)

So that's basically how it's done. How to go about changing it to another weapon though, I'm not exactly sure except some value in the 'Increment damage if weapon is spear' code must be set to spear. Maybe someone else can help clarify this more.

EDIT: What are you trying to do though exactly, change it to another weapon? Remove it?
If you want to just remove it, I'd imagine just NOP (EA byte) the two JSR there in the jump code would do that.

Oh and in case you are not sure where to find these disassemblys, you can find them on Slick Productions site here:
http://www.slickproductions.org/docs.php?id=FF6


RE: What makes Spears do double damage on Jump? - Tenkarider - 07-09-2015

Just saying... any chance the game detects if in the first character of weapon's name there's Spear icon?


RE: What makes Spears do double damage on Jump? - Drakkhen - 07-09-2015

What the game is doing at C2/1512 is checking the actual item number of your equipped weapon to see if it's in the range that the spears fall in; items 29-36.
If you want to have more weapons count as spears for jumping, it would be easiest if all of them were still lumped in one continuous section of the item list so that you could simply change the values in the function to match the new range.

Code:
C2/1512: C9 1D CMP #$1D   <-item number of first spear
C2/1514: 90 08 BCC $151E (Exit if item number less than first spear)
C2/1516: C9 25 CMP #$25   <-item number of last spear +1
C2/1518: B0 04 BCS $151E (Exit if item number greater than last spear)
C2/151A: A9 02 LDA #$02
C2/151C: 85 BD STA $BD
C2/151E: 60 RTS