Translate FireRed ability names where they are shown

Species, move, item and trainer names reach a translation mod through registries, but nothing renames abilities: battle messages ("<POKéMON>'s <ability> prevents ...") and the summary page printed the ROM's English name whatever the language.

Abilities.name and the summary's ability line now pass the name through Strings(), keyed by the cart's English name ("SPEED BOOST", "COMPOUNDEYES"). The identifiers the battle code compares (SPEED_BOOST) and the description lookup are unchanged.
This commit is contained in:
thibautbus
2026-09-19 19:45:30 +02:00
parent 7f4e54f312
commit 357e84ead5
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -8,9 +8,11 @@ local Abilities = {}
-- pokefirered/src/data/text/abilities.h:162
local DISPLAY = { COMPOUND_EYES = "COMPOUNDEYES", LIGHTNING_ROD = "LIGHTNINGROD" }
-- The name battle messages print. No registry renames abilities, so a
-- translation reaches them through Strings(), keyed by the cart's English.
function Abilities.name(ab)
if not ab then return "" end
return DISPLAY[ab] or (ab:gsub("_", " "))
return Strings(DISPLAY[ab] or (ab:gsub("_", " ")))
end
-- pokefirered/src/battle_util.c:31
+2 -1
View File
@@ -583,7 +583,8 @@ local function draw_page_skills(mon)
end
ability = ability or "—"
local ax, ay = cxy("abilityName", 74, 129)
draw_text(tostring(ability), ax, ay, 80, "NORMAL")
-- No registry renames abilities; a translation reaches the name through Strings().
draw_text(Strings(tostring(ability)), ax, ay, 80, "NORMAL")
local desc = SummaryData.abilityDescription(abilityId, tostring(ability))
local ad = coords().abilityDesc or { x = 10, y = 143, w = 232 }
draw_text(desc, ad.x or 10, ad.y or 143, ad.w or 232, "NORMAL")