data/claims/fe8.yamlFire Emblem: The Sacred Stones (FireEmblemUniverse/fireemblem8u)
In the North American build, an attack hits when the displayed hit is greater than the average of two random numbers from 0 to 99, rounded down; each number scales a 16-bit NextRN() by 100/65,536. fe8/hit-roll
About: Fire Emblem: The Sacred Stones Hit chance
Value
{
"rolls": 2,
"range": [
0,
99
],
"scale": "NextRN() * 100 / 0x10000",
"combine": "floor((a + b) / 2)",
"hitIf": "hit > combined"
}src/rng.c#L68-L70int NextRN_100(void) {
// take the next rn (range 0-0xFFFF) and convert it to a range 0-99 value
return NextRN() * 100 / 0x10000;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/rng.c#L89-L93s8 Roll2RN(int threshold) {
int average = (NextRN_100() + NextRN_100()) / 2;
return (threshold > average);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1007-L1011if (!(gBattleHitIterator->attributes & BATTLE_HIT_ATTR_SURESHOT)) {
if (!BattleRoll2RN(gBattleStats.hitRate, TRUE)) {
gBattleHitIterator->attributes |= BATTLE_HIT_ATTR_MISS;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L879-L882void BattleUpdateBattleStats(struct BattleUnit* attacker, struct BattleUnit* defender) {
…
gBattleStats.hitRate = attacker->battleEffectiveHitRate;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bksel.c#L260PutNumberTwoChr(gUiTmScratchA + 0xA8 + 0x40, 2, gBattleActor.battleEffectiveHitRate);Checked by claude-agent, 2026-10-21 — read NextRN_100 and Roll2RN, the hit test in BattleGenerateHitAttributes, the copy of battleEffectiveHitRate into gBattleStats.hitRate, and the forecast line that prints the same fieldA Sniper's Sure Shot, which rolls its level on one number, skips the hit roll (BattleCheckSureShot). Because NextRN() has 65,536 values, 36 of the 100 results come from 656 of them and the rest from 655.
Cited by: Critical hit, Fire Emblem: The Binding Blade, Fire Emblem: The Sacred Stones, Hit chance
Computed from the code, taking the two numbers as independent and evenly spread, a displayed hit connects times in 10,000 up to 50 and times above it, so a displayed 80 hits 92.2% of the time, 20 hits 8.2%, and 50 hits 50.5%. fe8/true-hit-example
About: Fire Emblem: The Sacred Stones Hit chance
Value
{
"shown": [
20,
50,
80
],
"actual": [
8.2,
50.5,
92.2
]
}src/rng.c#L89-L93s8 Roll2RN(int threshold) {
int average = (NextRN_100() + NextRN_100()) / 2;
return (threshold > average);Checked by claude-agent, 2026-10-21 — counted the pairs (a, b) in 0–99 with ⌊(a+b)/2⌋ < h by script, which matches both closed forms at every h; weighting each number by its 655 or 656 values of NextRN() moves no result by more than 0.01 pointThe generator's consecutive outputs are not truly independent; no emulator measurement backs the curve yet.
Cited by: Fire Emblem: The Sacred Stones, Hit chance
In the North American build, a unit's hit is twice its skill, plus its weapon's hit, half its luck, and the weapon triangle's bonus; its avoid is twice its attack speed plus its terrain's avoid and its luck; the hit shown and rolled is the attacker's hit less the defender's avoid, held within 0–100. fe8/displayed-hit
About: Fire Emblem: The Sacred Stones Hit chance
Codefireemblem8u: decompilation of Fire Emblem: The Sacred Stones ·src/bmbattle.c#L577-L586void ComputeBattleUnitHitRate(struct BattleUnit* bu) {
bu->battleHitRate = (bu->unit.skl * 2) + GetItemHit(bu->weapon) + (bu->unit.lck / 2) + bu->wTriangleHitBonus;
…
bu->battleAvoidRate = (bu->battleSpeed * 2) + bu->terrainAvoid + (bu->unit.lck);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L599-L607attacker->battleEffectiveHitRate = attacker->battleHitRate - defender->battleAvoidRate;
if (attacker->battleEffectiveHitRate > 100)
attacker->battleEffectiveHitRate = 100;
if (attacker->battleEffectiveHitRate < 0)
attacker->battleEffectiveHitRate = 0;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L476-L487ComputeBattleUnitHitRate(attacker);
ComputeBattleUnitAvoidRate(attacker);
…
ComputeBattleUnitSupportBonuses(attacker, defender);
ComputeBattleUnitWeaponRankBonuses(attacker);
ComputeBattleUnitStatusBonuses(attacker);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L642-L651if (wType < 8 && bu->unit.ranks[wType] >= WPN_EXP_S) {
bu->battleHitRate += 5;
bu->battleCritRate += 5;Checked by claude-agent, 2026-10-21 — read the hit, avoid, and effective-hit routines and the order ComputeBattleUnitStats calls them in, with the support, S-rank, and status additions that followSupport bonuses add to hit and avoid afterward, and an S rank in the weapon's type adds 5 hit and 5 crit. Skill, speed, and luck include the equipped item's bonuses (GetUnitSkill and its kin in bmunit.c). A petrified defender sets the attacker's hit to 100 (ComputeBattleUnitSpecialWeaponStats).
Cited by: Hit chance
In the North American build, a unit's crit is its weapon's crit plus half its skill, plus 15 for classes with a crit bonus; the crit shown and rolled is that less the defender's luck, at least 0, and one random number from 0 to 99 below it triples the hit's damage. fe8/critical
About: Fire Emblem: The Sacred Stones Critical hit
Value
{
"rolls": 1,
"range": [
0,
99
],
"critIf": "crit > roll",
"multiplier": 3,
"classBonus": 15
}src/bmbattle.c#L588-L597bu->battleCritRate = GetItemCrit(bu->weapon) + (bu->unit.skl / 2);
if (UNIT_CATTRIBUTES(&bu->unit) & CA_CRITBONUS)
bu->battleCritRate += 15;
…
bu->battleDodgeRate = bu->unit.lck;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L612-L618attacker->battleEffectiveCritRate = attacker->battleCritRate - defender->battleDodgeRate;
…
if (attacker->battleEffectiveCritRate < 0)
attacker->battleEffectiveCritRate = 0;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/rng.c#L85-L87s8 Roll1RN(int threshold) {
return (threshold > NextRN_100());fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1030-L1039if (BattleRoll1RN(gBattleStats.critRate, FALSE) == TRUE) {
…
gBattleHitIterator->attributes = gBattleHitIterator->attributes | BATTLE_HIT_ATTR_CRIT;
gBattleStats.damage = gBattleStats.damage * 3;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L883gBattleStats.critRate = attacker->battleEffectiveCritRate;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bksel.c#L243critRate = gBattleActor.battleEffectiveCritRate;Checked by claude-agent, 2026-10-21 — read the crit and dodge routines, the effective crit, Roll1RN, the crit branch of BattleGenerateHitAttributes, and the forecast's critThe crit roll comes after the hit roll and the damage subtraction, so only a hit can be critical. An item with the negate-crit attribute in the defender's inventory sets the attacker's crit to 0 (L620–L625). An assassin's Silencer check runs inside a successful crit roll.
Cited by: Critical hit, Damage modifier, Fire Emblem: The Sacred Stones, Hit chance
In the North American build, the weapon triangle gives 15 hit and 1 damage to the side whose weapon type has the edge and takes the same from the other; swords beat axes, axes lances, and lances swords, and anima beats light, light dark, and dark anima. fe8/weapon-triangle
About: Fire Emblem: The Sacred Stones Weapon triangle
Value
{
"hit": 15,
"damage": 1,
"beats": {
"sword": "axe",
"axe": "lance",
"lance": "sword",
"anima": "light",
"light": "dark",
"dark": "anima"
}
}src/bmbattle.c#L39-L55{ ITYPE_SWORD, ITYPE_LANCE, -15, -1 },
{ ITYPE_SWORD, ITYPE_AXE, +15, +1 },
…
{ ITYPE_ANIMA, ITYPE_DARK, -15, -1 },
{ ITYPE_ANIMA, ITYPE_LIGHT, +15, +1 },
…
{ ITYPE_DARK, ITYPE_ANIMA, +15, +1 },fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1911-L1917for (it = sWeaponTriangleRules; it->attackerWeaponType >= 0; ++it) {
if ((attacker->weaponType == it->attackerWeaponType) && (defender->weaponType == it->defenderWeaponType)) {
attacker->wTriangleHitBonus = it->hitBonus;
attacker->wTriangleDmgBonus = it->atkBonus;
defender->wTriangleHitBonus = -it->hitBonus;
defender->wTriangleDmgBonus = -it->atkBonus;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L527attacker->battleAttack = GetItemMight(attacker->weapon) + attacker->wTriangleDmgBonus;Checked by claude-agent, 2026-10-21 — read all twelve rows of sWeaponTriangleRules, the loop that applies them to both sides, and where the bonuses enter attack (L527) and hit (L578)Cited by: Weapon triangle
In the North American build, a reaver weapon on one side only reverses the weapon triangle and doubles it, to 30 hit and 2 damage. fe8/reaver
About: Fire Emblem: The Sacred Stones Weapon triangle
Codefireemblem8u: decompilation of Fire Emblem: The Sacred Stones ·src/bmbattle.c#L1899-L1904void BattleApplyReaverEffect(struct BattleUnit* attacker, struct BattleUnit* defender) {
if (!(attacker->weaponAttributes & IA_REVERTTRIANGLE) || !(defender->weaponAttributes & IA_REVERTTRIANGLE)) {
attacker->wTriangleHitBonus = -(attacker->wTriangleHitBonus * 2);
attacker->wTriangleDmgBonus = -(attacker->wTriangleDmgBonus * 2);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1923-L1927if (attacker->weaponAttributes & IA_REVERTTRIANGLE)
BattleApplyReaverEffect(attacker, defender);
if (defender->weaponAttributes & IA_REVERTTRIANGLE)
BattleApplyReaverEffect(attacker, defender);Checked by claude-agent, 2026-10-21 — read BattleApplyReaverEffect and its two calls; with both sides holding a reaver, each call's condition fails and the bonuses standCited by: Weapon triangle
In the North American build, damage is attack less defense, where attack is the weapon's might plus the triangle's damage bonus, tripled when the attacker or its weapon is effective against the target (doubled instead when the effective weapon is one of eight legendary weapons), plus the attacker's strength, and defense is terrain defense plus Defense, or terrain resistance plus Resistance against magic; no roll changes it except two skills, Pierce (which sets defense to 0) and Great Shield (which sets the damage to 0); a critical triples it, and the result is held within 0–127. fe8/damage
About: Fire Emblem: The Sacred Stones Damage formula
Value
{
"effective": 3,
"effectiveLegendary": 2,
"critical": 3,
"max": 127,
"min": 0
}src/bmbattle.c#L511-L517if (GetItemAttributes(defender->weapon) & IA_MAGICDAMAGE)
attacker->battleDefense = attacker->terrainResistance + attacker->unit.res;
…
attacker->battleDefense = attacker->terrainDefense + attacker->unit.def;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L527-L557attacker->battleAttack = GetItemMight(attacker->weapon) + attacker->wTriangleDmgBonus;
…
if (IsUnitEffectiveAgainst(&attacker->unit, &defender->unit) == TRUE)
attack = attacker->battleAttack * 3;
if (IsItemEffectiveAgainst(attacker->weapon, &defender->unit) == TRUE) {
…
case ITEM_SWORD_AUDHULMA:
…
case ITEM_LANCE_SIEGMUND:
attack *= 2;
…
default:
…fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1022-L1028if (gBattleHitIterator->attributes & BATTLE_HIT_ATTR_PIERCE)
defense = 0;
…
gBattleStats.damage = attack - defense;
…
if (gBattleHitIterator->attributes & BATTLE_HIT_ATTR_GREATSHLD)
gBattleStats.damage = 0;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1030-L1039if (BattleRoll1RN(gBattleStats.critRate, FALSE) == TRUE) {
…
gBattleStats.damage = gBattleStats.damage * 3;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1043-L1047if (gBattleStats.damage > BATTLE_MAX_DAMAGE)
gBattleStats.damage = BATTLE_MAX_DAMAGE;
if (gBattleStats.damage < 0)
gBattleStats.damage = 0;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · include/bmbattle.h#L16-L17// Maximum battle damage
BATTLE_MAX_DAMAGE = 127,Checked by claude-agent, 2026-10-21 — read ComputeBattleUnitDefense, ComputeBattleUnitAttack, and the damage lines of BattleGenerateHitAttributes, with the crit branch between them (critical)The eight are Audhulma, Vidofnir, Garm, Nidhogg, Excalibur, Ivaldi, Sieglinde, and Siegmund by their item constants (L538–L545). Pierce zeroes defense, and Great Shield zeroes the damage.
Cited by: Critical hit, Damage modifier, Hit chance
In the North American build, a battle runs the attacker's round, then the defender's counter, then one follow-up round by the unit whose attack speed beats the other's by 4 or more; attack speed is speed less the weapon's weight beyond constitution, at least 0. fe8/doubling
About: Fire Emblem: The Sacred Stones Follow-up attack
Value
{
"threshold": 4
}include/bmbattle.h#L13-L14// Followup attack (double attack) attack speed difference threshold
BATTLE_FOLLOWUP_SPEED_THRESHOLD = 4,fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L743-L749if (!BattleGenerateRoundHits(attacker, defender)) {
…
if (!BattleGenerateRoundHits(defender, attacker) && BattleGetFollowUpOrder(&attacker, &defender)) {
…
BattleGenerateRoundHits(attacker, defender);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L766-L771if (ABS(gBattleActor.battleSpeed - gBattleTarget.battleSpeed) < BATTLE_FOLLOWUP_SPEED_THRESHOLD)
return FALSE;
if (gBattleActor.battleSpeed > gBattleTarget.battleSpeed) {
*outAttacker = &gBattleActor;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L563-L574int effWt = GetItemWeight(bu->weaponBefore);
effWt -= bu->unit.conBonus;
if (effWt < 0)
effWt = 0;
bu->battleSpeed = bu->unit.spd - effWt;
…
bu->battleSpeed = 0;Checked by claude-agent, 2026-10-21 — read BattleUnwind, BattleGetFollowUpOrder, the threshold constant, and ComputeBattleUnitSpeedA round that ends the battle stops the rest. A target with attack speed above 250 never allows a follow-up, and neither do the HP-halving weapon effect or the Monster Stone (L763–L781). A brave weapon strikes twice within each round (L806–L819).
Cited by: Follow-up attack
In the North American build, a level-up rolls each of seven stats on the character's own growth rate, with one random number from 0 to 99; each full 100 of a rate is a sure point, and if no stat rises, the game rerolls the stats in order up to twice, stopping at the first that does. fe8/growth-roll
About: Fire Emblem: The Sacred Stones Growth rate
Value
{
"stats": [
"HP",
"Str",
"Skl",
"Spd",
"Def",
"Res",
"Lck"
],
"rolls": 1,
"range": [
0,
99
],
"boost": 5,
"rerollPasses": 2
}src/bmbattle.c#L1227-L1238int GetStatIncrease(int growth) {
…
while (growth > 100) {
result++;
growth -= 100;
…
if (Roll1RN(growth))
result++;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1275-L1281growthBonus = (bu->unit.state & US_GROWTH_BOOST) ? 5: 0;
…
bu->changeHP = GetStatIncrease(bu->unit.pCharacterData->growthHP + growthBonus);
…
bu->changePow = GetStatIncrease(bu->unit.pCharacterData->growthPow + growthBonus);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1299-L1304if (statGainTotal == 0) {
for (statGainTotal = 0; statGainTotal < 2; ++statGainTotal) {
bu->changeHP = GetStatIncrease(bu->unit.pCharacterData->growthHP);
if (bu->changeHP)
break;Checked by claude-agent, 2026-10-21 — read GetStatIncrease and CheckBattleUnitLevelUp to L1338, all seven stats in both the first pass and the reroll loopThe growth-boost state adds 5 to every rate on the first pass but not on the rerolls. A rate of exactly 100 is not reduced (growth > 100) and still rolls, and Roll1RN(100) always succeeds.
Cited by: Fire Emblem: The Sacred Stones, Growth rate
In the North American build, a non-player unit placed with autoleveling, unless it is a boss or its character number is below 0x40, adds to each stat one roll on its class's growth times its levels above 1, moved at random by up to an eighth of that product either way. fe8/autolevel
About: Fire Emblem: The Sacred Stones Growth rate
Codefireemblem8u: decompilation of Fire Emblem: The Sacred Stones ·src/bmunit.c#L617-L638if (uDef->autolevel) {
if (UNIT_FACTION(unit) == FACTION_BLUE) {
…
if ((UNIT_CATTRIBUTES(unit) & CA_BOSS) || (unit->pCharacterData->number < 0x40)) {
…
UnitAutolevel(unit);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmunit.c#L823-L827void UnitAutolevel(struct Unit* unit) {
…
UnitAutolevelCore(unit, unit->pClassData->number, unit->level - 1);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmunit.c#L776-L779void UnitAutolevelCore(struct Unit* unit, u8 classId, int levelCount) {
if (levelCount) {
unit->maxHP += GetAutoleveledStatIncrease(unit->pClassData->growthHP, levelCount);
unit->pow += GetAutoleveledStatIncrease(unit->pClassData->growthPow, levelCount);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmbattle.c#L1241-L1242int GetAutoleveledStatIncrease(int growth, int levelCount) {
return GetStatIncrease((growth * levelCount) + (NextRN_N((growth * levelCount) / 4) - (growth * levelCount) / 8));Checked by claude-agent, 2026-10-21 — read the autolevel branch of the unit loader, UnitAutolevel, UnitAutolevelCore, and GetAutoleveledStatIncrease, which feeds GetStatIncrease (growth-roll)A unit in a promoted class first takes a promotion bonus's worth of levels the same way (L824–L825); UnitAutolevelCore ignores its class argument and reads the unit's current class. Player units and bosses, and units with character numbers below 0x40, take UnitAutolevelRealistic instead, which the atlas hasn't read.
Cited by: Growth rate
In the North American build, a player unit whose HP reaches 0 in combat is flagged dead and hidden rather than erased, unless it is a phantom, which is erased; the cleanup between chapters keeps the flag, clearing it only for a class with the supply attribute. fe8/permadeath
About: Fire Emblem: The Sacred Stones Permadeath
Codefireemblem8u: decompilation of Fire Emblem: The Sacred Stones ·src/bmmind.c#L510-L517void KillUnitOnCombatDeath(struct Unit* unitA, struct Unit* unitB) {
if (GetUnitCurrentHp(unitA) != 0) {
…
UnitKill(unitA);fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmunit.c#L958-L967void UnitKill(struct Unit* unit) {
if (UNIT_FACTION(unit) == FACTION_BLUE) {
if (UNIT_IS_PHANTOM(unit))
unit->pCharacterData = NULL;
else {
unit->state |= US_DEAD | US_HIDDEN;
…
unit->pCharacterData = NULL;fireemblem8u: decompilation of Fire Emblem: The Sacred Stones · src/bmio.c#L1249-L1255unit->state &= (
US_DEAD | US_GROWTH_BOOST | US_SOLOANIM_1 | US_SOLOANIM_2 |
…
if (UNIT_CATTRIBUTES(unit) & CA_SUPPLY)
unit->state = unit->state &~ US_DEAD;Checked by claude-agent, 2026-10-21 — read KillUnitOnCombatDeath, UnitKill, and the player-unit loop of ChapterChangeUnitCleanup (L1233–L1262)Enemy and allied units are erased outright too. The save code packs the dead flag (bmsave.c L345–L346), so it survives saving. What the supply attribute marks, and whether any other code revives a unit, the atlas hasn't read.
Cited by: Permadeath