Users browsing this thread: 1 Guest(s)
Changing the Physical Damage Formula
06-07-2014, 02:46 PM
(This post was last modified: 06-08-2014, 01:41 PM by ReturnerScum.)
Hi all, I just replaced the physical damage formula with the magic damage formula successfully, so I thought I'd finally start a damage formula thread. I've seen a few interesting side effects, so it's not perfect right now, but it's a really good start for anyone who wants this sort of thing.
I used the code for the wonderful magic damage overflow fix and replaced it at a section where the physical damage formula starts.
Then you will need the rest of the magic overflow fix:
And it works! Unfortunately, what are the side effects? Well I wrote over the gauntlet code, so damage won't increase from gauntlet until I put that in somewhere (not too hard). It also seeeems like ignore defense doesn't work right for physical damage, and the Atma weapon formula runs after this formula, so it's all huge damage now.
Why would anyone do this? Well, naysayers---it's all about values. Vigor being doubled in the original formula means the maximum vigor that has any effect is 128, even if you get higher than that. And also--I was finding that a battle power of 255 was pretty limiting as well in the old formula---but now it would be as if your spell power was 255, which is insane damage. So now we have freed two important values to the game, all for physical damage, and made it possible for their values to matter much more before hitting their ceiling. But what are the other problems? Who can say. As the pivotal anarchist punk band Enya recounted:
Who can say where the road goes
Where the day flows, only time
And who can say if your love grows
As your heart chose, only time
I used the code for the wonderful magic damage overflow fix and replaced it at a section where the physical damage formula starts.
PHP Code:
C2/2BA6 through C2/2BAD: EA (Nullifies some beginning code. Now that I know this works, I could likely begin the real working code here.)
C2/2BAE: AD AF 11 LDA $11AF (Level)
C2/2BB1: 85 E8 STA $E8
C2/2BB3: C9 01 CMP #$01
C2/2BB5: 7B TDC (Clear 16-bit A)
C2/2BB6: AD A6 11 LDA $11A6 (Spell Power/BATTLE POWER)
C2/2BB9: C2 20 REP #$20 (Set 16-bit Accumulator)
C2/2BBB: 90 02 BCC $2B7A (If Level > 0, Spell Power *= 4)
C2/2BBD: 0A ASL
C2/2BBE: 0A ASL
C2/2BBF: 20 97 2B JSR $2B97 (more efficient STA $11B0 / SEP #$20)
C2/2BC2: AD AE 11 LDA $11AE (Magic Power/VIGOR)
C2/2BC5: EB XBA
C2/2BC6: AD A6 11 LDA $11A6 (Spell Power/BATTLE POWER)
C2/2BC9: 20 81 47 JSR $4781 (Multiplication Function)
C2/2BCC: 20 B7 47 JSR $47B7 (Multiplication Function 2)
C2/2BCF: A9 04 LDA #$04
C2/2BD1: C2 20 REP #$20 (Set 16-bit Accumulator)
C2/2BD3: DA PHX
C2/2BD4: A2 1F LDX #$1F
C2/2BD6: E4 EA CPX $EA (if top byte of (Level * Magic Power * Spell Power)is >= 32, (Level * Magic Power * Spell Power) / 32 will have a nonzero value in the top byte after routine C2/0DD1, meaning the damage exceeded 65535)
C2/2BD8: 20 D4 FB JSR $FBD4 (no space for needed overflow checks, so call a special function)
C2/2BDB: FA PLX
C2/2BDC: 8D B0 11 STA $11B0 (Maximum Damage)
C2/2BDF: E2 20 SEP #$20 (Set 8-bit Accumulator)
C2/2BE1: 60 RTS
C2/2BE2-C2/2C20 EA codes until beginning of 2C21
Then you will need the rest of the magic overflow fix:
PHP Code:
(custom function. 2 checks make sure damage doesn't wrap past 65535)
C2/FBD4: 90 09 BCC reduce_it (so go truncate it down)
C2/FBD6: 20 D1 0D JSR $0DD1 (Divide 32-bit Damage by 32. Note the damage never occupies more than 3 bytes going into this call (with a theoretical maximum of 16,581,375)but the function operates on 32-bits)
C2/FBD9: 18 CLC
C2/FBDA: 6D B0 11 ADC $11B0 (Maximum Damage)
C2/FBDD: 90 02 BCC dont_change (did overall damage so far surpass 65535? if not,leave it unchanged)
reduce_it:
C2/FBDF: 7B
C2/FBE0: 3A
dont_change:
C2/FBE1: 60 RTS
And it works! Unfortunately, what are the side effects? Well I wrote over the gauntlet code, so damage won't increase from gauntlet until I put that in somewhere (not too hard). It also seeeems like ignore defense doesn't work right for physical damage, and the Atma weapon formula runs after this formula, so it's all huge damage now.
Why would anyone do this? Well, naysayers---it's all about values. Vigor being doubled in the original formula means the maximum vigor that has any effect is 128, even if you get higher than that. And also--I was finding that a battle power of 255 was pretty limiting as well in the old formula---but now it would be as if your spell power was 255, which is insane damage. So now we have freed two important values to the game, all for physical damage, and made it possible for their values to matter much more before hitting their ceiling. But what are the other problems? Who can say. As the pivotal anarchist punk band Enya recounted:
Who can say where the road goes
Where the day flows, only time
And who can say if your love grows
As your heart chose, only time
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)