Users browsing this thread: 1 Guest(s)
Changing the Physical Damage Formula

#1
Posts: 61
Threads: 18
Thanks Received: 1
Thanks Given: 47
Joined: May 2014
Status
None
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.

PHP Code:
C2/2BA6 through C2/2BADEA (Nullifies some beginning code.  Now that I know this worksI could likely begin the real working code here.)

C2/2BAEAD AF 11     LDA $11AF   (Level)    
C2/2BB185 E8        STA $E8    
C2
/2BB3C9 01        CMP #$01    
C2/2BB57B           TDC         (Clear 16-bit A)    
C2/2BB6AD A6 11     LDA $11A6   (Spell Power/BATTLE POWER)    
C2/2BB9C2 20        REP #$20    (Set 16-bit Accumulator)    
C2/2BBB90 02        BCC $2B7A   (If Level 0Spell Power *= 4)    
C2/2BBD0A           ASL     
C2
/2BBE0A           ASL     
        
C2
/2BBF20 97 2B     JSR $2B97   (more efficient STA $11B0 SEP #$20)    
        
C2/2BC2AD AE 11     LDA $11AE   (Magic Power/VIGOR)    
C2/2BC5EB           XBA     
C2
/2BC6AD A6 11     LDA $11A6   (Spell Power/BATTLE POWER)    
C2/2BC920 81 47     JSR $4781   (Multiplication Function)    
C2/2BCC20 B7 47     JSR $47B7   (Multiplication Function 2)    
C2/2BCFA9 04        LDA #$04    
C2/2BD1C2 20        REP #$20    (Set 16-bit Accumulator)    
        
C2/2BD3DA           PHX    
C2
/2BD4A2 1F        LDX #$1F    
C2/2BD6E4 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/0DD1meaning the damage exceeded 65535)    
        
C2/2BD820 D4 FB     JSR $FBD4   (no space for needed overflow checksso call a special function)    
C2/2BDBFA           PLX    
        
C2
/2BDC8D B0 11     STA $11B0   (Maximum Damage)    
C2/2BDFE2 20        SEP #$20    (Set 8-bit Accumulator)    
C2/2BE160           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




  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite