Skip to content

Calculate native GBA Beat Up damage per party member - #206

Closed
Roxas2712 wants to merge 30 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-beat-up
Closed

Roxas2712 wants to merge 30 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-beat-up

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 24, 2026 •

Copy link
Copy Markdown

Beat Up currently reuses ordinary damage for every healthy party member. Native GBA execution instead calculates each participant's level/species-base damage independently, then applies Helping Hand, a separate critical roll and variation. The six-member fixture must produce 3, 5, 7, 4, 9 and 6 rather than six copies of the active user's damage.

Add a dedicated native party executor and a per-hit damage seam. Read eligibility after accuracy and live between callbacks; retain owned PP once, continue after breaking Substitute, stop at fainting, and preserve the source's special/neutral/noncritical event metadata. Special counter memory keeps the last direct strike, including zero HP loss under Endure. Earlier-generation fallback remains separate.

Stacked on #203. Review feature commits ade8abd, 5538fa4 and 92ade2b relative to 8c7df4d. The composed canonical effect proof additionally requires #121.

Validation:

  • 1,330/1,330 focused checks across FireRed/Emerald and all four user positions: mixed teams, live party filtering, levels/base stats, individual critical/variation rolls, Helping Hand, type/stat independence, interruption/miss/Protect, Substitute, fainting, Endure and callback mutations.
  • Same actual API-3 consumer/fixture against clean read-only Gen1Recomp 535a5ec088c1ae1bf4d91dd3e35a56f64cf46d91: 40 isolated workers / 4,486 paired observations pass, including active target versus retained party species, and earlier enemy-action, target, Follow Me, Helping Hand and Spit Up contracts. A shared real content patch changes MEW's base Attack and the resulting native strikes.
  • Negative control: unchanged Match native GBA Spit Up damage and Stockpile consumption #203 fails 168 assertions in the new FireRed cases. The Endure and active-target-species regressions each failed 16 assertions before their respective fixes.
  • Full quick feature run on final production code: 88/97 engine suites versus 87/96 on clean Match native GBA Spit Up damage and Stockpile consumption #203. Exact Counters of all 25 inherited FAIL lines across nine suites match; no additions. SDK 3/3 and B30 pass.
  • With Map portable move effects and secondary chances to native handlers #121 composed: 14/14 checks load a real mod, patch canonical EFFECT_BEAT_UP and species base stats, execute the selected move, and verify individual amounts, owned PP, last-strike memory and zero ordinary damage/critical callbacks.
  • BEAT_UP_EFFECT revision 1 changes fixture digest 397df21576af62f1 to d518411055f17444. Only move_effects changes (c62807cde682a669 to f45a80ce5e45ef42); removing the revision restores the former digest.
  • actionlint, scoped StyLua and git diff --check pass.

Both engines and the contract workflow use maintained JIT-enabled LuaJIT v2.1 commit a4c064539ea931274d407e1249b4bb575424a0f4. RNG observations normalize semantic critical/variation operands; no complete raw RNG-trace parity is claimed.

Synthetic imported-shaped rows and ordinary side parties are covered. Focus Band's native adjustment schedule, joined multi-trainer/link parties, intro/tutorial controllers, animations and complete gameplay remain separate acceptance surfaces. Gen1 is read-only; no Gen1 source modification or publication is required. Combined-fork acceptance and hosted CI are reported below.

Hosted CI for 92ade2b: all five workflows report action_required pending maintainer approval. The dedicated contract workflow has zero executed jobs. Local acceptance is separate.

Combined-fork acceptance: integrated into Roxas2712:codex/portability-testing, tested clean runtime f6f3bfe. All 215/215 engine suites, 3/3 SDK suites and B30 pass with zero FAIL lines. The same 40-worker / 4,486-observation comparison passes on that clean runtime, and the real canonical-effect mod proof passes 14/14. Integration preserves the existing fourth damage-adjustment argument, GBA Substitute counter guard and battle-scoped party fallback, and updates only the audited effect-section fingerprint pin. Subsequent combined commits only record validation.

Active-species cases seed the actual native battler fields separately from retained party species; they do not claim the full Transform animation/controller path.

# Conflicts:
#	src/mods/Loader.lua
# Conflicts:
#	docs/modding.md
#	src/mods/Loader.lua
#	src/world/WorldAPI.lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant