Skip to content

Implement native GBA Helping Hand and shared damage modifier - #198

Closed
Roxas2712 wants to merge 26 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-helping-hand
Closed

Roxas2712 wants to merge 26 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-helping-hand

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 24, 2026 •

Copy link
Copy Markdown

Imported GBA Helping Hand has no native handler, so portable mods cannot support a partner's move through ordinary engine execution. Register effect 176 and apply the native 1.5 modifier to the shared calculated damage after the critical multiplier and before STAB/type rounding.

The current living partner receives support once per round. Singles, missing partners, repeated support and a helper already supported by its partner fail normally. Status interruption, Protect flags, owned PP and imported priority remain authoritative. Support persists through actions/residual collection, resets at next-turn planning and does not transfer to a replacement battler. Fixed damage and confusion self-damage remain unmodified; other generations ignore the state.

Dependencies: #196 plus the existing #178 GBA base-damage and #175 critical-order corrections. Those published changes are reused as prerequisite commits. Review the two new feature commits relative to 45f5b4e. The additional #121 effect adapter enables canonical public effect = "HELPING_HAND" writes automatically without changing generated bindings.

Validation:

  • 5,322/5,322 focused checks across FireRed/Emerald: every helper flank, actual mod-selected attacks, public move/damage events, critical/noncritical hits, STAB, physical/special/spread moves, resistance/immunity, variation 85/100, fixed damage/confusion exclusions, refusal/repetition/replacement/lifetime, real priority queues, PP and non-GBA guards.
  • Same API-3 consumer and shared fixture against unchanged read-only Gen1Recomp 535a5ec088c1ae1bf4d91dd3e35a56f64cf46d91: 28 isolated workers / 1,916 paired observations pass, including prior enemy choices, selectors, records, targets and Follow Me.
  • Actual numeric example: level-30 Tackle, equal Attack/Defense, normal STAB and roll 100 produces 16 unassisted and 24 supported through both native executors.
  • Negative control on the clean prerequisite fails 391 assertions in the initial FireRed matrix.
  • Existing paired GBA base-damage and critical-order checks pass.
  • Full local quick run: 86/95 engine suites versus 85/94 on the clean prerequisite. The exact Counter of all 25 inherited FAIL lines across nine suites matches; no new failures. SDK 3/3 and B30 pass.
  • Intended native registry addition changes the fixture fingerprint from 128fc071ae7249cd to 032184f68094e9ca. Removing only that entry and invalidating the cache restores the old value.
  • Additional composition with Map portable move effects and secondary chances to native handlers #121: 12/12 checks load a real API-3 mod, patch/read the canonical effect and execute a publicly selected right-flank enemy move with supported damage and owned PP.
  • actionlint and git diff --check pass.

Sessions use equal stats and synthetic extractor-shaped move rows, not a fresh cartridge import. Dedicated set-damage/delayed executors (Spit Up, Beat Up, Future Sight/Doom Desire), their other existing semantic differences, full ability/held-item ordering, AI scoring, called/link moves and full gameplay/RNG parity remain separately auditable surfaces. Gen1 is a read-only reference; no Gen1 source change or publication is required. Hosted CI and combined-fork acceptance are reported separately.

Combined-fork acceptance: integrated into Roxas2712:codex/portability-testing, tested runtime bf67876. All 213/213 engine suites, 3/3 SDK suites and B30 pass with zero FAIL lines. The same 28-worker / 1,916-observation comparison passes on that clean runtime. The canonical-effect mod proof passes 12/12. Integration updates the previous missing-handler assertion and audits the intentional effect-section fingerprint change; all six other populated sections stay identical. Subsequent combined commits only record validation.

Hosted CI: all five workflows report action_required pending maintainer approval. The dedicated enemy-action contract workflow has zero executed jobs. These are separate from local acceptance.

# 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