Damage calculation
The damage dealt when a Pokémon uses a damaging move depends on its Attack or Special Attack-stat, the opponent's corresponding Defense-stat, the move's base damage. In addition, various circumstances, such as type-weaknesses, STAB-bonus, will intensify or weaken the damage of the move.
The damage formula is, from Serebii.net, the following:
level is the level of the damaging Pokémon; stabbonus is 1.5 if the Pokémon is the same type as the attack, 1 otherwise; modifier is the type advantage/disadvantage (Super effective, Not very effective) modifier; and finally rand is a number between 0.85 and 1.00 inclusive. If the move is a physical move, attack is the working Attack-stat of the damaging Pokémon, and defense is the working Defense-stat of the victim; if the move is special, attack is the special attack stat, and defense is the special defense stat.
Example
Let's say our level 75 Glaceon has the following stats:
HP: 201
Attack: 123
Defense: 181
It uses the move Ice Fang (Ice, physical, base damage 65) against Cynthia's level 78 Garchomp:
HP: 270
Attack: 210
Defense: 163
(stats do not represent the actual Garchomp used by Cynthia)
Garchomp is Dragon/Ground, so it has a double weakness to Ice. Thus, modifier = 4. Additionally, Glaceon receives a STAB-bonus, so stabbonus = 1.5. We insert the relevant values and stats in the parameters of damage and get:
File:Damageformula-example.png
Depending on luck, Glaceon will do damage in the range 170-200 HP. Despite Garchomp's double weakness to Ice, Glaceon's Ice Fang will not kill it off in a single hit.
Garchomp is up next. Garchomp used Earthquake! A physical Ground move at 100 base damage. With its Ice-type, Glaceon is weak to Garchomp's attack, so modifier = 2. Garchomp is dragon/ground, so it receives STAB-bonus at stabbonus = 1.5. We insert the stats and values in the formula and get:
File:Damageformula-example2.png
Glaceon fainted! Red whited out!