Emerald's type chart, gTypeEffectiveness, is a flat u8 array of 108 non-neutral (attacker, defender, multiplier) rows over 17 types, then a TYPE_FORESIGHT marker, two Ghost immunities, and TYPE_ENDTABLE. | src/battle_main.c L329–449include/constants/pokemon.h L5–23 | T3 |
Emerald keeps the Game Boy encoding, now named TYPE_MUL_*: 20 super effective, 10 normal, 5 not effective, and 0 no effect. | include/battle_main.h L31–34 | T3 |
| Emerald's table holds the same 110 rows as Crystal's, in the same order: no new type and no changed matchup. | src/battle_main.c L335–449 | T4 |
TYPE_MYSTERY (9), named "???", sits between the physical and special types and has no rows. | include/constants/pokemon.h L15src/battle_main.c L462 | T3 |
Before the type chart, Cmd_typecalc applies STAB as when either attacker type equals the move's type. | src/battle_script_commands.c L1368–1373include/battle.h L471 | T3 |
For each row of the move's type, ModulateDmgByType runs once per distinct target type it matches: , raised from 0 to 1 unless the multiplier is 0. | src/battle_script_commands.c L1321–1325src/battle_script_commands.c L1386–1406 | T3 |
The text comes from flags ModulateDmgByType 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. | src/battle_script_commands.c L1327–1352 | T3 |
Against a Foresight target, the loop breaks at the TYPE_FORESIGHT row, skipping the Normal→Ghost and Fighting→Ghost immunities after it. | src/battle_script_commands.c L1388–1394src/battle_main.c L445–447 | T3 |
Struggle skips Cmd_typecalc entirely, so neither STAB nor the type chart touches it. | src/battle_script_commands.c L1360–1364 | T3 |
Cmd_typecalc flags a Ground move against a Levitate target as missed and “doesn't affect”, and walks no type row. | src/battle_script_commands.c L1375–1384 | T3 |
| After the rows, a Wonder Guard target makes a damaging move miss on the turn it attacks, unless the move carries the super-effective flag without the not-very-effective one. | src/battle_script_commands.c L1409–1419 | T3 |
| Row order still matters: an Ice move against Water/Flying takes 3 damage to 1, then 2 (½ row at L369, 2× at L373). | src/battle_main.c L369–373 | T4 |
Type still decides physical or special in Emerald, by its position relative to TYPE_MYSTERY. | include/battle.h L466–467 | T3 |
| A plain damaging move runs critcalc, damagecalc (base damage), typecalc (STAB, then type rows), and then adjustnormaldamage (random factor). | data/battle_scripts_1.s L249–252 | T3 |
| The random factor changes form: damage × (100 − rand % 16) / 100, i.e. 85–100 %, raised to 1 if that gives 0. | src/battle_script_commands.c L1639–1651 | T3 |