Pokemon Mystery Dungeon - Damage Calculation
- This page has proved very complicated for many people. A shorter and simpler version of this page is available. This page is intended for those who want to create a battle system for Mystery Dungeon.
Here is the procedure for calculating damage in Mystery Dungeon. No rounding up or down is done in multiplication or division.
Internally, the game uses a 64-bit fixed point number format, with a 16-bit fractional part, in the damage calculation.
Damage Formula
Damage = (((D*2)-C)+10)+((D*D)*3276/65536)
where:
- A = Attacker's Attack/Special Attack
- B = Attacker's level
- C = Opponent's Defense/Special Defense
- D = ((A-C)/8)+(B*43690/65536)
For physical attack types (Normal, Fighting, Flying, Poison, Ground, Rock, Bug, Ghost, Steel, None), use the Attack and Defense values. For special attack types (Fire, Water, Electric, Grass, Ice, Psychic, Dragon, Dark), use the Special Attack and Special Defense values.
Attack and Defense Modification
For the purposes of this formula, the attacker's and defender's stats are modified as follows, in this order:
- If there is a defender and the attack is a Fire type, add X to the Special Attack stat stage, where X is the attacker's Flash Fire rate (initially 0).
- If the attacker is Deoxys, add 2 to the Attack/Special Attack stat stage if it's the Attack Form; subtract 2 if it's the Defense or Speed Form.
- The Attack/Special Attack stat stage becomes min(20,max(0,Orig. value)).
- If the defender has the Skull Bash status, add 1 to the Defense stat stage.
- If the defender is Deoxys, add 2 to the Defense/Special Defense stat stage if it's the Defense Form; subtract 2 if it's the Attack or Speed Form.
- The Defense/Special Defense stat stage becomes min(20,max(0,Orig. value)).
- Add the attack's power to the attacker's Attack/Special Attack. (See "Power" in the list of moves. If the move has a number after a "+", e.g. Scratch+1, that number, which can have a maximum of 255, is added to the attack's power, which has no maximum value.)
- Attack/Special Attack is multiplied by the respective stat stage multiplier.
- Attack/Special Attack is multiplied by the respective stat multiplier (from Aurora Beam, etc.).
- Attack/Special Attack is rounded down.
- Defense/Special Defense is multiplied by the respective stat stage multiplier.
- Defense/Special Defense is multiplied by the respective stat multiplier (from Screech, etc.).
- Defense/Special Defense is rounded down.
- If the attacker is holding a Power Band, add 12 to Attack.
- If the attacker is holding a Munch Belt, add 8 to Attack.
- If the defender is holding a Def. Scarf, add 12 to Defense.
- If the defender is holding a Zinc Band, add 8 to Special Defense.
- If the attacker is holding a Special Band, add 12 to Special Attack.
- If the attacker is holding a Munch Belt, add 8 to Special Attack.
- Attack/Defense/Special Attack/Special Defense become min(999,max(1,Orig. value)).
- Four variables, X, Y, A, and B, are set to 1.
- If the attacker has Guts and has a status problem (see "Status Problems" in the Status page), set X to 2 if the attack is a physical attack.
- If the attacker has Huge Power or Pure Power and a random number from 0 through 99 is less than or equal to 32, multiply X by 3 and Y by 2 if the attack is a physical attack.
- If the attacker has Hustle, multiply X by 3 and Y by 2 if the attack is a physical attack.
- If the attacker has Plus and one of the attacker's allies has Minus, multiply X by 15 and Y by 10 if the attack is a special attack.
- If the attacker has Minus and one of the attacker's allies has Plus, multiply X by 15 and Y by 10 if the attack is a special attack.
- If the defender has Intimidate, multiply X by 4 and Y by 5 if the attack is a physical attack.
- If the defender has Marvel Scale and has a status problem, multiply A by 3 and B by 2 if the attack is a physical attack.
Damage Modification
After calculating the damage using the formula above, the damage is modified as follows, in this order.
- If the damage is less than 1, it equals 1. If the damage is greater than 999, it equals 999.
- Next, an effectiveness multiplier is created. This multiplier begins at 1.
(This process will be called the "type effectiveness process".)
- If there is no opponent, the effectiveness multiplier is 1 and processing stops.
- For each type the defender has:
- If the attack's type has "little effect" against that type, effectiveness is halved (actually, multiplied by 32768/65536).
- If the attack's type is "not very effective" against that type, multiply the effectiveness by 58982/65536.
- If the attack's type is "super effective" against that type, multiply the effectiveness by 98304/65536.
- As an exception, if the defender is exposed, Normal- and Fighting-type attacks have normal effectiveness against the Ghost type.
- If the defender has Wonder Guard and the attack is neither typeless nor "super effective" against the defender, the effectiveness is 0.
- If the defender has Thick Fat and the attack is a Fire or Ice type, the effectiveness is halved.
- If the attack is a Fire type and the defender has Flash Fire, the effectiveness multiplier is 0.
- If the attack is a Ground type and the defender has Levitate, the effectiveness multiplier is 0.
- If the attack is a Water type, attacker has Torrent, and floor(Total HP/4)>=Current HP, effectiveness is doubled.
- If the attack is a Grass type, attacker has Overgrow, and floor(Total HP/4)>=Current HP, effectiveness is doubled.
- If the attack is a Bug type, attacker has Swarm, and floor(Total HP/4)>=Current HP, effectiveness is doubled.
- If the attack is a Fire type, attacker has Blaze, and floor(Total HP/4)>=Current HP, effectiveness is doubled.
- If the attacker shares a type with the attack's type, multiply the effectiveness by 1.5.
- If the current weather is Sunny, the effectiveness is multiplied by 1.5 (actually 98304/65536) if the attack is a Fire type, and halved if the attack is a Water type.
- If the current weather is Rainy, the effectiveness is multiplied by 1.5 (actually 98304/65536) if the attack is a Water type, and halved if the attack is a Fire type.
- If the current weather is Cloudy and the attack isn't of the Normal type, the effectiveness is multiplied by 3/4 (actually 49152/65536).
- If the floor's status is Mud Sport or the current weather is Fog; and the attack is an Electric type, the effectiveness is halved.
- If the floor's status is Water Sport and the attack is a Fire type, the effectiveness is halved.
- If the attacker has the Charging status and the attack is an Electric type, the effectiveness is doubled.
- If the attack is a Fire type and the defender has Flash Fire, and the attack was the first Fire-type attack this turn, the defender's Flash Fire rate increases by 1 up to a maximum of 2. The Flash Fire rate is reset to 0 when the defender leaves the floor.
- If the defender has the Reflect status and the attack is a physical attack, or if the defender has the Light Screen status and the attack is a special attack, the effectiveness is halved. (Reflect and Light Screen are mutually exclusive.)
- If the attack is a critical hit (see "Critical Hits", below), the effectiveness is multiplied by 1.5.
- The damage is multiplied by the effectiveness multiplier.
- The damage is multiplied by an additional multiplier specific to the attack. This multiplier is usually equal to 1. For example, if the defender is using Dig and the attack is Earthquake, this value equals 2.
- The damage is multiplied by ((57344+X)/65536) where X is a random number from 0 through 16383.
- The damage is rounded to the nearest whole number.
Critical Hits
- If the defender has Battle Armor or Shell Armor, the attack can't be a critical hit.
- A variable, C, is set to the move's initial critical hit rate (see "Crit" in the list of moves).
- If Focus Energy is in effect for attacker, set C to 999.
- Otherwise:
- If the attacker is holding Scope Lens, add 40 to C.
- If the defender is holding Patsy Band, add 40 to C.
- If there is no defender or the attack is "super effective" against the defender; and Type-Advantage Master is enabled for the attacker, set C to 40.
- If a random number from 0 through 99 is less than C, the attack is a critical hit.
Fixed Damage
For moves that deal a fixed amount of damage, such as Magnitude, the following process is used instead. Such moves use the words "fixed damage" in their descriptions.
- If the damage is less than 1, it equals 1. If the damage is greater than 999, it equals 999.
- Follow the type effectiveness process above.
- The damage is multiplied by the effectiveness multiplier.
- The damage is rounded to the nearest whole number.
This process is not to be confused with effects that simply reduce HP.
Exceptions
In the normal damage calculation process, the defender is always dealt 1 damage in at least one of these cases:
- When the attacker's Belly is empty and the attacker isn't the team leader.
- When the attacker uses its regular attack and the defender has Wonder Guard.
The exceptions above don't apply to fixed damage.