v0.1 ⌊ALPHA⌉
On this page
  1. Pokémon, Generations 1–3
  2. Related
  3. References
  4. Sources

A damage formula turns an attack into hit points lost. The atlas has read only the Pokémon disassemblies so far.

#Pokémon, Generations 1–3

Pokémon Red and Blue, Pokémon Crystal, and Pokémon Emerald apply STAB and type effectiveness to base damage, then the random factor1,2,3. Red/Blue’s base damage is ⌊⌊(⌊2L/5⌋+2)⋅P⋅A/D⌋/50⌋, ≤997, +24. The random factor is ×217–255 / 2555 in Red/Blue and Crystal6, and ×85–100 / 1007 in Emerald.

Type also picks the stats: in all three games, a move’s type makes it physical or special8,9,10.

References

  1. ^In Red and Blue, a damaging move runs CriticalHitTest, CalculateDamage (base formula), AdjustDamageForMoveType (STAB, then type rows), RandomizeDamage, and then MoveHitTest (accuracy). T3pret/pokered · engine/battle/core.asm L3140–3150, L5531–5543
  2. ^A plain damaging move runs critical, damagestats, damagecalc (base formula, item boosts, and critical ×2), stab (weather, badges, STAB, and type rows), damagevariation, and then checkhit (accuracy). T3pret/pokecrystal · data/moves/effects.asm L5–14, engine/battle/effect_commands.asm L2983–3023
  3. ^A plain damaging move runs critcalc, damagecalc (base damage), typecalc (STAB, then type rows), and then adjustnormaldamage (random factor). T3pret/pokeemerald · data/battle_scripts_1.s L249–252
  4. ^CalculateDamage computes ⌊⌊(⌊2×Level/5⌋+2)×Power×Attack/Defense⌋/50⌋, caps it at 997, and adds 2, so the type step receives 2–999. T3pret/pokered · engine/battle/core.asm L4343–4459
  5. ^RandomizeDamage multiplies damage by a random byte, 217–255, and integer-divides by 255, leaving 0 or 1 damage untouched. T3pret/pokered · engine/battle/core.asm L5420–5454, macros/data.asm L3
  6. ^The random factor is unchanged from Red/Blue, a random byte from 217 to 255 over 255. T3pret/pokecrystal · engine/battle/effect_commands.asm L1496–1544
  7. ^The random factor changes form: damage × (100 − rand % 16) / 100, i.e. 85–100 %, raised to 1 if that gives 0. T3pret/pokeemerald · src/battle_script_commands.c L1639–1651
  8. ^Type picks the stats: Fire, Water, Grass, Electric, Psychic, Ice, and Dragon (SPECIAL upward) use Special on both sides; the rest use Attack against Defense. T3pret/pokered · engine/battle/core.asm L4040–4042, constants/type_constants.asm L19–26
  9. ^Type still picks the stats: Steel is physical (below SPECIAL); Dark is special, using Special Attack against Special Defense. T3pret/pokecrystal · engine/battle/effect_commands.asm L2543–2545, constants/type_constants.asm L9–35
  10. ^Type still decides physical or special in Emerald, by its position relative to TYPE_MYSTERY. T3pret/pokeemerald · include/battle.h L466–467

Sources

Code