Facts
Games
7 · 1996–2004
Evidence
Code (51)
Wiki (4)
Sources
13
On this page
  1. How it works
  2. Implementations
  3. What changed, Gen 1 → Gen 3
  4. Variants and combinations
  5. History
  6. Related
  7. References
  8. Sources

Every Pokémon move has a type, and every Pokémon has one or two. The type chart rates each attacking type against each defending type: ×2, ×½, ×0, or ×1 if unlisted1,2. A dual-type defender takes both matchups, multiplied3. The pret disassemblies and decompilation make the code of Pokémon Red and Blue, Pokémon Crystal, and Pokémon Emerald readable.

#How it works

The chart lists only non-neutral pairs, as (attacking type, defending type, multiplier) rows2. Red/Blue’s has 15 types, 82 rows2; Crystal’s and Emerald’s have 17 types, 108 + 2 rows11. Multipliers are integers scaled by 10: 20 · 10 · 05 · 00 (÷10)1.

In Generations 1–3, the chart runs after the base damage formula and before the random factor27,28,29. The same-type attack bonus (STAB) comes first: d+⌊d/2⌋30 in Red/Blue and Crystal31, ⌊d×15/10⌋32 in Emerald. The two forms agree for every non-negative integer32. Each matching row then costs one multiply and one integer divide, ⌊d×m/10⌋ per row3,14,21.

damage = base_damage(level, power, attack, defense)        # see damage-formula
if move.type in attacker.types:                            # STAB, before the chart
    damage = damage + floor(damage / 2)                     # Gen 3 writes floor(damage * 15 / 10)
for (atk, def, m) in TYPE_CHART, in table order:
    if atk == move.type and def in defender.types:
        damage = floor(damage * m / 10)                     # truncates after every row
        Gen 1:      if damage == 0: the move misses
        Gen 2 / 3:  if damage == 0 and m != 0: damage = 1
damage = random_factor(damage)

Interactive: type-matrix (needs JavaScript)

Type charts of Red/Blue, Crystal and Emerald, from pret. Switch generation to see changes; click a cell or use the picker to replay a hit’s integer math. Numbers link to their claims.

#Truncation makes row order matter

A net-neutral hit whose ½ row precedes its 2× row loses 1 point on odd damage33. Ice against Water/Flying goes 3 → 1 → 233,34,35.

#Implementations

#Red and Blue (Generation 1)

Red and Blue36 do it all in one routine: STAB, then a walk of the full type chart3. Single-type Pokémon store their type twice, but each row applies once3.

  • Zero means miss. A row that leaves 0 damage flags a miss, which is also how ×0 works3. Under two ½ rows (×¼), damage goes 2 or 3 → 0 (miss)4.
  • The message follows the last row. Each matching row overwrites one effectiveness byte5. Ice against Water/Flying, net ×1, prints “It’s super effective!”37. Ground against Rock/Flying does no damage but prints the plain miss text, not “It doesn’t affect…”38.
  • Fixed-damage moves skip the chart. Sonic Boom, Seismic Toss, Dragon Rage, Night Shade, Psywave, and Super Fang bypass the formula and the type routine7.
  • The trainer AI reads one row, the first matching either defender type, so it ignores 4× weaknesses and canceling pairs8.
  • Type picks the stats. Fire, Water, Grass, Electric, Psychic, Ice, and Dragon moves use Special on both sides; the rest use Attack against Defense39.
  • An unused type. The constants define a BIRD type that no row mentions40.

Pokémon Yellow’s type chart file is byte for byte Red and Blue’s, with Ghost still no effect on Psychic9.

#Crystal (Generation 2)

Crystal41 adds Steel and Dark12. The work moves into the STAB battle command, which applies weather and badge boosts before STAB31. Struggle skips the routine42.

  • Immunity is explicit. A ×0 row marks a miss15. Any other step that truncates to 0 gives 1, so ×¼ no longer misses: 2 → 1 → 143.
  • The message uses the whole product17, so Ice against Water/Flying prints nothing44.
  • Foresight. The Normal→Ghost and Fighting→Ghost immunities follow a marker row, where the loop stops once the target is identified16.
  • Steel and Dark keep the type-based split: Steel is physical, and Dark is special45.

#Emerald (Generation 3)

Emerald46 keeps Crystal’s chart row for row20, as a flat byte array with the Foresight marker as its own row19,23. The arithmetic is unchanged21.

  • Messages come from flags. A ½ row and a 2× row cancel, and a ×0 row sets “doesn’t affect”22.
  • Abilities act as extra immunities. Levitate makes Ground moves miss, so the loop reads no row24. Wonder Guard lets only super-effective hits through25.
  • Carried over. Struggle skips STAB and the chart47. Type decides physical or special48. The unused slot becomes type 9, “???”49.

#What changed, Gen 1 → Gen 3

Red/BlueCrystalEmerald
Types15217, adds Steel and Dark121719
Matchups changed—4, listed below13none20
Step that reaches 0move misses3raised to 1; ×0 is a miss14raised to 1 unless ×021
Effectiveness textlast matching row5combined value17flags, ½ and 2× cancel22
Immunity removersnoneForesight16Foresight23
Random factor×217–255 / 25550×217–255 / 25551×85–100 / 10052

A cell-by-cell diff of the Red/Blue and Crystal tables gives +Steel, +Dark, 4 changed13. The four changes are Poison→Bug ×2 → ×1, Bug→Poison ×2 → ×½, Ghost→Psychic ×0 → ×2, and Ice→Fire ×1 → ×½13. Bulbapedia lists the same four13.

#Ghost and Psychic in Generation 1

Red and Blue’s table gives Ghost moves ×06 against Psychic types, but a Saffron Gym trainer says “Psychic #MON fear only ghosts and bugs!”53. Crystal’s table gives ×254. Bulbapedia reports that “an abundance of evidence suggests that this may have been an error”55.

#Variants and combinations

  • STAB runs in the same routine, directly before the chart, in all three games30,31,32.
  • Damage formula: in Gen 1–3, type also makes a move physical or special39,45,48.

#History

The chart ran from Red and Green (Japan, 1996) through Emerald (2004)36,46.

Gold and Silver, Ruby and Sapphire, and FireRed and LeafGreen keep the charts of the games beside them10,18,26.

