Changes

Jump to navigation Jump to search

FF7/DamageFormula

1,796 bytes added, 16:16, 20 May 2021
m
0: Physical Accuracy Check: There is an enemy check on the Dex bonus that I didn't notice before. Physical Chance is unaffected.
z = z * ( 512 - target's defense ) * Attack's Power
Damage = z >> 13
//This is a bit-shift left by 13 which is mathematically equivalent to dividing by 40968192, but it's important to note that it doesn't actually divide as this is the source of the damage overflow glitch
If Critical Damage Flag is set
===0: Physical Accuracy Check===
''0x5DDBB0''
<pre>;For the purposes of this code, "Dex" means the adjusted Dexterity of the actor/target if any in-battle dex bonuses have been granted.;Same holds for the Physical Evade. Physical Hit rate has no in-game bonus opportunities. Check_For_Cover() HitChance = -1; If "Always connect" flag set then HitChance = 255; If target has one of the following statuses (Death, Sleep, Confu, Stop, Petrify, Manipulate, Paralysis) then Remove Sleep status Remove Confu status Remove Manipulate status HitChance = 255End If If action is flagged as "always hit" then HitChance = 255; Physical Chance = (Actor's Dex >> 2) + action physical hit rateIf Actor is enemy then Actor's evade = Actor's Physical evadeelse Actor's evade = (Actor's Dex >> 2) + Actor's Physical evadeEnd IfIf Target is enemy then Target's evade = Target's Physical evadeElse Target's evade = (Target's Dex >> 2) + Target's Physical evadetodoEnd IfItIf HitChance = -1 Then HitChance = Physical Chance + Actor's evade - Target's evade HitChance = FuryAdjust(HitChance)End If If HitChance = 0 then HitChance = 1 Luck Chance = [0..99]If (Actor's Luck / 4) > Luck Chance Then HitChance = 255 ;Lucky HitElse If Actor is Player Character targetting an enemy Then If (Target's long so Luck / 4) > Luck Chance HitChance = 0 ;Lucky Dodge End If End IfEnd If Miss Chance = (([0..65535] * 99) / 65535) + 1 ;essentially [1..100]if HitChance < Miss Chance then Set Miss flagEnd If</pre> ====Check_For_Cover==== This is where the game checks if the target is covered under a "cover"ing ally. It only applies to Player Characters It might be more complicated than I'll tackle it when I have a lot m seeing, but that is definitely ONE of time on my handsits functions ====FuryAdjust(HitChance)====<pre> If HitChance < 255 then If Actor is in Fury Status HitChance = HitChance - ((HitChance * 3) / 10) End If End If return HitChance </pre>
===1: Magical Accuracy Check===
6
edits

Navigation menu