data/claims/pokefirered.yamlPokémon FireRed and LeafGreen (pret/pokefirered)
FireRed and LeafGreen's Cmd_critcalc keeps Ruby's stages and its 1 in 16, 8, 4, 3, or 2, but rules out critical hits in the Old Man's catching tutorial, in Pokédude battles, and in the first battle until a tutorial flag is set. pokefirered/critical-chance
About: Pokémon FireRed and LeafGreen Critical hit
Value
{
"oneIn": [
16,
8,
4,
3,
2
]
}src/battle_script_commands.c#L1196-L1201if ((gBattleMons[gBattlerTarget].ability != ABILITY_BATTLE_ARMOR && gBattleMons[gBattlerTarget].ability != ABILITY_SHELL_ARMOR)
&& !(gStatuses3[gBattlerAttacker] & STATUS3_CANT_SCORE_A_CRIT)
&& !(gBattleTypeFlags & BATTLE_TYPE_OLD_MAN_TUTORIAL)
&& !(Random() % sCriticalHitChance[critChance])
&& (!(gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) || BtlCtrl_OakOldMan_TestState2Flag(1))
&& !(gBattleTypeFlags & BATTLE_TYPE_POKEDUDE))pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/battle_script_commands.c#L588-L588static const u16 sCriticalHitChance[] = {16, 8, 4, 3, 2};pokeemerald: decompilation of Pokémon Emerald · src/battle_script_commands.c#L1253-L1288static void Cmd_critcalc(void)
…
&& !(gBattleTypeFlags & (BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FIRST_BATTLE))
&& !(Random() % sCriticalHitChance[critChance]))pokeemerald: decompilation of Pokémon Emerald · src/battle_script_commands.c#L606-L606static const u16 sCriticalHitChance[] = {16, 8, 4, 3, 2};Checked by claude-agent, 2026-10-21 — read Cmd_critcalc (L1170–L1208) at the pokefirered pin and diffed it against pokeemerald's; the stage sum is the same, and the battle-type conditions are the only difference.Cited by: Critical hit, Pokémon FireRed and LeafGreen
FireRed and LeafGreen's Cmd_accuracycheck is Emerald's with one addition: in Pokédude battles every move, on either side, skips the accuracy roll, and in the first battle the player's damaging moves skip it until one tutorial flag is set and the player's status moves until a second. pokefirered/hit-test
About: Pokémon FireRed and LeafGreen Hit chance
Codepokefirered: decompilation of Pokémon FireRed and LeafGreen ·src/battle_script_commands.c#L1003-L1019static void Cmd_accuracycheck(void)
…
if ((gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE
&& !BtlCtrl_OakOldMan_TestState2Flag(1)
&& gBattleMoves[move].power != 0
&& GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
|| (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE
&& !BtlCtrl_OakOldMan_TestState2Flag(2)
&& gBattleMoves[move].power == 0
&& GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
|| (gBattleTypeFlags & BATTLE_TYPE_POKEDUDE))
{
…pokeemerald: decompilation of Pokémon Emerald · src/battle_script_commands.c#L1099-L1103static void Cmd_accuracycheck(void)
{
u16 move = T2_READ_16(gBattlescriptCurrInstr + 5);
if (move == NO_ACC_CALC || move == NO_ACC_CALC_CHECK_LOCK_ON)Checked by claude-agent, 2026-10-21 — diffed Cmd_accuracycheck against pokeemerald's at their pins; the block quoted here and the hold-effect helper's name are the only differences. The Pokédude clause has no side check.Cited by: Hit chance, Pokémon FireRed and LeafGreen
FireRed and LeafGreen's gTypeEffectiveness is Emerald's, entry for entry: 108 matchup rows, the Foresight marker, two Ghost immunities, and the end marker. pokefirered/type-chart
About: Pokémon FireRed and LeafGreen Type effectiveness
Codepokefirered: decompilation of Pokémon FireRed and LeafGreen ·src/battle_main.c#L312-L426const u8 gTypeEffectiveness[336] =pokeemerald: decompilation of Pokémon Emerald · src/battle_main.c#L335-L449const u8 gTypeEffectiveness[336] =Checked by claude-agent, 2026-10-21 — parsed both arrays at their pins with a script; the 112 entries match in order.Cited by: Pokémon FireRed and LeafGreen, Type effectiveness
FireRed and LeafGreen keep Emerald's STAB, before the type rows; their Cmd_typecalc differs from Emerald's only in how it names the defender's types. pokefirered/stab
About: Pokémon FireRed and LeafGreen Same-type attack bonus
Codepokefirered: decompilation of Pokémon FireRed and LeafGreen ·src/battle_script_commands.c#L1287-L1292// check stab
if (IS_BATTLER_OF_TYPE(gBattlerAttacker, moveType))
{
gBattleMoveDamage = gBattleMoveDamage * 15;
gBattleMoveDamage = gBattleMoveDamage / 10;pokeemerald: decompilation of Pokémon Emerald · src/battle_script_commands.c#L1368-L1372// check stab
if (IS_BATTLER_OF_TYPE(gBattlerAttacker, moveType))
{
gBattleMoveDamage = gBattleMoveDamage * 15;
gBattleMoveDamage = gBattleMoveDamage / 10;Checked by claude-agent, 2026-10-21 — read the lines at the pokefirered pin and diffed Cmd_typecalc against pokeemerald's; `type1`/`type2` against `types[0]`/`types[1]` is the only difference.Cited by: Same-type attack bonus
FireRed and LeafGreen's Cmd_damagecalc and Cmd_adjustnormaldamage diff identical with Emerald's: Cmd_damagecalc multiplies the base damage by the critical multiplier, 2 on a critical hit, and the random factor is damage × (100 − rand % 16) / 100, 85–100%. pokefirered/damage
About: Pokémon FireRed and LeafGreen Damage formula
Codepokefirered: decompilation of Pokémon FireRed and LeafGreen ·src/battle_script_commands.c#L1209-L1215static void Cmd_damagecalc(void)
…
gBattleMoveDamage = gBattleMoveDamage * gCritMultiplier * gBattleScripting.dmgMultiplier;pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/battle_script_commands.c#L1202-L1205gCritMultiplier = 2;
else
gCritMultiplier = 1;pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/battle_script_commands.c#L1558-L1570static inline void ApplyRandomDmgMultiplier(void)
{
u16 rand = Random();
u16 randPercent = 100 - (rand % 16);
…
gBattleMoveDamage *= randPercent;
gBattleMoveDamage /= 100;pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/battle_script_commands.c#L1577-L1581static void Cmd_adjustnormaldamage(void)
{
u8 holdEffect, param;
ApplyRandomDmgMultiplier();pokeemerald: decompilation of Pokémon Emerald · src/battle_script_commands.c#L1290-L1296static void Cmd_damagecalc(void)
…
gBattleMoveDamage = gBattleMoveDamage * gCritMultiplier * gBattleScripting.dmgMultiplier;Checked by claude-agent, 2026-10-21 — read the lines quoted at the pokefirered pin and diffed Cmd_damagecalc (L1209) and Cmd_adjustnormaldamage (L1577) against pokeemerald's, with the hold-effect helper's name normalized; no other line differs.Cited by: Damage formula
FireRed and LeafGreen's Cmd_setmultihitcounter is Emerald's, line for line: 2 or 3 hits at 3/8 each and 4 or 5 at 1/8. The battle script runs accuracycheck once, then loops critcalc, damagecalc, and adjustnormaldamage for every hit. pokefirered/multi-hit
About: Pokémon FireRed and LeafGreen Multi-hit attack
Codepokefirered: decompilation of Pokémon FireRed and LeafGreen ·src/battle_script_commands.c#L6857-L6873static void Cmd_setmultihitcounter(void)
…
gMultiHitCounter = Random() & 3;
if (gMultiHitCounter > 1)
gMultiHitCounter = (Random() & 3) + 2;
else
gMultiHitCounter += 2;pokefirered: decompilation of Pokémon FireRed and LeafGreen · data/battle_scripts_1.s#L605-L640BattleScript_EffectMultiHit::
…
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
…
setmultihitcounter 0
…
BattleScript_MultiHitLoop::
…
critcalc
damagecalc
typecalc
jumpifmovehadnoeffect BattleScript_MultiHitNoMoreHits
…pokeemerald: decompilation of Pokémon Emerald · src/battle_script_commands.c#L7139-L7155static void Cmd_setmultihitcounter(void)
…
gMultiHitCounter = Random() & 3;Checked by claude-agent, 2026-10-21 — diffed the function against pokeemerald's at their pins (identical) and read the multi-hit script at the pokefirered pin.Cited by: Multi-hit attack
FireRed and LeafGreen roll encounters on their own generator, , seeded at a new game; a check passes when its value mod 1,600 is below 16 times the area's rate, cut to 80% on a bike, plus 16/200 of a buff to which every failed check adds the area's rate, reset by a battle or a Repel. pokefirered/encounter-rate
About: Pokémon FireRed and LeafGreen Random encounter
Codepokefirered: decompilation of Pokémon FireRed and LeafGreen ·src/wild_encounter.c#L20-L20#define MAX_ENCOUNTER_RATE 1600pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/wild_encounter.c#L302-L314if (WildEncounterRandom() % MAX_ENCOUNTER_RATE < encounterRate)
…
encounterRate *= 16;
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE))
encounterRate = encounterRate * 80 / 100;
encounterRate += sWildEncounterData.encounterRateBuff * 16 / 200;pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/wild_encounter.c#L372-L374if (DoWildEncounterRateTest(gWildMonHeaders[headerId].landMonsInfo->encounterRate, FALSE) != TRUE)
{
AddToWildEncounterRateBuff(gWildMonHeaders[headerId].landMonsInfo->encounterRate);pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/wild_encounter.c#L667-L671static u16 WildEncounterRandom(void)
{
sWildEncounterData.rngState = ISO_RANDOMIZE2(sWildEncounterData.rngState);
return sWildEncounterData.rngState >> 16;pokefirered: decompilation of Pokémon FireRed and LeafGreen · include/random.h#L18-L20#define RAND_MULT 1103515245
…
#define ISO_RANDOMIZE2(val)(RAND_MULT * (val) + 12345)pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/wild_encounter.c#L778-L784static void AddToWildEncounterRateBuff(u8 encounterRate)
{
if (VarGet(VAR_REPEL_STEP_COUNT) == 0)
sWildEncounterData.encounterRateBuff += encounterRate;
else
sWildEncounterData.encounterRateBuff = 0;pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/new_game.c#L103-L103SeedWildEncounterRng(Random());Checked by claude-agent, 2026-10-21 — read the define, DoWildEncounterRateDiceRoll, DoWildEncounterRateTest, the land branch of StandardWildEncounter, WildEncounterRandom, the buff function, the reset in TryStandardWildEncounter (L766–L767), and SeedWildEncounterRng's call in src/new_game.c L103, at the pokefirered pin. Emerald's divisor is 2,880 (pokeemerald/encounter-rate).Cited by: Pokémon FireRed and LeafGreen, Random encounter, Random number generator
Before that roll, FireRed and LeafGreen require a minimum number of steps since the last battle, 8 − ⌊rate/10⌋ (0 at a rate of 80 or more, 8 below 10), and before then let a check through only on a 5-in-100 roll; the flutes, a Cleanse Tag, and the lead's Stench or Illuminate scale both numbers. pokefirered/encounter-cooldown
About: Pokémon FireRed and LeafGreen Random encounter
Codepokefirered: decompilation of Pokémon FireRed and LeafGreen ·src/wild_encounter.c#L682-L686if (gWildMonHeaders[headerIdx].landMonsInfo->encounterRate >= 80)
return 0;
if (gWildMonHeaders[headerIdx].landMonsInfo->encounterRate < 10)
return 8;
return 8 - (gWildMonHeaders[headerIdx].landMonsInfo->encounterRate / 10);pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/wild_encounter.c#L716-L755minSteps *= 256;
encRate = 5 * 256;
…
if (sWildEncounterData.stepsSinceLastEncounter >= minSteps)
return TRUE;
sWildEncounterData.stepsSinceLastEncounter++;
if ((Random() % 100) < encRate)
return TRUE;Checked by claude-agent, 2026-10-21 — read GetMapBaseEncounterCooldown and HandleWildEncounterCooldown at the pokefirered pin.Cited by: Pokémon FireRed and LeafGreen, Random encounter
FireRed and LeafGreen keep Ruby's escape formula, against a random byte, with Smoke Ball and Run Away always escaping, and add that the player always escapes a ghost battle fought without the Silph Scope. pokefirered/run
About: Pokémon FireRed and LeafGreen Fleeing
Codepokefirered: decompilation of Pokémon FireRed and LeafGreen ·src/battle_main.c#L4252-L4263else if (IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(gBattleTypeFlags))
{
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
effect++;
}
…
speedVar = (gBattleMons[battler].speed * 128) / (gBattleMons[BATTLE_OPPOSITE(battler)].speed) + (gBattleStruct->runTries * 30);pokefirered: decompilation of Pokémon FireRed and LeafGreen · include/constants/battle.h#L69-L69#define IS_BATTLE_TYPE_GHOST_WITHOUT_SCOPE(flags) ((flags) & BATTLE_TYPE_GHOST && !((flags) & BATTLE_TYPE_GHOST_UNVEILED))Checked by claude-agent, 2026-10-21 — read TryRunFromBattle (L4229–L4280) at the pokefirered pin and diffed it against pokeruby's and pokeemerald's.Cited by: Fleeing, Pokémon FireRed and LeafGreen
FireRed and LeafGreen's GetWhoStrikesFirst is Emerald's rule: the higher-priority move first, then the higher adjusted Speed, with a tie a coin flip, and a Quick Claw that sets Speed to the maximum on its roll. It differs only in withholding the third badge's ×1.1 Speed in link battles alone, where Emerald also withholds it in recorded-link and Frontier battles. pokefirered/turn-order
About: Pokémon FireRed and LeafGreen Turn order
Codepokefirered: decompilation of Pokémon FireRed and LeafGreen ·src/battle_main.c#L3442-L3452// badge boost
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK)
…
if (holdEffect == HOLD_EFFECT_QUICK_CLAW && gRandomTurnNumber < (0xFFFF * holdEffectParam) / 100)
speedBattler1 = UINT_MAX;pokefirered: decompilation of Pokémon FireRed and LeafGreen · src/battle_main.c#L3505-L3517if (gBattleMoves[moveBattler1].priority != 0 || gBattleMoves[moveBattler2].priority != 0)
…
if (gBattleMoves[moveBattler1].priority == gBattleMoves[moveBattler2].priority)
…
if (speedBattler1 == speedBattler2 && Random() & 1)
…
else if (gBattleMoves[moveBattler1].priority < gBattleMoves[moveBattler2].priority)
strikesFirst = 1; // battler2's move has greater prioritypokeemerald: decompilation of Pokémon Emerald · src/battle_main.c#L4639-L4654// badge boost
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_FRONTIER))
…
if (holdEffect == HOLD_EFFECT_QUICK_CLAW && gRandomTurnNumber < (0xFFFF * holdEffectParam) / 100)
speedBattler1 = UINT_MAX;Checked by claude-agent, 2026-10-21 — diffed GetWhoStrikesFirst (pokefirered L3400–L3530, pokeemerald L4595–L4754) at their pins; besides blank lines, braces, comments, and the hold-effect helpers' names, the battle-type masks on the two badge checks (L3443 and L3468) are the only differences.Cited by: Held item, Turn order