Every claim about this mechanic, by game (55)
Arcana 1992Monsters carry race bits (bit 1 marks the undead), and a weapon hit scales by them: when neither side has race bits of its own the factor is 1; otherwise it is 1.2 when the attacker's race bits, its weapon's included, meet the target's, and 0.61 when they don't. A party member has none of its own, so it hits a monster with race bits at 0.61 unless its weapon carries a matching bit, and at 1.2 with one. Against a party member, the target's bits are the ones its armor and shield don't carry, so a monster with race bits hits at 1.2 unless the defender's armor or shield carries all of them.Code
Pokémon Red and Blue 1996Red and Blue's type chart has 82 non-neutral (attacker, defender, multiplier) rows over 15 types, ended by -1; unlisted pairs are neutral.Code
Multipliers are integers scaled by 10 (20 for “super effective”, 05 for “not very effective”, and 00 for no effect); the table never uses 10 (effective) or 15 (more effective).Code
The type-adjustment routine applies STAB before any type row: damage+⌊damage/2⌋ when the move's type matches either attacker type.Code
In table order, each type chart row matching the move's type and either defender type sets damage to ⌊damage×value/10⌋; 0 marks a miss.Code
Under two ½ rows (×¼), 2 or 3 damage truncates to 0 and the move misses; 4 damage gives 1.Code
Truncating after each row can cost a hit that nets ×1 damage when its ½ row comes first: Ice against Water/Flying takes 3 to ⌊3 × 5 / 10⌋ = 1, then ⌊1 × 20 / 10⌋ = 2, not 3.Code
The Red/Blue type chart gives Ghost-type moves no effect on Psychic types.Code
In Red and Blue, a Saffron Gym trainer's after-battle line, “Psychic #MON fear only ghosts and bugs!”, contradicts the game's own type chart, under which Ghost-type moves have no effect on Psychic types.Code
Bulbapedia reports that “an abundance of evidence suggests” the Gen 1 Ghost → Psychic ×0 “may have been an error”.Wiki
Each matching row overwrites one damage-multiplier byte, so the text follows the last row: above 10 is “super effective”, below 10 “not very effective”, and a miss reads “doesn't affect” only at 0.Code
An Ice move against a Water/Flying Pokémon nets ×1 damage, a ½ row and then a 2× row, yet prints “It's super effective!”, since the message reads only the last matching row's value, 20, and compares it with 10.Code
Earthquake against a Rock/Flying Pokémon does 0 damage and prints that the attack missed, not “It doesn't affect”: the Ground-against-Flying row (×0) zeroes the damage and makes the move miss, but the message reads the last matching row's value, Ground against Rock's ×2, and only a 0 there picks “doesn't affect”.Code
Moves on the set-damage list (Sonic Boom, Seismic Toss, Dragon Rage, Night Shade, Psywave, and Super Fang) jump to the hit test, skipping the base-damage routine and the type-adjustment routine, the only damage routine that reads the type chart.Code
The trainer AI's type-effectiveness lookup stops at the first row matching either defender type, ignoring dual-type products.Code
The type constants still define a Bird type ($06), with a name string, but no type chart row names it.Code
Type picks the stats: Fire, Water, Grass, Electric, Psychic, Ice, and Dragon (the first special type upward) use Special on both sides; the rest use Attack against Defense.Code
In Red and Blue, a damaging move runs the critical-hit test, the base formula, the type adjustment (STAB, then type rows), the random factor, and then the hit test (accuracy).Code
Pokémon Yellow 1998Yellow's type chart file is byte-for-byte Red and Blue's, the same 82 rows over 15 types, with Ghost still no effect on Psychic.Code
Yellow keeps Red and Blue's routine that adjusts damage for the move's type, so STAB is still damage+⌊damage/2⌋ before the type rows.Code
Pokémon Gold and Silver 1999Gold and Silver's type chart already has the 17 types (computed from the type constants), Steel and Dark included, and Ghost's ×2 on Psychic (a factor of 20 over 10), so these date from Gold and Silver; Crystal's chart has these rows too.Code
Pokémon Crystal 2000Crystal's type chart has 108 non-neutral rows over 17 types, then a -2 marker, Normal→Ghost and Fighting→Ghost ×0, and a -1 end.Code
Multipliers are unchanged from Red/Blue: scaled by 10, with 20 for “super effective”, 05 for “not very effective”, 00 for no effect, and 10 for effective.Code
Crystal's type constants add Steel (physical), Dark (special), and an unused curse type named “???”; the Bird type remains, still with no rows.Code
The STAB battle command applies weather and badge type boosts, then STAB (damage+⌊damage/2⌋ if either attacker type matches), then the type chart.Code
Struggle returns from the STAB battle command at once, so it skips weather, badge boosts, STAB, and the type chart.Code
Each type chart row matching the move's type and either defender type computes damage×value; a nonzero product becomes ⌊product/10⌋, raised to 1 if that truncates to 0, and a zero product stays 0.Code
In Crystal, a ×0 type chart row makes the move miss as soon as it matches, where Red and Blue mark a miss only when the damage reaches 0.Code
A ×¼ hit no longer truncates to a miss: 2 damage through two ½ rows gives ⌊2 × 5 / 10⌋ = 1, then ⌊1 × 5 / 10⌋ = 0, raised to 1.Code
Against a target hit by Foresight, the type chart is read only up to an end marker placed before the Normal-against-Ghost and Fighting-against-Ghost immunities, so those two rows are skipped.Code
After the loop, the type matchup check's combined value (m=⌊m×row/10⌋ from 10) replaces the effectiveness byte, so the text reflects every row: ×4 is 40, ×¼ is 2, and ½ with 2× is 10.Code
An Ice move against a Water/Flying Pokémon prints no effectiveness message in Crystal: the message reads a combined value that starts at 10 and is multiplied by each matching row's value and divided by 10, here 10 → 5 → 10.Code
As in Red and Blue, row order matters: an Ice move against a Water/Flying Pokémon takes 3 damage to ⌊3 × 5 / 10⌋ = 1 at the ½ row, then to ⌊1 × 20 / 10⌋ = 2 at the 2× row, not 3.Code
Crystal's type chart makes Ghost-type moves super effective on Psychic types.Code
Crystal's table adds Steel and Dark and changes four Red/Blue matchups: Poison→Bug ×2 → ×1, Bug→Poison ×2 → ×½, Ghost→Psychic ×0 → ×2, and Ice→Fire ×1 → ×½.Code
Type still picks the stats: Steel is physical (numbered below the first special type); Dark is special, using Special Attack against Special Defense.Code
A plain damaging move takes these steps in order: the critical-hit roll; loading the attacking and defending stats; the base damage formula, then held-item type boosts and the critical ×2; then weather, badge type boosts, the same-type ×1.5, and the type chart rows; then the random factor; and last the accuracy check.Code
Pokémon Ruby and Sapphire 2002Ruby and Sapphire's type chart holds the same 110 rows as Emerald's and Crystal's, in the same order, with literal 0xFE and 0xFF bytes where Emerald names them as constants.Code
Ruby and Sapphire's type-calculation command applies STAB as damage×15/10 before the type rows, as Emerald's does.Code
Pokémon Emerald 2004Emerald's type chart is a flat byte array of 108 non-neutral (attacker, defender, multiplier) rows over 17 types, then a Foresight marker, two Ghost immunities, and an end marker.Code
Emerald keeps the Game Boy encoding: 20 super effective, 10 normal, 5 not effective, and 0 no effect.Code
Computed by comparing the two tables row by row: Emerald's type table holds the same 110 rows as Crystal's, in the same order, so no type is new and no matchup changed.Code
Type 9, named "???", sits between the physical and special types and has no rows.Code
Before the type chart, the type-calculation battle command applies STAB as damage×15/10 when either attacker type equals the move's type.Code
For each row of the move's type, the type-damage step runs once per distinct target type it matches: damage×multiplier/10, raised from 0 to 1 unless the multiplier is 0.Code
The text comes from flags the type-damage step sets per row: a 2× row cancels an earlier not-very-effective flag, a ½ row an earlier super-effective one, and ×0 sets "doesn't affect", clearing both.Code
Against a Foresight target, the loop breaks at the Foresight marker row, skipping the Normal→Ghost and Fighting→Ghost immunities after it.Code
Struggle skips the type-calculation battle command entirely, so neither STAB nor the type chart touches it.Code
The type-calculation battle command flags a Ground move against a Levitate target as missed and “doesn't affect”, and walks no type row.Code
After the type rows, a target with Wonder Guard makes a damaging move miss unless the move carries the super-effective flag without the not-very-effective one. The check is skipped on the charging turn of a two-turn move (Skull Bash, Razor Wind, Sky Attack, Solar Beam outside sunshine, the semi-invulnerable moves, and Bide), so it applies on the turn the move strikes.Code
Row order still matters: against a Water/Flying target, an Ice move's 3 damage becomes 1 at the Water row (½, rounded down), then 2 at the Flying row (×2); computed, the opposite order would give 3.Code
Type still decides physical or special in Emerald, by whether it comes before or after type 9, "???".Code
A plain damaging move rolls for a critical hit, computes the base damage, applies the type step (STAB, then the type rows), and then applies the random factor.Code
Pokémon FireRed and LeafGreen 2004FireRed and LeafGreen's type chart is Emerald's, entry for entry: 108 matchup rows, the Foresight marker, two Ghost immunities, and the end marker.Code
FireRed and LeafGreen keep Emerald's STAB, damage×15/10 before the type rows; their type-calculation command differs from Emerald's only in how it names the defender's types.Code

