Changes

Jump to navigation Jump to search

FF7/DamageFormula

183 bytes added, 19:13, 29 March 2012
Damage Calculations
==Damage Calculations==
For standard damage functions
X0:
:<pre>Sets Target's 02h flag to 1. (Unknown effect)</pre>
----
X1:
:<pre>If Attack Property "Always Critical" is Set:: Set Critical Damage Flag:End If
:x = ( Actor's Level * Actor's (M)Attack ) / 32:y = ( Actor's Level + Actor's (M)Attack ) / 32:z = Actor's (M)Attack + ( x * y ):z = z * ( 512 - target's defense ) * Attack's Power:Damage = z / 4096
:If Critical Damage Flag is set:: Damage = Damage * 2:End If
:If Actor's Statuses include Berserk:: Damage = Damage * 3 / 2:End If
:Long_Range = 0:If Target is in Back Row:: Set Long_Range = 1:End If:If Attack is Short Range OR Command is Enemy Attack::If Actor is in Back Row:::Long_Range = 1::End If:Else::Long_Range = 0:End If:If Long_Range != 0::Damage = Damage / 2:End If
:If Target Attack is DefendingShort Range OR Command is Enemy Attack If Actor is in Back Row Long_Range = 1 End IfElse::Damage Long_Range = Damage / 20:End If
:If Target's Back is exposedLong_Range != 0:: Damage = Damage * ( Target's Back Attack Modifier / 8 )2:End If
:If Actor's Statuses includes FrogTarget is Defending:: Damage = Damage / 42:End If
:If Target's Back is exposed Damage = Damage * ( Target's Back Attack Modifier / 8 )End If If Actor's Statuses includes Frog Damage = Damage / 4End If Damage = Sadness( Damage ):Damage = Split( Damage, 0 ):Damage = Barrier( Damage )
:If Actor's Statuses include Mini:: Damage = 0:End If :Damage = Variance( Damage )</pre>
----
X2:
:<pre>multiNoSplit = ( ( ( Attack's Target Flags AND Ch ) - 4 ) == 0 ? 1 : 0 ):Base = (Actor's Attack + Actor's Level) * 6:Damage = (512 - Target's Defense) * Base * Attack's Power:Damage = Sadness( Damage ):Damage = SplitDamage( Damage, multiNoSplit ):Damage = Barrier( Damage ):Damage = Variance( Damage )</pre>
----
X3:
:<pre>If Attack Properties Damage MP is clear:: Damage = Target's HP:Else:: Damage = Target's MP:End If:Damage = Damage * Attack's Power / 32:If ActionData[AC] != 0 (?):: Damage = Damage / 2:End If:Damage</pre>
----
X4:
:<pre>If Attack Properties Damage MP is clear:: Damage = Target's MHP:Else:: Damage = Target's MMP:End If:Damage = Damage * Attack's Power / 32:If ActionData[AC] != 0 (?):: Damage = Damage / 2:End If:Damage</pre>
----
X5:
:<pre>Damage = (Actor's (M)Attack + Actor's Level) * 6 + (Attack's Power * 22):Damage = SplitDamage( Damage ):Damage = Barrier( Damage ):Damage = Variance( Damage )</pre>
----
X6:
:<pre>Damage = Attack's Power * 20</pre>
----
X7:
:<pre>Damage = ( ( 512 - Target's Def ) * Attack's Power / 32 ):Damage = Variance( Damage )</pre>
----
X8:
:<pre>If ActionData[0x230] AND 40h:: ActionData[0x230] = 1:Else:: ActionData[0x230] = 80h:End If//presumably this checks if the target heals from restore element and will either recover or kill based on the result</pre>
----
X9:
:<pre>Actor's Attack = Actor's Strength * 2:Use Damage X1 with adjusted stat</pre>
----
XA:
<pre>Damage = ( Attack's Power + Number of Targets - 1 ) / Number of Targets</pre>----==Additional Checks==
Sadness( Damage ):
:<pre>If Target's Status includes Sadness:: Damage = Damage - (Damage * 3 / 10):End If:Return Damage</pre>
----
SplitDamage( Damage, multiNoSplit ):
:<pre>If multiNoSplit == 0:: If No. of Attack's Targets >= 2::: Set Attack's split damage Target Flag:: Else::: Set multiNoSplit == 1:: End If:End If:If ActionData[0xAC] == 0:: Damage = Damage / 2:Else:: If multiNoSplit == 0::: Damage = Damage * 3 / 2:: End If:End If:Return Damage</pre>
----
Barrier( Damage ):
:<pre>If Attack Property "Physical" is 0:: If Target's Statuses include MBarrier::: Set ActionData "MBarrier Active" flag:: End If:Else:: If Target's Statuses include Barrier::: Set ActionData "Barrier Active" flag:: End If:End If:If ActionData "MBarrier Active" or "Barrier Active" flags are set:: Damage = Damage / 2:End If:If attack is Magic and EnabledMagic[7] == 0 (?):: Damage = Damage + ( Damage * ( EnabledMagic[7] * (10 / 32) ) / 100 ):End If:Return Damage</pre>
----
Variance( Damage ):
:<pre>Damage = Damage ([0..255] + 3841) / 4096 //from RNGLUT in KERNEL.BIN:If Damage == 0:: Damage == 1:End If:Return Damage</pre>
Anonymous user

Navigation menu