2 Commits

Author SHA1 Message Date
bryanthaboi dee935a4ea CLOSES #2430 2026-09-23 11:58:32 -04:00
thibautbus b97c683743 Route FireRed battle messages through Strings()
Every message the game3 battle engine prints was built by concatenating English fragments around names ("X" .. " is hurt\nby poison!"), so a translation mod could not reach them, nor phrase a sentence other than as English splits it. They are now whole-sentence Strings() templates with the names as arguments (Strings("%s is hurt\nby poison!", name)), which renders the same English and lets a catalog word the whole sentence around each value. The one visible change is that effect messages now name abilities through Abilities.name, as the cart prints them (COMPOUNDEYES, LIGHTNINGROD) rather than from the identifier (COMPOUND EYES). Values still fill the template in call order (Strings() formats with string.format).

Fragment tables become full templates: status infliction, charge-turn and semi-invulnerable moves, Truant, berry flavours, held-item and enemy-item cures, and the stat-change lines (one template per rose/sharply rose/fell/harshly fell instead of a translated verb glued after the stat). Tables built at load time mark their keys with Strings.source() and are translated where they are said, since no catalog exists yet when the module loads. Stat names, the Ally/Foe prefixes, weather lines and screen names are translated at the time they are shown; the "a boosted" EXP line and the trainer send-out line become one template per variant rather than a fragment passed as an argument.

Code that read the English text back is fixed too: the double-battle send-out (animated and headless intros) no longer parses the trainer out of the translated "sent out" line, the battle UI paces the move-used line by its catalog wording, and AnimSeq recognises the miss, confusion, substitute, move-used and fainted lines it paces animations on through their catalog wording.
2026-09-19 23:04:31 +02:00