Final Fantasy IV US 1.1 Physical Damage Summary

Aexoden Sep 5th, 2019 (edited) 209 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Brief summary of FF4 $03:C499, which handles physical damage calculation.
  2. This summary is focused on the actual calculation of physical damage and
  3. status effects, and as such, ignores the few modifications to the
  4. audiovisual script the routine does.
  6. 1. If the acting slot has darkness, reduce accuracy by one-half.
  7. 2. If the acting slot is in the the back row and not long range or jumping,
  8.    reduce accuracy by one half.
  9. 3. If the middle slot, multiply accuracy by 5/4. If a monster, this is if
  10.    they are in monster slot 0. This changes based on formation.
  11. 4. If the target is in the back row and the actor is not long range or jumping,
  12.    reduce accuracy by one half.
  13. 5. Calculate hits from accuracy and multiplier. A hit is successful if RND(0, 98)
  14.    is less than the accuracy.
  15. 6. Check for barrier or image status on the target. The following checks occur
  16.    only if neither:
  17.   a. If the target has darkness, reduce their evade by one half.
  18.   b. If the target is in slot 0 (either character or monster), multiply their
  19.      evade by 5/4.
  20.   c. Calculate the number of hits the target will evade based on their defense
  21.      multiplier and evade. If the target is a toad or small, their multiplier
  22.      is set to zero. An evade attempt is successful if RND(0,98) is less than
  23.      the evade stat.
  24. 7. Calculate the total number of hits by subtracting the number of evaded hits
  25.    (255 if barrier or image) from the number of attack hits.
  26. 8. If monster target and monsters invincible, pretend it's a miss anyway.
  27. 9. Continuing for actual hits:
  28.   a. Remove Charm status from the target.
  29.   b. Determine the elemental multiplier. In order, check for these matches:
  30.      strong weakness, regular weakness, immunity, resistance. If any match, set
  31.      the multiplier to 8, 4, 0 or 1, respectively. Any further checks are
  32.      skipped. The default value of the multiplier is 2.
  33.   c. Determine the race multiplier. If a character is attacking a monster and
  34.      it matches, the value is 8. If a monster is attacking a character and it
  35.      matches, the value is 1. Otherwise, it defaults to 2.
  36.   d. If the actor is berserked, set the attack power to 3/2 the original value.
  37.   e. If the actor is jumping or charging, multiply the attack power by two.
  38.   f. If the actor is cursed, divide the attack power by two.
  39.   g. If the target is in the back row, multiply their defense power by two.
  40.   h. If the target is cursed, divide their defense power by two.
  41.   i. If RND(0,98) is less than the actor's critical rate, it's a critical hit.
  42.   j. If the target is defending, multiply their defense power by two.
  43.   k. If the target is charging, divide their defense power by two.
  44.   l. If the actor is a toad or small, set attack power to 1, unset critical.
  45.   m. If the target is a toad or small, multiply attack power by two and set
  46.      defense power to zero.
  47.   n. Calculate actual attack power: power + RND(0, power / 2). If after
  48.      the earlier adjustments, power ends up 512 or greater, the random number
  49.      added is capped at RND(0,255) nonetheless.
  50.   o. Apply elemental multipliers and racial multipliers to that value. Multiplier
  51.      is divided by two. (The 1 case is handled specially to divide the value by
  52.      two.)
  53.   p. Add the actor's critical bonus to the attack power.
  54.   q. Subtract the target's defense power from the attack power. Set it to zero
  55.      if negative.
  56.   r. Multiply the result by the previously calculated number of hits.
  57. 10. Next, apply any relevant status changes. This only applies if the attack was
  58.     not a miss.
  59.   a. Nothing is done if the target is immune to any of the attacking statuses.
  60.   b. If the target's evade is greater than or equal to the actor's accuracy,
  61.      no status will be applied.
  62.   c. The actor now has X number of chances to land a status, where X is equal to
  63.      the number of hits that were used in the damage portion of the calculation.
  64.      Each chance has an (accuracy - evade) chance of connecting. Only one of
  65.      these needs to connect to pass the check.
  66.   d. If the target is a boss, no status will be applied.
  67.   e. If the target already has any of the statuses in the attacking status,
  68.      no status changes will be applied.
  69.   f. If the target's action timer status byte has any bits set, no status
  70.      changes will be applied.
  71.   g. If the actor is a toad or small, no status changes will be applied.
  72.   h. If attacking with the swoon status and the target monster is undead or a
  73.      machine, no status will be applied.
  74.   i. If the target already has a status with a higher bit value (treating the
  75.      first two status bytes as a single 16-bit little endian value), return
  76.      without applying any status.
  77.   j. Set the pending status bytes to be applied later.
  78.   k. Set the poison timer if applying poison status. Timer length is equal to
  79.      vitality + 20 for characters or $2F + 20 for monsters (both subject to
  80.      the speed modifier).
  81.   l. Set the action timer if applying the sleep/paralyze statuses. If so, no
  82.      further checks are done. The timer value is (300 - (will * 4)) / 6 for
  83.      characters, and the same for monsters except will is replaced with $2F.
  84.      The speed modifier is applied before the division by 6. If will/$2F * 4
  85.      overflows beyond a single byte, any bits above the 8-bit limit will be
  86.      ignored, leading to odd behavior once will exceeds 63.
  87.   m. Apply any gradual petrification. The timer is set as with sleep/paralyze.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand