Ruby and Sapphire run the same formula and shake checks as Emerald, except that their status test leaves out bad poison (STATUS1_TOXIC_POISON, a separate status bit from poison), so a badly poisoned Pokémon gets no bonus. Emerald's test includes it. | src/battle_script_commands.c L9452–9456src/battle_script_commands.c L9484–9486src/battle_script_commands.c L1033–1036include/constants/battle.h L85–89 | Code |
Ruby and Sapphire's atk04_critcalc, which Emerald keeps apart from a renamed helper, sums Focus Energy (+2), a move whose effect is high-critical, Sky Attack, Blaze Kick, or Poison Tail (+1), a Scope Lens (+1), and Lucky Punch or Stick on their species (+2), caps the stage at 4, and hits critically 1 time in 16, 8, 4, 3, or 2. Battle Armor or Shell Armor on the target, the STATUS3_CANT_SCORE_A_CRIT flag on the attacker, Wally's tutorial, and the first battle rule it out. | src/battle_script_commands.c L1387–1402src/battle_script_commands.c L822 | Code |
Ruby and Sapphire's atk01_accuracycheck, which Emerald keeps with renamed constants, scales a move's percent accuracy by one combined stage ratio, applies Compound Eyes (×1.3), Sand Veil in a sandstorm and Hustle on physical moves (×0.8 each), and a target's evasion item, and misses when a roll from 1 to 100 exceeds the result. | src/battle_script_commands.c L1272–1299 | Code |
Ruby and Sapphire's gTypeEffectiveness holds the same 110 rows as Emerald's and Crystal's, in the same order, with literal 0xFE and 0xFF bytes where Emerald names TYPE_FORESIGHT and TYPE_ENDTABLE. | data/type_effectiveness.inc L1–119 | Code |
Ruby and Sapphire's atk06_typecalc applies STAB as before the type rows, as Emerald's Cmd_typecalc does. | src/battle_script_commands.c L1486–1490 | Code |
| Ruby and Sapphire already use Emerald's random factor, damage × (100 − rand % 16) / 100, raised to 1 if that gives 0; Gen 1 and 2 reach about the same 85–100% spread as a byte from 217 to 255 over 255. | src/battle_script_commands.c L1751–1763 | Code |
Ruby and Sapphire's atk8D_setmultihitcounter gives 2 or 3 hits with probability 3/8 each and 4 or 5 with 1/8 each, the same code as Emerald's; the multi-hit battle script runs accuracycheck once and then loops critcalc, damagecalc, and adjustnormaldamage for every hit. | src/battle_script_commands.c L6697–6710data/battle_scripts_1.s L652–690 | Code |
Ruby and Sapphire multiply the area's encounter rate by 16, cut it to 80% on the Mach or Acro Bike, apply the flute and Cleanse Tag modifiers, halve it for a lead with Stench and double it for Illuminate, cap it at 2,880, and start a battle when Random() % 2880 is below it. Emerald keeps the roll and adds more ability modifiers. | src/wild_encounter.c L21src/wild_encounter.c L377–381src/wild_encounter.c L403–424 | Code |
Ruby and Sapphire's TryRunFromBattle always escapes with a Smoke Ball or Run Away; otherwise, in a single battle, a Pokémon at least as fast as the foe escapes, and a slower one when , for earlier tries, beats a random byte. Emerald adds only the Battle Pyramid's and Frontier's rules. | src/battle_main.c L5465–5490 | Code |
Ruby and Sapphire's GetWhoStrikesFirst puts the higher-priority move first; at equal priority the higher adjusted Speed goes first, and a tie is a coin flip. Adjusted Speed applies stat stages, doubles for Swift Swim in rain or Chlorophyll in sun, takes ×1.1 for the player's Pokémon with the third badge outside link battles, halves with a Macho Brace, and quarters under paralysis; a held Quick Claw sets it to the maximum when a per-turn random number is below its parameter, 20, as a percent of 0xFFFF. | src/battle_main.c L4594–4641src/battle_main.c L4701–4718src/data/items_en.h L2932–2936 | Code |
| Ruby and Sapphire define 77 abilities, from Stench (1) to Air Lock (77); a species lists one or two, and when it has two, the lowest bit of the Pokémon's personality value picks which. | include/constants/abilities.h L4–83src/pokemon_1.c L1465–1468src/pokemon_2.c L1056–1063 | Code |
| A Ruby and Sapphire Pokémon's nature is its personality value mod 25; each of the 25 raises one stat other than HP by 10% and lowers another by 10%, rounded down, except Hardy, Docile, Serious, Bashful, and Quirky, which change nothing. | src/pokemon_3.c L261–264src/pokemon_3.c L627–657src/pokemon_1.c L1285–1313 | Code |
| In Ruby and Sapphire, rain, sandstorm, or drought on the overworld starts a battle in that weather with no turn limit, Drizzle sets lasting rain when its holder enters, and Cloud Nine or Air Lock on the field turns weather's effects off. | src/battle_util.c L1794–1836include/battle_util.h L50src/battle_util.c L771–776 | Code |