4 Commits

Author SHA1 Message Date
bryanthaboi dee935a4ea CLOSES #2430 2026-09-23 11:58:32 -04:00
bryanthaboi d920f7acdb clean up 2026-09-22 17:05:12 -04:00
Shane McGovern 1cf9c5109c Implement DoDeoxysTriangleInteraction (Birth Island Deoxys event)
Ports pokefirered's Birth Island Deoxys puzzle and its battle in full.

Puzzle (src/core/game3/deoxys.lua), from src/field_specials.c:2319-2456:
- Task_DoDeoxysTriangleInteraction with the 11 rock positions, the 10
  per-step caps and the pre-reset step-counter read that pret uses.
- IncrementBirthIslandRockStepCount wired into StepEvents.onStepTaken.
- MoveDeoxysObject / SetDeoxysTrianglePalette palette swaps, realised via
  a new OwSprites.setObjectPalette colour substitution because palettes
  are baked to RGBA at extract time.
- FLDEFF_MOVE_DEOXYS_ROCK (67) and FLDEFF_DESTROY_DEOXYS_ROCK (68), plus
  setfieldeffectargument plumbing and the rock-move lerp / rock-shatter
  field effects.
- DoDeoxysTriangleInteraction = 0x1AB added to Std.SPECIAL, with real
  handlers for it and SetDeoxysTrianglePalette.

Battle: seteventmon SPECIES_DEOXYS, 30 expands to CreateEnemyEventMon,
which the engine already implements, so the encounter flows through
Encounters._pendingWild into StartLegendaryBattle. No new code needed
there; tests now pin the whole chain.

Fixes the Deoxys battle theme. Both battle-BGM sites gated on species
386, but FRLG's SPECIES_DEOXYS is 410 (species.h:419) and 386 is
SPECIES_VOLBEAT (species.h:395), so Deoxys silently fell through to the
generic wild theme. Extracted Audio.legendaryBattleSong as the single
source of truth, keyed by the FRLG internal species id, matching the
switch in src/battle_setup.c:349.

Verification: 24/24 Deoxys groups, game3_special_events_test,
engine tier 593/593, luacheck 0/0 in 970 files, plus the hand-run
game3 battle/field-effect/object/step suites.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-21 18:43:47 +01:00
bryanthaboi 92b4fb9eb5 firered: forced movement, darkness, safari, rocket hideout, victory road, script ops 2026-09-20 21:17:57 -04:00