References

  1. ^ abCodepret/pokeredbattle_constants.asm 60–65
    How we know

    Multipliers are integers scaled by 10 (20 for “super effective”, 05 for “not very effective”, and 00 for no effect); the table never uses 10 (effective) or 15 (more effective).

    60; type effectiveness factors, scaled by 10
    61DEF SUPER_EFFECTIVE    EQU 20
    62DEF MORE_EFFECTIVE     EQU 15
    63DEF EFFECTIVE          EQU 10
    64DEF NOT_VERY_EFFECTIVE EQU 05
    65DEF NO_EFFECT          EQU 00
    
    constants/battle_constants.asm lines 60–65 at af51989 · upstream ↗

    Claim page

  2. ^ abcdeCodepret/pokeredtype_matchups.asm 1–85; type_constants.asm 1–28
    How we know

    Red and Blue's type chart has 82 non-neutral (attacker, defender, multiplier) rows over 15 types, ended by -1; unlisted pairs are neutral.

    1TypeEffects:
    2	;  attacker,     defender,     *=
    3	db WATER,        FIRE,         SUPER_EFFECTIVE
    ⋮
    85	db -1 ; end
    
    data/types/type_matchups.asm lines 1–85 at af51989 · upstream ↗
    constants/type_constants.asm#L1-L28 · upstream ↗

    Claim page

  3. ^ abcdefgCodepret/pokeredcore.asm 5127–5185
    How we know

    In table order, each type chart row matching the move's type and either defender type sets damage to ⌊damage×value/10⌋; 0 marks a miss.

    5161	call Multiply
    5162	ld a, 10
    5163	ldh [hDivisor], a
    5164	ld b, 4
    5165	call Divide
    
    engine/battle/core.asm lines 5127–5185 at af51989 · upstream ↗

    Claim page

  4. ^ abCodepret/pokeredcore.asm 5150–5176; battle_constants.asm 64; +1 files
    How we know

    Under two ½ rows (×¼), 2 or 3 damage truncates to 0 and the move misses; 4 damage gives 1.

    5150	ld a, [hl] ; a = damage multiplier
    5151	ldh [hMultiplier], a
    ⋮
    5161	call Multiply
    5162	ld a, 10
    5163	ldh [hDivisor], a
    5164	ld b, 4
    5165	call Divide
    ⋮
    5171	or b ; is damage 0?
    5172	jr nz, .skipTypeImmunity
    5173; if damage is 0, make the move miss
    5174; this only occurs if a move that would do 2 or 3 damage is 0.25x effective against the target
    5175	inc a
    ⋮
    
    engine/battle/core.asm lines 5150–5176 at af51989 · upstream ↗
    64DEF NOT_VERY_EFFECTIVE EQU 05
    
    constants/battle_constants.asm line 64 at af51989 · upstream ↗
    14	db GRASS,        GRASS,        NOT_VERY_EFFECTIVE
    
    data/types/type_matchups.asm line 14 at af51989 · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    1 more excerpts on the claim page

  5. ^ abcCodepret/pokeredcore.asm 5147–5153, 3718–3733, 3218–3229; display_effectiveness.asm 1–10
    How we know

    Each matching row overwrites one damage-multiplier byte, so the text follows the last row: above 10 is “super effective”, below 10 “not very effective”, and a miss reads “doesn't affect” only at 0.

    5150	ld a, [hl] ; a = damage multiplier
    5151	ldh [hMultiplier], a
    5152	add b
    5153	ld [wDamageMultipliers], a
    
    engine/battle/core.asm lines 5147–5153 at af51989 · upstream ↗
    2	ld a, [wDamageMultipliers]
    3	and $7F
    4	cp EFFECTIVE
    
    engine/battle/display_effectiveness.asm lines 1–10 at af51989 · upstream ↗
    engine/battle/core.asm#L3718-L3733 · upstream ↗
    engine/battle/core.asm#L3218-L3229 · upstream ↗

    Claim page

  6. ^ abCodepret/pokered · Bulbapedia, “Type/Type chart”type_matchups.asm 78
    How we know

    The Red/Blue type chart gives Ghost-type moves no effect on Psychic types.

    78	db GHOST,        PSYCHIC_TYPE, NO_EFFECT
    
    data/types/type_matchups.asm line 78 at af51989 · upstream ↗
    Ghost was made 2× against Psychic instead of 0×.
    Changes: Between Generations I and II · archived copy ↗

    Claim page

  7. ^ abCodepret/pokeredcore.asm 3134–3139; set_damage_effects.asm 1–6; +1 files
    How we know

    Moves on the set-damage list (Sonic Boom, Seismic Toss, Dragon Rage, Night Shade, Psywave, and Super Fang) jump to the hit test, skipping the base-damage routine and the type-adjustment routine, the only damage routine that reads the type chart.

    3139	jp c, .moveHitTest ; SetDamageEffects moves (e.g. Seismic Toss and Super Fang) skip damage calculation
    
    engine/battle/core.asm lines 3134–3139 at af51989 · upstream ↗
    4	db SUPER_FANG_EFFECT
    5	db SPECIAL_DAMAGE_EFFECT
    
    data/battle/set_damage_effects.asm lines 1–6 at af51989 · upstream ↗
    data/moves/moves.asm#L62 · upstream ↗

    Claim page

  8. ^ abCodepret/pokeredcore.asm 5187–5223; trainer_ai.asm 207–216
    How we know

    The trainer AI's type-effectiveness lookup stops at the first row matching either defender type, ignoring dual-type products.

    5188; this doesn't take into account the effects that dual types can have
    5189; (e.g. 4x weakness / resistance, weaknesses and resistances canceling)
    ⋮
    5201	ld [wTypeEffectiveness], a
    ⋮
    5203.loop
    5204	ld a, [hli]
    5205	cp $ff
    5206	ret z
    5207	cp d                      ; match the type of the move
    5208	jr nz, .nextTypePair1
    5209	ld a, [hli]
    5210	cp b                      ; match with type 1 of pokemon
    5211	jr z, .done
    ⋮
    
    engine/battle/core.asm lines 5187–5223 at af51989 · upstream ↗
    211	ld a, [wTypeEffectiveness]
    212	cp $10
    
    engine/battle/trainer_ai.asm lines 207–216 at af51989 · upstream ↗

    Claim page

  9. ^ abCodepret/pokeyellow · pret/pokeredtype_matchups.asm 1–85, 1–85
    How we know

    Yellow's type chart file is byte-for-byte Red and Blue's, the same 82 rows over 15 types, with Ghost still no effect on Psychic.

    1TypeEffects:
    2	;  attacker,     defender,     *=
    3	db WATER,        FIRE,         SUPER_EFFECTIVE
    ⋮
    78	db GHOST,        PSYCHIC_TYPE, NO_EFFECT
    ⋮
    84	db DRAGON,       DRAGON,       SUPER_EFFECTIVE
    85	db -1 ; end
    
    data/types/type_matchups.asm lines 1–85 at b6696f2 · upstream ↗
    1TypeEffects:
    2	;  attacker,     defender,     *=
    3	db WATER,        FIRE,         SUPER_EFFECTIVE
    ⋮
    78	db GHOST,        PSYCHIC_TYPE, NO_EFFECT
    ⋮
    84	db DRAGON,       DRAGON,       SUPER_EFFECTIVE
    85	db -1 ; end
    
    data/types/type_matchups.asm lines 1–85 at af51989 · upstream ↗

    Claim page

  10. ^ abCodepret/pokegold · pret/pokecrystaltype_matchups.asm 1–118, 1–118; type_constants.asm 9–37; +2 files
    How we know

    Gold and Silver's type chart already has the 17 types (computed from the type constants), Steel and Dark included, and Ghost's ×2 on Psychic (a factor of 20 over 10), so these date from Gold and Silver; Crystal's chart has these rows too.

    1TypeMatchups:
    ⋮
    50	db FIGHTING,     DARK,         SUPER_EFFECTIVE
    ⋮
    94	db GHOST,        PSYCHIC_TYPE, SUPER_EFFECTIVE
    ⋮
    101	db DARK,         PSYCHIC_TYPE, SUPER_EFFECTIVE
    ⋮
    108	db STEEL,        ICE,          SUPER_EFFECTIVE
    ⋮
    112	db -2 ; end (with Foresight)
    ⋮
    118	db -1 ; end
    
    data/types/type_matchups.asm lines 1–118 at fc702b6 · upstream ↗
    1TypeMatchups:
    ⋮
    50	db FIGHTING,     DARK,         SUPER_EFFECTIVE
    ⋮
    94	db GHOST,        PSYCHIC_TYPE, SUPER_EFFECTIVE
    ⋮
    101	db DARK,         PSYCHIC_TYPE, SUPER_EFFECTIVE
    ⋮
    108	db STEEL,        ICE,          SUPER_EFFECTIVE
    ⋮
    112	db -2 ; end (with Foresight)
    ⋮
    118	db -1 ; end
    
    data/types/type_matchups.asm lines 1–118 at 97187cd · upstream ↗
    9DEF PHYSICAL EQU const_value
    10	const NORMAL
    11	const FIGHTING
    12	const FLYING
    13	const POISON
    14	const GROUND
    15	const ROCK
    16	const BIRD
    17	const BUG
    18	const GHOST
    19	const STEEL
    ⋮
    21DEF UNUSED_TYPES EQU const_value
    ⋮
    
    constants/type_constants.asm lines 9–37 at fc702b6 · upstream ↗

    2 more excerpts on the claim page

  11. ^ abCodepret/pokecrystaltype_matchups.asm 1–118; type_constants.asm 7–37
    How we know

    Crystal's type chart has 108 non-neutral rows over 17 types, then a -2 marker, Normal→Ghost and Fighting→Ghost ×0, and a -1 end.

    112	db -2 ; end (with Foresight)
    ⋮
    114; Foresight removes Ghost's immunities.
    115	db NORMAL,       GHOST,        NO_EFFECT
    116	db FIGHTING,     GHOST,        NO_EFFECT
    
    data/types/type_matchups.asm lines 1–118 at 97187cd · upstream ↗
    constants/type_constants.asm#L7-L37 · upstream ↗

    Claim page

  12. ^ abcCodepret/pokecrystaltype_constants.asm 9–37; names.asm 37
    How we know

    Crystal's type constants add Steel (physical), Dark (special), and an unused curse type named “???”; the Bird type remains, still with no rows.

    19	const STEEL
    ⋮
    23	const CURSE_TYPE
    ⋮
    34	const DARK
    
    constants/type_constants.asm lines 9–37 at 97187cd · upstream ↗
    37CurseType: db "???@"
    
    data/types/names.asm line 37 at 97187cd · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    Claim page

  13. ^ abcdeCodepret/pokered · pret/pokecrystal · Bulbapedia, “Type/Type chart”type_matchups.asm 1–85, 1–118; battle_constants.asm 61–65, 21–25
    How we know

    Crystal's table adds Steel and Dark and changes four Red/Blue matchups: Poison→Bug ×2 → ×1, Bug→Poison ×2 → ×½, Ghost→Psychic ×0 → ×2, and Ice→Fire ×1 → ×½.

    48	db POISON,       BUG,          SUPER_EFFECTIVE
    ⋮
    70	db BUG,          POISON,       SUPER_EFFECTIVE
    ⋮
    78	db GHOST,        PSYCHIC_TYPE, NO_EFFECT
    
    data/types/type_matchups.asm lines 1–85 at af51989 · upstream ↗
    61DEF SUPER_EFFECTIVE    EQU 20
    ⋮
    63DEF EFFECTIVE          EQU 10
    64DEF NOT_VERY_EFFECTIVE EQU 05
    65DEF NO_EFFECT          EQU 00
    
    constants/battle_constants.asm lines 61–65 at af51989 · upstream ↗
    42	db ICE,          FIRE,         NOT_VERY_EFFECTIVE
    ⋮
    80	db BUG,          POISON,       NOT_VERY_EFFECTIVE
    ⋮
    94	db GHOST,        PSYCHIC_TYPE, SUPER_EFFECTIVE
    ⋮
    103	db DARK,         DARK,         NOT_VERY_EFFECTIVE
    ⋮
    110	db STEEL,        STEEL,        NOT_VERY_EFFECTIVE
    
    data/types/type_matchups.asm lines 1–118 at 97187cd · upstream ↗
    The Dark and Steel types were introduced. Bug was made ½× against Poison instead of 2×. Poison was made 1× against Bug instead of 2×. Ghost was made 2× against Psychic instead of 0×. Ice was made ½× against Fire instead of 1×.
    Changes: Between Generations I and II · archived copy ↗

    Measured by a script. It fails if the result disagrees with the claim.

    1 more excerpts on the claim page

  14. ^ abcCodepret/pokecrystaleffect_commands.asm 1291–1379; hram.asm 66–82
    How we know

    Each type chart row matching the move's type and either defender type computes damage×value; a nonzero product becomes ⌊product/10⌋, raised to 1 if that truncates to 0, and a zero product stays 0.

    1291	ld a, BATTLE_VARS_MOVE_TYPE
    1292	call GetBattleVar
    1293	ld b, a
    ⋮
    1297	ld a, [hli]
    ⋮
    1306	call GetBattleVar
    ⋮
    1312.SkipForesightCheck:
    1313	cp b
    1314	jr nz, .SkipType
    1315	ld a, [hl]
    1316	cp d
    1317	jr z, .GotMatchup
    1318	cp e
    ⋮
    
    engine/battle/effect_commands.asm lines 1291–1379 at 97187cd · upstream ↗
    66UNION
    67; inputs to Multiply
    68	ds 1
    69hMultiplicand:: ds 3
    70hMultiplier::   db
    71NEXTU
    72; result of Multiply
    73hProduct::      ds 4
    74NEXTU
    ⋮
    78NEXTU
    79; results of Divide
    80hQuotient::     ds 4
    
    ram/hram.asm lines 66–82 at 97187cd · upstream ↗

    Claim page

  15. ^ abCodepret/pokecrystaleffect_commands.asm 1329–1336; battle_constants.asm 25
    How we know

    In Crystal, a ×0 type chart row makes the move miss as soon as it matches, where Red and Blue mark a miss only when the damage reaches 0.

    1329; If the target is immune to the move, treat it as a miss and calculate the damage as 0
    1330	ld a, [hl]
    1331	and a
    1332	jr nz, .NotImmune
    1333	inc a
    1334	ld [wAttackMissed], a
    
    engine/battle/effect_commands.asm lines 1329–1336 at 97187cd · upstream ↗
    25DEF NO_EFFECT          EQU 00
    
    constants/battle_constants.asm line 25 at 97187cd · upstream ↗

    Claim page

  16. ^ abcCodepret/pokecrystaleffect_commands.asm 1302–1310; type_matchups.asm 112–118; +1 files
    How we know

    Against a target hit by Foresight, the type chart is read only up to an end marker placed before the Normal-against-Ghost and Fighting-against-Ghost immunities, so those two rows are skipped.

    1302	; foresight
    1303	cp -2
    1304	jr nz, .SkipForesightCheck
    1305	ld a, BATTLE_VARS_SUBSTATUS1_OPP
    1306	call GetBattleVar
    1307	bit SUBSTATUS_IDENTIFIED, a
    1308	jr nz, .end
    
    engine/battle/effect_commands.asm lines 1302–1310 at 97187cd · upstream ↗
    112	db -2 ; end (with Foresight)
    ⋮
    114; Foresight removes Ghost's immunities.
    115	db NORMAL,       GHOST,        NO_EFFECT
    116	db FIGHTING,     GHOST,        NO_EFFECT
    ⋮
    118	db -1 ; end
    
    data/types/type_matchups.asm lines 112–118 at 97187cd · upstream ↗
    1BattleCommand_Foresight:
    ⋮
    4	jr nz, .failed
    ⋮
    7	jr nz, .failed
    ⋮
    9	ld a, BATTLE_VARS_SUBSTATUS1_OPP
    10	call GetBattleVarAddr
    11	bit SUBSTATUS_IDENTIFIED, [hl]
    12	jr nz, .failed
    ⋮
    14	set SUBSTATUS_IDENTIFIED, [hl]
    
    engine/battle/move_effects/foresight.asm lines 1–14 at 97187cd · upstream ↗

    Claim page

  17. ^ abcCodepret/pokecrystaleffect_commands.asm 1388–1396, 1405–1471, 2324–2333, 2197–2202
    How we know

    After the loop, the type matchup check's combined value (m=⌊m×row/10⌋ from 10) replaces the effectiveness byte, so the text reflects every row: ×4 is 40, ×¼ is 2, and ½ with 2× is 10.

    1389	call BattleCheckTypeMatchup
    1390	ld a, [wTypeMatchup]
    1391	ld b, a
    1392	ld a, [wTypeModifier]
    1393	and STAB_DAMAGE
    1394	or b
    1395	ld [wTypeModifier], a
    
    engine/battle/effect_commands.asm lines 1388–1396 at 97187cd · upstream ↗
    engine/battle/effect_commands.asm#L1405-L1471 · upstream ↗
    engine/battle/effect_commands.asm#L2324-L2333 · upstream ↗
    engine/battle/effect_commands.asm#L2197-L2202 · upstream ↗

    Claim page

  18. ^ abCodepret/pokeruby · pret/pokeemerald · pret/pokecrystaltype_effectiveness.inc 1–119; battle_main.c 335–449; +1 files
    How we know

    Ruby and Sapphire's type chart holds the same 110 rows as Emerald's and Crystal's, in the same order, with literal 0xFE and 0xFF bytes where Emerald names them as constants.

    1@ format: attacking type, defending type, damage multiplier
    ⋮
    116	.byte          0xFE,          0xFE,  0
    117	.byte   TYPE_NORMAL,    TYPE_GHOST,  0
    118	.byte TYPE_FIGHTING,    TYPE_GHOST,  0
    119	.byte          0xFF,          0xFF,  0
    
    data/type_effectiveness.inc lines 1–119 at 5784633 · upstream ↗
    335const u8 gTypeEffectiveness[336] =
    
    src/battle_main.c lines 335–449 at 731ad5b · upstream ↗
    1TypeMatchups:
    ⋮
    112	db -2 ; end (with Foresight)
    
    data/types/type_matchups.asm lines 1–118 at 97187cd · upstream ↗

    Claim page

  19. ^ abcCodepret/pokeemeraldbattle_main.c 329–449; pokemon.h 5–23
    How we know

    Emerald's type chart is a flat byte array of 108 non-neutral (attacker, defender, multiplier) rows over 17 types, then a Foresight marker, two Ghost immunities, and an end marker.

    329// format: attacking type, defending type, damage multiplier
    330// the multiplier is a (decimal) fixed-point number:
    ⋮
    445    TYPE_FORESIGHT, TYPE_FORESIGHT, TYPE_MUL_NO_EFFECT,
    446    TYPE_NORMAL, TYPE_GHOST, TYPE_MUL_NO_EFFECT,
    447    TYPE_FIGHTING, TYPE_GHOST, TYPE_MUL_NO_EFFECT,
    448    TYPE_ENDTABLE, TYPE_ENDTABLE, TYPE_MUL_NO_EFFECT
    
    src/battle_main.c lines 329–449 at 731ad5b · upstream ↗
    include/constants/pokemon.h#L5-L23 · upstream ↗

    Claim page

  20. ^ abcCodepret/pokecrystal · pret/pokeemerald · Bulbapedia, “Type/Type chart”type_matchups.asm 1–118; battle_main.c 335–449
    How we know

    Computed by comparing the two tables row by row: Emerald's type table holds the same 110 rows as Crystal's, in the same order, so no type is new and no matchup changed.

    3	db NORMAL,       ROCK,         NOT_VERY_EFFECTIVE
    4	db NORMAL,       STEEL,        NOT_VERY_EFFECTIVE
    ⋮
    112	db -2 ; end (with Foresight)
    
    data/types/type_matchups.asm lines 1–118 at 97187cd · upstream ↗
    337    TYPE_NORMAL, TYPE_ROCK, TYPE_MUL_NOT_EFFECTIVE,
    338    TYPE_NORMAL, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE,
    ⋮
    445    TYPE_FORESIGHT, TYPE_FORESIGHT, TYPE_MUL_NO_EFFECT,
    
    src/battle_main.c lines 335–449 at 731ad5b · upstream ↗
    This matchup table is used from Generation II to Generation V.
    Type charts: Generations II-V · archived copy ↗

    Measured by a script. It fails if the result disagrees with the claim.

    Claim page

  21. ^ abcdCodepret/pokeemeraldbattle_script_commands.c 1321–1325, 1386–1406
    How we know

    For each row of the move's type, the type-damage step runs once per distinct target type it matches: damage×multiplier/10, raised from 0 to 1 unless the multiplier is 0.

    1323    gBattleMoveDamage = gBattleMoveDamage * multiplier / 10;
    1324    if (gBattleMoveDamage == 0 && multiplier != 0)
    1325        gBattleMoveDamage = 1;
    
    src/battle_script_commands.c lines 1321–1325 at 731ad5b · upstream ↗
    1401                if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1] &&
    1402                    gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1])
    
    src/battle_script_commands.c lines 1386–1406 at 731ad5b · upstream ↗

    Claim page

  22. ^ abcCodepret/pokeemeraldbattle_script_commands.c 1327–1352
    How we know

    The text comes from flags the type-damage step sets per row: a 2× row cancels an earlier not-very-effective flag, a ½ row an earlier super-effective one, and ×0 sets "doesn't affect", clearing both.

    1331        gMoveResultFlags &= ~MOVE_RESULT_NOT_VERY_EFFECTIVE;
    ⋮
    1335        if (gBattleMoves[gCurrentMove].power && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
    ⋮
    1339            else
    ⋮
    1343    case TYPE_MUL_SUPER_EFFECTIVE:
    1344        if (gBattleMoves[gCurrentMove].power && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
    ⋮
    1346            if (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE)
    1347                gMoveResultFlags &= ~MOVE_RESULT_NOT_VERY_EFFECTIVE;
    1348            else
    1349                gMoveResultFlags |= MOVE_RESULT_SUPER_EFFECTIVE;
    
    src/battle_script_commands.c lines 1327–1352 at 731ad5b · upstream ↗

    Claim page

  23. ^ abcCodepret/pokeemeraldbattle_script_commands.c 1388–1394; battle_main.c 445–447
    How we know

    Against a Foresight target, the loop breaks at the Foresight marker row, skipping the Normal→Ghost and Fighting→Ghost immunities after it.

    1388            if (TYPE_EFFECT_ATK_TYPE(i) == TYPE_FORESIGHT)
    ⋮
    1390                if (gBattleMons[gBattlerTarget].status2 & STATUS2_FORESIGHT)
    1391                    break;
    
    src/battle_script_commands.c lines 1388–1394 at 731ad5b · upstream ↗
    src/battle_main.c#L445-L447 · upstream ↗

    Claim page

  24. ^ abCodepret/pokeemeraldbattle_script_commands.c 1375–1384
    How we know

    The type-calculation battle command flags a Ground move against a Levitate target as missed and “doesn't affect”, and walks no type row.

    1375    if (gBattleMons[gBattlerTarget].ability == ABILITY_LEVITATE && moveType == TYPE_GROUND)
    ⋮
    1377        gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
    1378        gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE);
    
    src/battle_script_commands.c lines 1375–1384 at 731ad5b · upstream ↗

    Claim page

  25. ^ abCodepret/pokeemeraldbattle_script_commands.c 1409–1414, 8221–8238
    How we know

    After the type rows, a target with Wonder Guard makes a damaging move miss unless the move carries the super-effective flag without the not-very-effective one. The check is skipped on the charging turn of a two-turn move (Skull Bash, Razor Wind, Sky Attack, Solar Beam outside sunshine, the semi-invulnerable moves, and Bide), so it applies on the turn the move strikes.

    1409    if (gBattleMons[gBattlerTarget].ability == ABILITY_WONDER_GUARD && AttacksThisTurn(gBattlerAttacker, gCurrentMove) == 2
    1410     && (!(gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) || ((gMoveResultFlags & (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE)) == (MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE)))
    1411     && gBattleMoves[gCurrentMove].power)
    ⋮
    1414        gMoveResultFlags |= MOVE_RESULT_MISSED;
    
    src/battle_script_commands.c lines 1409–1414 at 731ad5b · upstream ↗
    8221static u8 AttacksThisTurn(u8 battler, u16 move) // Note: returns 1 if it's a charging turn, otherwise 2
    ⋮
    8224    if (gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
    8225        && (gBattleWeather & B_WEATHER_SUN))
    8226        return 2;
    ⋮
    8228    if (gBattleMoves[move].effect == EFFECT_SKULL_BASH
    8229     || gBattleMoves[move].effect == EFFECT_RAZOR_WIND
    8230     || gBattleMoves[move].effect == EFFECT_SKY_ATTACK
    8231     || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
    8232     || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
    8233     || gBattleMoves[move].effect == EFFECT_BIDE)
    ⋮
    8235        if ((gHitMarker & HITMARKER_CHARGING))
    8236            return 1;
    ⋮
    
    src/battle_script_commands.c lines 8221–8238 at 731ad5b · upstream ↗

    Claim page

  26. ^ abCodepret/pokefirered · pret/pokeemeraldbattle_main.c 312–426, 335–449
    How we know

    FireRed and LeafGreen's type chart is Emerald's, entry for entry: 108 matchup rows, the Foresight marker, two Ghost immunities, and the end marker.

    312const u8 gTypeEffectiveness[336] =
    
    src/battle_main.c lines 312–426 at ce6406d · upstream ↗
    335const u8 gTypeEffectiveness[336] =
    
    src/battle_main.c lines 335–449 at 731ad5b · upstream ↗

    Claim page

  27. ^Codepret/pokeredcore.asm 3140–3150, 5531–5543
    How we know

    In Red and Blue, a damaging move runs the critical-hit test, the base formula, the type adjustment (STAB, then type rows), the random factor, and then the hit test (accuracy).

    3144	call CalculateDamage
    ⋮
    3147	call AdjustDamageForMoveType
    3148	call RandomizeDamage
    3149.moveHitTest
    3150	call MoveHitTest
    
    engine/battle/core.asm lines 3140–3150 at af51989 · upstream ↗
    engine/battle/core.asm#L5531-L5543 · upstream ↗

    Claim page

  28. ^Codepret/pokecrystaleffects.asm 5–14; effect_command_pointers.asm 12–16; +2 files
    How we know

    A plain damaging move takes these steps in order: the critical-hit roll; loading the attacking and defending stats; the base damage formula, then held-item type boosts and the critical ×2; then weather, badge type boosts, the same-type ×1.5, and the type chart rows; then the random factor; and last the accuracy check.

    5NormalHit:
    6	checkobedience
    7	usedmovetext
    8	doturn
    9	critical
    10	damagestats
    11	damagecalc
    12	stab
    13	damagevariation
    14	checkhit
    
    data/moves/effects.asm lines 5–14 at 97187cd · upstream ↗
    12	dw BattleCommand_Critical
    13	dw BattleCommand_DamageStats
    14	dw BattleCommand_Stab
    15	dw BattleCommand_DamageVariation
    16	dw BattleCommand_CheckHit
    
    data/battle/effect_command_pointers.asm lines 12–16 at 97187cd · upstream ↗
    1201	call BattleRandom
    1202	cp [hl]
    1203	ret nc
    1204	ld a, 1
    1205	ld [wCriticalHit], a
    
    engine/battle/effect_commands.asm lines 1201–1205 at 97187cd · upstream ↗

    7 more excerpts on the claim page

  29. ^Codepret/pokeemeraldbattle_scripts_1.s 249–252; battle_script_commands.c 1658–1662
    How we know

    A plain damaging move rolls for a critical hit, computes the base damage, applies the type step (STAB, then the type rows), and then applies the random factor.

    249	critcalc
    250	damagecalc
    251	typecalc
    252	adjustnormaldamage
    
    data/battle_scripts_1.s lines 249–252 at 731ad5b · upstream ↗
    1658static void Cmd_adjustnormaldamage(void)
    ⋮
    1662    ApplyRandomDmgMultiplier();
    
    src/battle_script_commands.c lines 1658–1662 at 731ad5b · upstream ↗

    Claim page

  30. ^ abCodepret/pokeredcore.asm 5101–5125
    How we know

    The type-adjustment routine applies STAB before any type row: damage+⌊damage/2⌋ when the move's type matches either attacker type.

    5116	srl b
    5117	rr c      ; bc = floor(0.5 * damage)
    5118	add hl, bc ; hl = floor(1.5 * damage)
    
    engine/battle/core.asm lines 5101–5125 at af51989 · upstream ↗

    Claim page

  31. ^ abcCodepret/pokecrystaleffect_commands.asm 1251–1288
    How we know

    The STAB battle command applies weather and badge type boosts, then STAB (damage+⌊damage/2⌋ if either attacker type matches), then the type chart.

    1251	farcall DoWeatherModifiers
    ⋮
    1258	farcall DoBadgeTypeBoosts
    ⋮
    1278	srl b
    1279	rr c
    1280	add hl, bc
    
    engine/battle/effect_commands.asm lines 1251–1288 at 97187cd · upstream ↗

    Claim page

  32. ^ abcCodepret/pokeemeraldbattle_script_commands.c 1368–1373; battle.h 471
    How we know

    Before the type chart, the type-calculation battle command applies STAB as damage×15/10 when either attacker type equals the move's type.

    1368    // check stab
    1369    if (IS_BATTLER_OF_TYPE(gBattlerAttacker, moveType))
    ⋮
    1371        gBattleMoveDamage = gBattleMoveDamage * 15;
    1372        gBattleMoveDamage = gBattleMoveDamage / 10;
    
    src/battle_script_commands.c lines 1368–1373 at 731ad5b · upstream ↗
    include/battle.h#L471 · upstream ↗

    Claim page

  33. ^ abCodepret/pokeredtype_matchups.asm 33–36; core.asm 5150–5170; +1 files
    How we know

    Truncating after each row can cost a hit that nets ×1 damage when its ½ row comes first: Ice against Water/Flying takes 3 to ⌊3 × 5 / 10⌋ = 1, then ⌊1 × 20 / 10⌋ = 2, not 3.

    33	db ICE,          WATER,        NOT_VERY_EFFECTIVE
    ⋮
    36	db ICE,          FLYING,       SUPER_EFFECTIVE
    
    data/types/type_matchups.asm lines 33–36 at af51989 · upstream ↗
    5150	ld a, [hl] ; a = damage multiplier
    5151	ldh [hMultiplier], a
    ⋮
    5161	call Multiply
    5162	ld a, 10
    5163	ldh [hDivisor], a
    5164	ld b, 4
    5165	call Divide
    5166	ldh a, [hQuotient + 2]
    5167	ld [hli], a
    5168	ld b, a
    5169	ldh a, [hQuotient + 3]
    5170	ld [hl], a
    
    engine/battle/core.asm lines 5150–5170 at af51989 · upstream ↗
    61DEF SUPER_EFFECTIVE    EQU 20
    ⋮
    64DEF NOT_VERY_EFFECTIVE EQU 05
    
    constants/battle_constants.asm lines 61–64 at af51989 · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    Claim page

  34. ^Codepret/pokecrystaltype_matchups.asm 35–39; battle_constants.asm 21–24
    How we know

    As in Red and Blue, row order matters: an Ice move against a Water/Flying Pokémon takes 3 damage to ⌊3 × 5 / 10⌋ = 1 at the ½ row, then to ⌊1 × 20 / 10⌋ = 2 at the 2× row, not 3.

    35	db ICE,          WATER,        NOT_VERY_EFFECTIVE
    ⋮
    39	db ICE,          FLYING,       SUPER_EFFECTIVE
    
    data/types/type_matchups.asm lines 35–39 at 97187cd · upstream ↗
    21DEF SUPER_EFFECTIVE    EQU 20
    ⋮
    24DEF NOT_VERY_EFFECTIVE EQU 05
    
    constants/battle_constants.asm lines 21–24 at 97187cd · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    Claim page

  35. ^Codepret/pokeemeraldbattle_main.c 369–373; battle_script_commands.c 1386–1405, 1321–1325; +1 files
    How we know

    Row order still matters: against a Water/Flying target, an Ice move's 3 damage becomes 1 at the Water row (½, rounded down), then 2 at the Flying row (×2); computed, the opposite order would give 3.

    369    TYPE_ICE, TYPE_WATER, TYPE_MUL_NOT_EFFECTIVE,
    ⋮
    373    TYPE_ICE, TYPE_FLYING, TYPE_MUL_SUPER_EFFECTIVE,
    
    src/battle_main.c lines 369–373 at 731ad5b · upstream ↗
    1386        while (TYPE_EFFECT_ATK_TYPE(i) != TYPE_ENDTABLE)
    ⋮
    1392                i += 3;
    ⋮
    1395            else if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
    ⋮
    1397                // check type1
    1398                if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0])
    1399                    ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i));
    1400                // check type2
    1401                if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1] &&
    1402                    gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1])
    1403                    ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i));
    ⋮
    1405            i += 3;
    
    src/battle_script_commands.c lines 1386–1405 at 731ad5b · upstream ↗
    1321static void ModulateDmgByType(u8 multiplier)
    ⋮
    1323    gBattleMoveDamage = gBattleMoveDamage * multiplier / 10;
    1324    if (gBattleMoveDamage == 0 && multiplier != 0)
    1325        gBattleMoveDamage = 1;
    
    src/battle_script_commands.c lines 1321–1325 at 731ad5b · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    1 more excerpts on the claim page

  36. ^ abWikiBulbapedia, “Pokémon Red and Green Versions” · Bulbapedia, “Pokémon Red and Blue Versions”
    How we know

    Pokémon Red and Green came out in Japan on 27 February 1996; the English Red and Blue (developer Game Freak, publisher Nintendo, Game Boy, and Generation I core series) followed in North America on 28 September 1998.

    Japan: February 27, 1996 … (Game Boy)
    infobox, Release dates · archived copy ↗
    Developer: Game Freak … Publisher: Nintendo … Part of: Generation I core series … North America: September 28, 1998 … (Game Boy)
    infobox, Basic info and Release dates · archived copy ↗

    Claim page

  37. ^Codepret/pokeredtype_matchups.asm 33–36; core.asm 5147–5153; +3 files
    How we know

    An Ice move against a Water/Flying Pokémon nets ×1 damage, a ½ row and then a 2× row, yet prints “It's super effective!”, since the message reads only the last matching row's value, 20, and compares it with 10.

    33	db ICE,          WATER,        NOT_VERY_EFFECTIVE
    ⋮
    36	db ICE,          FLYING,       SUPER_EFFECTIVE
    
    data/types/type_matchups.asm lines 33–36 at af51989 · upstream ↗
    5147	ld a, [wDamageMultipliers]
    5148	and 1 << BIT_STAB_DAMAGE
    5149	ld b, a
    5150	ld a, [hl] ; a = damage multiplier
    5151	ldh [hMultiplier], a
    5152	add b
    5153	ld [wDamageMultipliers], a
    
    engine/battle/core.asm lines 5147–5153 at af51989 · upstream ↗
    61DEF SUPER_EFFECTIVE    EQU 20
    ⋮
    63DEF EFFECTIVE          EQU 10
    
    constants/battle_constants.asm lines 61–63 at af51989 · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    2 more excerpts on the claim page

  38. ^Codepret/pokeredmoves.asm 102; type_matchups.asm 9, 55; +3 files
    How we know

    Earthquake against a Rock/Flying Pokémon does 0 damage and prints that the attack missed, not “It doesn't affect”: the Ground-against-Flying row (×0) zeroes the damage and makes the move miss, but the message reads the last matching row's value, Ground against Rock's ×2, and only a 0 there picks “doesn't affect”.

    102	move EARTHQUAKE,   NO_ADDITIONAL_EFFECT,       100, GROUND,       100, 10
    
    data/moves/moves.asm line 102 at af51989 · upstream ↗
    9	db GROUND,       FLYING,       NO_EFFECT
    
    data/types/type_matchups.asm line 9 at af51989 · upstream ↗
    55	db GROUND,       ROCK,         SUPER_EFFECTIVE
    
    data/types/type_matchups.asm line 55 at af51989 · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    5 more excerpts on the claim page

  39. ^ abCodepret/pokeredcore.asm 4040–4042; type_constants.asm 19–26
    How we know

    Type picks the stats: Fire, Water, Grass, Electric, Psychic, Ice, and Dragon (the first special type upward) use Special on both sides; the rest use Attack against Defense.

    4041	cp SPECIAL ; types >= SPECIAL are all special
    4042	jr nc, .specialAttack
    
    engine/battle/core.asm lines 4040–4042 at af51989 · upstream ↗
    constants/type_constants.asm#L19-L26 · upstream ↗

    Claim page

  40. ^Codepret/pokeredtype_constants.asm 11; names.asm 40
    How we know

    The type constants still define a Bird type ($06), with a name string, but no type chart row names it.

    11	const BIRD         ; $06
    
    constants/type_constants.asm line 11 at af51989 · upstream ↗
    40.Bird:     db "BIRD@"
    
    data/types/names.asm line 40 at af51989 · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    Claim page

  41. ^WikiBulbapedia, “Pokémon Crystal Version”
    How we know

    Pokémon Crystal (developer Game Freak, publisher Nintendo, Game Boy Color, and Generation II core series) came out in Japan on 14 December 2000 and North America on 30 July 2001.

    Developer: Game Freak … Publisher: Nintendo … Part of: Generation II core series … Japan: December 14, 2000 … (Game Boy) … North America: July 30, 2001 … (Game Boy)
    infobox, Basic info and Release dates · archived copy ↗

    Claim page

  42. ^Codepret/pokecrystaleffect_commands.asm 1216–1219
    How we know

    Struggle returns from the STAB battle command at once, so it skips weather, badge boosts, STAB, and the type chart.

    1216	ld a, BATTLE_VARS_MOVE_ANIM
    1217	call GetBattleVar
    1218	cp STRUGGLE
    1219	ret z
    
    engine/battle/effect_commands.asm lines 1216–1219 at 97187cd · upstream ↗

    Claim page

  43. ^Codepret/pokecrystal · pret/pokeredeffect_commands.asm 1361–1373; battle_constants.asm 24; +1 files
    How we know

    A ×¼ hit no longer truncates to a miss: 2 damage through two ½ rows gives ⌊2 × 5 / 10⌋ = 1, then ⌊1 × 5 / 10⌋ = 0, raised to 1.

    1362	ld a, 10
    1363	ldh [hDivisor], a
    1364	ld b, 4
    1365	call Divide
    1366	ldh a, [hQuotient + 2]
    1367	ld b, a
    1368	ldh a, [hQuotient + 3]
    1369	or b
    1370	jr nz, .ok
    ⋮
    1372	ld a, 1
    1373	ldh [hMultiplicand + 2], a
    
    engine/battle/effect_commands.asm lines 1361–1373 at 97187cd · upstream ↗
    24DEF NOT_VERY_EFFECTIVE EQU 05
    
    constants/battle_constants.asm line 24 at 97187cd · upstream ↗
    5165	call Divide
    ⋮
    5171	or b ; is damage 0?
    5172	jr nz, .skipTypeImmunity
    ⋮
    5175	inc a
    5176	ld [wMoveMissed], a
    
    engine/battle/core.asm lines 5162–5176 at af51989 · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    Claim page

  44. ^Codepret/pokecrystaltype_matchups.asm 35–39; battle_constants.asm 21–24; +1 files
    How we know

    An Ice move against a Water/Flying Pokémon prints no effectiveness message in Crystal: the message reads a combined value that starts at 10 and is multiplied by each matching row's value and divided by 10, here 10 → 5 → 10.

    35	db ICE,          WATER,        NOT_VERY_EFFECTIVE
    ⋮
    39	db ICE,          FLYING,       SUPER_EFFECTIVE
    
    data/types/type_matchups.asm lines 35–39 at 97187cd · upstream ↗
    21DEF SUPER_EFFECTIVE    EQU 20
    ⋮
    23DEF EFFECTIVE          EQU 10
    24DEF NOT_VERY_EFFECTIVE EQU 05
    
    constants/battle_constants.asm lines 21–24 at 97187cd · upstream ↗
    1416	ld a, EFFECTIVE
    1417	ld [wTypeMatchup], a
    ⋮
    1454	ld a, [wTypeMatchup]
    1455	ldh [hMultiplier], a
    1456	call Multiply
    1457	ld a, 10
    ⋮
    1461	call Divide
    ⋮
    1463	ldh a, [hQuotient + 3]
    1464	ld [wTypeMatchup], a
    
    engine/battle/effect_commands.asm lines 1416–1464 at 97187cd · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    2 more excerpts on the claim page

  45. ^ abCodepret/pokecrystaleffect_commands.asm 2543–2545; type_constants.asm 9–35
    How we know

    Type still picks the stats: Steel is physical (numbered below the first special type); Dark is special, using Special Attack against Special Defense.

    2544	cp SPECIAL
    2545	jr nc, .special
    
    engine/battle/effect_commands.asm lines 2543–2545 at 97187cd · upstream ↗
    constants/type_constants.asm#L9-L35 · upstream ↗

    Claim page

  46. ^ abWikiBulbapedia, “Pokémon Emerald Version”
    How we know

    Pokémon Emerald (developer Game Freak, publisher Nintendo, Game Boy Advance, and Generation III core series) came out in Japan on 16 September 2004 and North America on 1 May 2005.

    Developer: Game Freak … Publisher: Nintendo … Part of: Generation III core series … Japan: September 16, 2004 … North America: May 1, 2005
    infobox, Basic info and Release dates · archived copy ↗

    Claim page

  47. ^Codepret/pokeemeraldbattle_script_commands.c 1360–1364
    How we know

    Struggle skips the type-calculation battle command entirely, so neither STAB nor the type chart touches it.

    1360    if (gCurrentMove == MOVE_STRUGGLE)
    ⋮
    1362        gBattlescriptCurrInstr++;
    1363        return;
    
    src/battle_script_commands.c lines 1360–1364 at 731ad5b · upstream ↗

    Claim page

  48. ^ abCodepret/pokeemeraldbattle.h 466–467
    How we know

    Type still decides physical or special in Emerald, by whether it comes before or after type 9, "???".

    466#define IS_TYPE_PHYSICAL(moveType) (moveType < TYPE_MYSTERY)
    467#define IS_TYPE_SPECIAL(moveType) (moveType > TYPE_MYSTERY)
    
    include/battle.h lines 466–467 at 731ad5b · upstream ↗

    Claim page

  49. ^Codepret/pokeemeraldpokemon.h 15; battle_main.c 462
    How we know

    Type 9, named "???", sits between the physical and special types and has no rows.

    15#define TYPE_MYSTERY          9
    
    include/constants/pokemon.h line 15 at 731ad5b · upstream ↗
    462    [TYPE_MYSTERY] = _("???"),
    
    src/battle_main.c line 462 at 731ad5b · upstream ↗

    Measured by a script. It fails if the result disagrees with the claim.

    Claim page

  50. ^Codepret/pokeredcore.asm 5420–5454; data.asm 3
    How we know

    The damage-randomizing routine multiplies damage by a random byte, 217–255, and integer-divides by 255, leaving 0 or 1 damage untouched.

    5436; loop until a random number greater than or equal to 217 is generated
    ⋮
    5440	cp 85 percent + 1
    
    engine/battle/core.asm lines 5420–5454 at af51989 · upstream ↗
    3DEF percent EQUS "* $ff / 100"
    
    macros/data.asm line 3 at af51989 · upstream ↗

    Claim page

  51. ^Codepret/pokecrystaleffect_commands.asm 1503–1536; data.asm 23
    How we know

    As in Red and Blue, damage is multiplied by a random byte from 217 to 255 and divided by 255, and 0 or 1 damage is left untouched.

    1503; No point in reducing 1 or 0 damage.
    1504	ld hl, wCurDamage
    1505	ld a, [hli]
    1506	and a
    1507	jr nz, .go
    1508	ld a, [hl]
    1509	cp 2
    1510	ret c
    ⋮
    1512.go
    ⋮
    1517	ld a, [hli]
    ⋮
    1519	ld a, [hl]
    ⋮
    1523.loop
    ⋮
    
    engine/battle/effect_commands.asm lines 1503–1536 at 97187cd · upstream ↗
    23DEF percent EQUS "* $ff / 100"
    
    macros/data.asm line 23 at 97187cd · upstream ↗

    Claim page

  52. ^Codepret/pokeemeraldbattle_script_commands.c 1641–1649
    How we know

    The random factor changes form from Crystal's random byte over 255: Emerald multiplies nonzero damage by 100 − (a random number mod 16), 85 to 100, divides by 100, and raises a 0 result to 1.

    1641    u16 rand = Random();
    1642    u16 randPercent = 100 - (rand % 16);
    ⋮
    1644    if (gBattleMoveDamage != 0)
    ⋮
    1646        gBattleMoveDamage *= randPercent;
    1647        gBattleMoveDamage /= 100;
    1648        if (gBattleMoveDamage == 0)
    1649            gBattleMoveDamage = 1;
    
    src/battle_script_commands.c lines 1641–1649 at 731ad5b · upstream ↗

    Claim page

  53. ^Codepret/pokeredSaffronGym.asm 135–139
    How we know

    In Red and Blue, a Saffron Gym trainer's after-battle line, “Psychic #MON fear only ghosts and bugs!”, contradicts the game's own type chart, under which Ghost-type moves have no effect on Psychic types.

    135_SaffronGymYoungster1AfterBattleText::
    136	text "Psychic #MON"
    137	line "fear only ghosts"
    138	cont "and bugs!"
    
    text/SaffronGym.asm lines 135–139 at af51989 · upstream ↗

    Claim page

  54. ^Codepret/pokecrystaltype_matchups.asm 94
    How we know

    Crystal's type chart makes Ghost-type moves super effective on Psychic types.

    94	db GHOST,        PSYCHIC_TYPE, SUPER_EFFECTIVE
    
    data/types/type_matchups.asm line 94 at 97187cd · upstream ↗

    Claim page

  55. ^WikiBulbapedia, “Ghost (type)”
    How we know

    Bulbapedia reports that “an abundance of evidence suggests” the Gen 1 Ghost → Psychic ×0 “may have been an error”.

    In Generation I, Ghost-type moves have no effect on Psychic-type Pokémon, though an abundance of evidence suggests that this may have been an error.
    Trivia · archived copy ↗

    Claim page

Sources

Code

Secondary