Game Modification Station / FF6 damage formula
« on: March 02, 2015, 06:06:42 PM »For reference:
C2/2BCE: E2 20 SEP #$20 (Set 8-bit Accumulator)
C2/2BD0: 6D AE 11 ADC $11AE (add Vigor * 2 if character, or Vigor if monster)
C2/2BD3: EB XBA
C2/2BD4: 69 00 ADC #$00 (add carry from the bottom byte of Attack
into the top byte)
C2/2BD6: EB XBA
C2/2BD7: 20 B7 47 JSR $47B7 (get 16-bit "Attack" * 8-bit level, and put
24-bit product in Variables $E8 thru $EA)
C2/2BDA: A5 E8 LDA $E8
C2/2BDC: 85 EA STA $EA (use top byte of result as temporary variable,
since it's generally 0 anyway.
to see why that's a bad idea, keep reading.)
C2/2BDE: 68 PLA
C2/2BDF: 85 E8 STA $E8 (get attacker level again)
C2/2BE1: C2 20 REP #$20 (Set 16-bit Accumulator)
C2/2BE3: A5 E9 LDA $E9
C2/2BE5: EB XBA (A = bottom two bytes of the first multiplication
result.. typically, we'll always have zero in the
top byte, so we can ignore it. but with a 255
Battle Power weapon, Gauntlet, and a character at
Level 99 with 128 Vigor, that product WILL need 3
bytes. failure to use that top byte in our next
multiplication means we'll lose a lot of damage.
BUG!)
C2/2BE6: 20 B7 47 JSR $47B7 (multiply 16-bit result of [Level * Attack] by
our 8-bit level again, and put the new 24-bit
product in Variables $E8 thru $EA.
16-bit A will hold the new product DIV 256.)
C2/2BE9: 8D B0 11 STA $11B0 (Maximum Damage)
The original physical damage formula (which I am using as the basis) is:Attack = Battle Power + (Vigor * 2). Vigor * 2 is capped at 255.
$11B0 = Battle Power + ( (Level * Level * Attack) DIV 256 )
I've been wrestling for MONTHS trying to get a new damage formula in, roughly based on the original with different weights, and I lose the highest byte no matter what I do.