Claim set · data/claims/mother1.yaml

EarthBound Beginnings (Nathan-R-Og/mother)

Game: EarthBound Beginnings.

In EarthBound Beginnings (the English build that the 2015 Virtual Console release uses), a shared routine adds random spread to a value: it moves the value by a weight in percent drawn from a 128-entry table by a random byte, up or down at even odds. The weights run from 0 to 24, and 92 of the 128 entries are 10 or less, so most rolls move the value by a few percent. Damage and the turn-order Speed roll both use it. mother1/spread

About: EarthBound Beginnings Damage formula

Value
{
 "weights": {
  "0": 5,
  "1": 10,
  "2": 10,
  "3": 10,
  "4": 10,
  "5": 9,
  "6": 9,
  "7": 8,
  "8": 8,
  "9": 7,
  "10": 6,
  "11": 6,
  "12": 5,
  "13": 4,
  "14": 4,
  "15": 3,
  "16": 3,
  "17": 2,
  "18": 2,
  "19": 2,
  "20": 1,
  "21": 1,
  "22": 1,
  "23": 1,
  "24": 1
 },
 "of": 128,
 "unit": "percent"
}
Codemother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/constant.asm#L9867-L9918 — the value times 64 is divided by 100 ($64; B31_113d divides $60–$62 by $64), times the weight, added or taken off by the random byte's low bit, then divided by 64 ldx #6 @B31_130b: asl UNK_60 rol UNK_60+1 dex bne @B31_130b ; UNK_60 =<< 6 (multiply by 64) … lda #$64 sta UNK_64 jsr B31_113d jsr RNG_BYTE lsr a …mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/constant.asm#L9943-L9970; $F37D - This table is indexed by (rand() >> 1) -- wtf is this layout ; WEIGHT B31_137d: .byte 0, 0, 0, 0, 0 ; 5 .byte 12, 12, 12, 12, 12 ; 5 .byte 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ; 10 … .byte 22 ; 1 .byte 23 ; 1 .byte 24 ; 1EarthBound Beginnings (USA, Europe) (Virtual Console) · 0x3F38D-0x3F40C — the fixed bank's $F37D, the 128 weights as the ROM has themmother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L5285-L5290 — the damage routine starts with this callMOV_input_output: lda battle_input_num sta battle_wordvar60 lda battle_input_num+1 sta battle_wordvar60+1 jmp RNG_WORDChecked by claude-agent, 2026-10-21 — read the three ranges and DoDamage's first lines (L4569-L4572, which call MOV_input_output); counted the table (128 entries); the ROM's 128 bytes at 0x3F38D match it. The shift by 6 keeps only the low 10 bits of the value, so the spread as described holds for values under 1024.

Cited by: Damage formula, EarthBound Beginnings

In EarthBound Beginnings (English build), a normal attack deals the attacker's Offense less half the target's Defense; when the Offense is below the Defense it deals (3 × Offense − Defense) ÷ 4 instead, at least 1. The damage routine then applies the ±0–24% spread, halves the result for a shielded or guarding target, and deals at least 1. mother1/bash-damage

About: EarthBound Beginnings Damage formula

Value
{
 "defenseDivisor": 2,
 "weakFormula": "(3*off - def) / 4",
 "spreadMaxPercent": 24,
 "minimum": 1
}
Codemother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3399-L3427; Normal Attack Damage = AttackerOFF - (DefenderDEF / 2) ; If DEF > OFF, Damage = (3 * AttackerOFF - DefenderDEF ) / 4 BINST60_SETNUMBASH: … sbc battle_wordvar64+1 bcc @SETNUM_WeakBash lsr battle_wordvar64+1 ror battle_wordvar64mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3444-L3448: lda battle_wordvar60 ora battle_wordvar60+1 bne :+ inc battle_wordvar60 ; min dmg = 1mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L4569-L4572DoDamage: lda target_offset pha jsr MOV_input_outputmother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L5285-L5290 — RNG_WORD is the spread in mother1/spreadMOV_input_output: lda battle_input_num sta battle_wordvar60 lda battle_input_num+1 sta battle_wordvar60+1 jmp RNG_WORDmother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L4593-L4610 ; halve damage if shielded … ; halve damage if guarding (stacks) … ; apply resists if any (stacks) : jsr ApplyResistance lda battle_wordvar60 ora battle_wordvar60+1 bne :+ inc battle_wordvar60Checked by claude-agent, 2026-10-21 — read the four ranges; the weak branch (L3455-L3480) triples the Offense, subtracts the full Defense, floors at 0, and shifts right twice; BATTLE_ACTION1 in battle_data.asm (L585-L600) calls this calculation for both sides' plain attacks

