Mechanic · combat · role-playing game
Status recovery
A status effect or lowered stat that can wear off before its countdown ends, on a roll a unit's stat improves.
On this page
Status recovery ends a status effect, or a lowered stat, before its countdown runs out. In Golden Sun each effect counts down, and once 5 or fewer turns remain a roll can end it early; the unit’s Luck raises the chance, each turn left lowers it, and each effect has its own base1.
- Stat rollGolden Sun (2001). A lowered stat or a status ends at 0 turns, or earlier on a roll of about (3 × Luck − 5 × turns left + a base)% once 5 or fewer turns remain.1
Games
| Game | Year | How | Note |
|---|---|---|---|
| Golden Sun | 2001 | Stat roll | a lowered stat or a status ends at 0 turns, or earlier on a roll of about (3 × Luck − 5 × turns left + a base)% once 5 or fewer turns remain |
Every claim about this mechanic, by game (1)
References
- ^ abIn the matching C of the North American and European release, eight unnamed functions (
Func_80bf250toFunc_80bf484) each count down one of a unit's turn counters by 1 per call: the attack, defense, and resist modifiers (attackModTurns,defenseModTurns,resistModTurns, field names from the decompilers'struct Unit), anddelude,confuse,charm,stun, andsleep. A counter that reaches 0 ends the effect, and for a modifier also zeroes the modifier. Otherwise the unnamedFunc_80bf208rolls for an early end, with the turns left T and a base B per counter: 30 for an attack modifier, 20 for defense and resist, 30 for delude, 60 for confuse, 70 for charm, 40 for stun, 50 for sleep. A modifier rolls only while it is negative (a lowered stat), so a raised stat lasts its full count. The roll happens only when T is 5 or less, and succeeds when (3 × the unit'sluck− 5T + B) × 655 is at least a 16-bitRPGRandomresult, so a check succeeds about (3 × Luck − 5T + B)% of the time (computed: 655 is about 1% of 65,536; the comparison is signed, so a negative sum never succeeds, and a sum over 100 always does). Success zeroes the counter, and a modifier's value too.Func_80bf208calls_GetUnitwith no argument, so the unit it reads is whatever its first argument left in r0, the unit being checked (the atlas's reading of the matching build). Which routines call these eight, and how often, is still assembly.CodeCoaltergeist/goldensun-decompHow we know
416unsigned int Func_80bf208(int arg0, int arg1, int arg2) ⋮ 418 int v; 419 int t; 420 v = _GetUnit(); 421 if (arg1 <= 5) { 422 int e; 423 e = *(unsigned char *)(v + 0x42); 424 t = (e * 3 - arg1 * 5 + arg2) * 0x28f; 425 if (t >= (_RPGRandom() & 0xffff)) 426 return 1; ⋮ 428 return 0;
src/battle/mechanics.c lines 416–429 at 2e5c504 · upstream ↗ 431unsigned int Func_80bf250(int unit) { ⋮ 438 base = _GetUnit(unit); 439 p = base + 0x132; 440 if (*p != 0) { 441 c = --*p; 442 zero = 0; 443 if (c == 0) { 444 base[0x133] = zero; 445 return 1; ⋮ 447 q = (signed char *)(base + 0x133); 448 if (*q < 0) { 449 if (Func_80bf208(unit, *p, 0x1e) != 0) { ⋮
src/battle/mechanics.c lines 431–457 at 2e5c504 · upstream ↗ 467 p = base + 0x134; ⋮ 475 q = (signed char *)(base + 0x135); 476 if (*q < 0) { 477 if (Func_80bf208(unit, *p, 0x14) != 0) { ⋮ 495 p = base + 0x136; ⋮ 503 q = (signed char *)(base + 0x137); 504 if (*q < 0) { 505 if (Func_80bf208(unit, *p, 0x14) != 0) {
src/battle/mechanics.c lines 459–513 at 2e5c504 · upstream ↗ 518 p = _GetUnit(unit) + 0x138; 519 if (*p != 0) { 520 if (--*p == 0) 521 return 1; 522 if (Func_80bf208(unit, *p, 0x1e) != 0) { 523 *p = 0; 524 return 1; ⋮ 533 p = _GetUnit(unit) + 0x139; 534 if (*p != 0) { 535 if (--*p == 0) 536 return 1; 537 if (Func_80bf208(unit, *p, 0x3c) != 0) { ⋮
src/battle/mechanics.c lines 515–587 at 2e5c504 · upstream ↗ 30 u8 luck; // 0x042include/rpg.h line 30 at 2e5c504 · upstream ↗ 50 u8 attackModTurns; // 0x132 51 u8 attackMod; // 0x133 52 u8 defenseModTurns; // 0x134 53 u8 defenseMod; // 0x135 54 u8 resistModTurns; // 0x136 55 u8 resistMod; // 0x137 56 u8 delude; // 0x138 57 u8 confuse; // 0x139 58 u8 charm; // 0x13A 59 u8 stun; // 0x13B 60 u8 sleep; // 0x13C
include/rpg.h lines 50–60 at 2e5c504 · upstream ↗ 62 .macro .export_func sym 63 .thumb_stub _\sym, \sym 64 .endm
include/macros.inc lines 62–64 at 2e5c504 · upstream ↗ 58 .export_func RPGRandomexports/rpg/exports.s line 58 at 2e5c504 · upstream ↗ 5unsigned short RPGRandom(void) { ⋮ 8 return state >> 8;
src/rpg/random.c lines 5–9 at 2e5c504 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-27.
Sources
Code
- Coaltergeist and goldensun-decomp contributors. 2026. “goldensun-decomp: a work-in-progress decompilation of Golden Sun for the Game Boy Advance (Coaltergeist/goldensun-decomp).” Commit 2e5c504. Coaltergeist/goldensun-decomp @ 2e5c504 · licence, all uses