Cited by: Damage formula, EarthBound Beginnings

In EarthBound Beginnings (English build), a plain attack is a "SMAAAASH!!" when a random byte is below max(0, ⌊(256 + attacker's Fight − target's Fight) ÷ 2⌋ − 102), about 26 in 256 at equal Fight. It is checked before the dodge roll, so it can't be dodged, and it deals the attacker's Offense, ignoring Defense. There is no SMAAAASH during the invincibility scripts, while the party fires the tank gun instead, or, 1 time in 2, from a blinded attacker. mother1/smaaaash

About: EarthBound Beginnings Critical hit

Value
{
 "offset": 102,
 "of": 256,
 "atEqualFight": 26,
 "damage": "offense"
}
Codemother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3135-L3149; Same calculation as chance to Dodge. … BINSTCONDITION2_CRIT: jsr SEC_IsInvinciblityOn bcs :+ ldy attacker_offset lda BATTLER_CORES, y sta battle_wordvar60 ldy target_offset lda BATTLER_CORES, y sta battle_wordvar62 jsr DoFightEquation …mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3151-L3162; Only runs 50-50 check if attacker_offset is blinded BINSTCONDITION3_BLIND_MISS: ldy attacker_offset lda BATTLER_MINOR_STATUS, y and #BLIND eor #BLIND rol a bcs :+ jsr RNG_BYTE and #$80 ; 50-50 rol a : rtsmother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3276-L3295DoFightEquation: lda #$01 sta battle_wordvar60+1 sec lda battle_wordvar60 sbc battle_wordvar62 sta battle_wordvar60 lda battle_wordvar60+1 sbc #$00 lsr a ror battle_wordvar60 sec …mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L2532-L2533 .addr BINST7_IFFALSE ; 7 : Jump If Carry Clear .word ptr .addr BINST8_IFTRUE ; 8 : Jump If Carry Set .word ptrmother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/battle_data.asm#L585-L608BATTLE_ACTION1: ba_target BA_TARGET::RETARGET ba_jumpifnot BA_CON::BOTHLIVE, BA1_NORMAL ba_jumpif BA_CON::IS_BLINDED, BA1_NORMAL ba_jumpif BA_CON::IS_TANK, BA1_TANK ba_jumpif BA_CON::IS_CRIT, BA1_CRIT … ba_jumpifnot BA_CON::IS_DODGE, BATACT_DODGED_SWIFTLY … BA1_CRIT: … ba_misc BA_MISC::DISPTEXT, $0B ;SMAAAASH …mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3483-L3490; Damage = AttackerOFF ; If Teddy Script, setnum to rand(1, 16) BINST61_SETNUMCRIT: ldy attacker_offset lda BATTLER_OFF, y sta battle_input_numChecked by claude-agent, 2026-10-21 — read the six ranges. BATTLE_ACTION1 takes the IS_BLINDED and IS_TANK jumps (L587-L589) before IS_CRIT; BLIND is %10000000 (ram.asm L375), so a sighted attacker returns carry set and falls through to the crit test, and a blinded one gets a random carry. BINSTCONDITION2_CRIT returns carry set at once under invincibility (L3138-L3139), which skips the crit. ba_jumpif emits opcode $7X (macros in battle_data.asm L512-L517), which is BINST7_IFFALSE, a jump when the condition leaves carry clear; the crit condition clears carry when the random byte ($62) is below the threshold ($60). BATTLER_CORES is the battler's fight byte (ram.asm L331). The critical damage still passes through DoDamage, so it gets the spread.

Cited by: Critical hit, EarthBound Beginnings

In EarthBound Beginnings (English build), the target of a plain attack dodges when a random byte is at most max(0, ⌊(256 + target's Fight − attacker's Fight) ÷ 2⌋ − 102), 27 in 256 at equal Fight; a paralyzed, sleeping, or petrified target can't dodge. The attacker has no accuracy stat of its own. mother1/dodge

About: EarthBound Beginnings Hit chance

Value
{
 "offset": 102,
 "of": 256,
 "atEqualFight": 27
}
Codemother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3106-L3133; Used by Normal Attack and all its goons (various semi-clones) to determine if physical missed. ; Uses Fight in calculation. "Base chance" to dodge is ~10% (26/256). … BINSTCONDITION1_DODGED: … and #PETRIFICATION | PARALYSIS | SLEEP bne @DodgeFalse … lda BATTLER_CORES, y sta battle_wordvar60 ldy attacker_offset lda BATTLER_CORES, y …mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3276-L3295DoFightEquation: … sbc #$66 bcs :+ lda #$00 : sta battle_wordvar60 jsr RNG_BYTE sta battle_wordvar62Checked by claude-agent, 2026-10-21 — read both ranges; the dodge is taken when the threshold is at least the random byte (bcs), so equal Fight gives 128 − 102 = 26 and bytes 0–26, 27 chances in 256, one more than the code comment's 26/256. The tank and a minor status bit also block the dodge (L3111-L3118).

Cited by: EarthBound Beginnings, Hit chance

In EarthBound Beginnings (English build), the next combatant to act is picked one at a time: every combatant yet to act this round rolls its Speed through the ±0–24% spread, capped at 255, and the highest goes; the rest roll again for the next pick. mother1/turn-order

About: EarthBound Beginnings Turn order

Value
{
 "spreadMaxPercent": 24,
 "cap": 255,
 "rerollEachPick": true
}
Codemother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L2305-L2316BattleTurnEngine: jsr ConcludeBattle bcs @TurnEngineReturn ldx #8 @TurnEngineSort_LS: txa pha jsr SortTurnOrder jsr DoBattlerTurn lda #$ff ldy attacker_offset sta BATTLER_ACTION_ID, ymother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L2349-L2376SortTurnOrder: … lda BATTLER_ACTION_ID, y cmp #BA_COMPLETE beq @SortTurnOrder_INC … lda BATTLER_SPD, y jsr RNGifySpeed cmp battle_wordvar60+1 bcc @SortTurnOrder_INC sta battle_wordvar60+1 … …mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/constant.asm#L9972-L9988; used in Turn Order sorting to randomize speed (theorized effect) ; should be +-25% ; A should have the Speed value to modify RNGifySpeed: … jsr RNG_WORD lda UNK_60+1 beq @B31_1415 lda #$ff sta UNK_60Checked by claude-agent, 2026-10-21 — read the three ranges; the engine marks each actor done ($FF, BA_COMPLETE) after its turn and calls SortTurnOrder again for the next of up to 8; the battle intro action $5E is taken at once (L2358-L2359). RNG_WORD is the spread in mother1/spread.

Cited by: EarthBound Beginnings, Turn order

In EarthBound Beginnings (English build), running away works 1 time in 2 (the top bit of a random byte), with no stat in it, and never in a battle an event started. mother1/run

About: EarthBound Beginnings Fleeing

Value
{
 "chance": 0.5
}
Codemother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/battle_data.asm#L1474-L1489BATACT_RUN_AWAY: ba_target BA_TARGET::OUR_LEADER_REAL ba_misc BA_MISC::DISPTEXT, $43 ba_jumpif BA_CON::D2, @fail ba_jumpif BA_CON::SCRIPTED, @fail … @fail: ba_misc BA_MISC::DISPTEXT, $44mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3219-L3223; no requirement 50-50 BINSTCONDITION8_50_50: jsr RNG_BYTE asl a rtsmother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L3243-L3251; sees if battle is triggered (not random). ; different from battle being scripted BINSTCONDITIONB_NOT_TRIGGERED_BATTLE: lda is_scripted bne :+ sec rts : clc rtsChecked by claude-agent, 2026-10-21 — read the three ranges; D2 is condition 8 and SCRIPTED condition $B (battle_data.asm L538, L544); ba_jumpif jumps on carry clear (BINST7_IFFALSE, battle.asm L2532), so the run fails when the byte's top bit is 0 or the battle is triggered. SelectRun (battle.asm L1679-L1681) queues action $48, which BATTLE_ACTION_POINTERS maps to BATACT_RUN_AWAY (battle_data.asm L302).

Cited by: EarthBound Beginnings, Fleeing

In EarthBound Beginnings (English build), each step in an area with encounters starts a fight when a random byte is below a rate from the table 32, 21, 16, 13, 10, 8, 6, 5 (in 256), indexed by the area's frequency class (1–7) plus a counter, capped at the eighth entry. The counter rises by 1 with each encounter, up to 2, so the rate drops after fights; it returns to 0 in areas without encounters and after a fade-out transition. mother1/encounter-rate

About: EarthBound Beginnings Random encounter

Value
{
 "rates": [
  32,
  21,
  16,
  13,
  10,
  8,
  6,
  5
 ],
 "of": 256,
 "counterMax": 2
}
Codemother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/title.asm#L560-L594DoWalkingStep: … ;get areaEncounterDef based on area ldx map_area lda AREA_ENCOUNTER_LIST, x … ;else, write 0 sta UNK_24mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/title.asm#L614-L645 @EncounterFrequencyExists: clc … ;if frequency is >= 9, cap it to 8 adc UNK_24 cmp #9 bcc @NoForceCap lda #8 … ;get a random value jsr RNG_BYTE … …mother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/title.asm#L694-L696 AREA_FREQ_TABLE: ;lookup table for frequencies .byte 32,21,16,13,10,8,6,5EarthBound Beginnings (USA, Europe) (Virtual Console) · 0x2959B-0x295A2 — bank $14 $B58B, the eight rates as the ROM has themmother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/constant.asm#L2761-L2771 ;fade out B30_0b57: jsr BANKSET_H13 jsr OverworldTransitionIntepreter … lda #0 sta UNK_24Checked by claude-agent, 2026-10-21 — read the four ranges and the eight ROM bytes (file 0x2959B less the 16-byte header is 0x2958B, 8 KB bank $14 offset $158B; the main loop banks $14 in before calling DoWalkingStep, constant.asm L2889-L2890). The area byte's low three bits are the frequency class (L599-L603); class 0 reads a save flag instead (the zoo). The English build then lets the Repel Ring cancel the battle (L686-L690).

Cited by: EarthBound Beginnings, Random encounter, Visible encounter

In EarthBound Beginnings (English build), damage comes off the target's HP in one subtraction, and the target falls when it reaches 0 or below: there is no rolling meter. mother1/hp-at-once

About: EarthBound Beginnings Rolling HP meter

Codemother: Disassembly of Mother/Earthbound Zero/Earthbound Beginnings for the NES · src/global/prg/battle.asm#L4635-L4646; @UpdateHP Effect ldy target_offset sec lda BATTLER_CURR_HP, y sbc battle_wordvar60 sta BATTLER_CURR_HP, y lda BATTLER_CURR_HP+1, y sbc battle_wordvar60+1 sta BATTLER_CURR_HP+1, y bcc @DeathEffect ora BATTLER_CURR_HP, y beq @DeathEffectChecked by claude-agent, 2026-10-21 — read the range; DoDamage writes the reduced HP straight back and branches to the death effect in the same pass

Cited by: EarthBound Beginnings, Rolling HP meter