mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-17 19:24:01 +02:00
Translate the stat name in RBY's X-item and vitamin rose! messages
Both the player-side and AI-trainer stat-rise messages (X ATTACK/ DEFENSE/etc. and the vitamins) passed the raised stat's name as a raw uppercase Lua string (stat:upper()), bypassing Strings() entirely, so it always rendered in English regardless of the active language even though the surrounding sentence template was already translated. Wrap the substituted stat name in Strings() at every call site (src/inventory/ItemEffects.lua's two player-side messages and src/battle/TrainerAI.lua's AI-trainer X-item message, found in review), reusing the same "ATTACK"/"DEFENSE"/"SPEED"/"SPECIAL"/"HP" keys SummaryMenu.lua's stat labels already look up the same way.
This commit is contained in:
@@ -124,7 +124,7 @@ function TrainerAI.useItem(battle, item)
|
||||
elseif X_STAT[item] then
|
||||
local stat = X_STAT[item]
|
||||
enemy.stages[stat] = math.min(6, (enemy.stages[stat] or 0) + 1)
|
||||
table.insert(msgs, Strings("%s's\n%s rose!", displayName(enemy), stat:upper()))
|
||||
table.insert(msgs, Strings("%s's\n%s rose!", displayName(enemy), Strings(stat:upper())))
|
||||
elseif item == "GUARD_SPEC" then
|
||||
enemy.mist = true
|
||||
table.insert(msgs, Strings("%s's\nprotected against\nstat changes!", displayName(enemy)))
|
||||
|
||||
@@ -294,7 +294,7 @@ function ItemEffects.use(data, save, itemId, target, battle, moveIndex, ow)
|
||||
"Nothing happened!") }
|
||||
end
|
||||
b.stages[stat] = cur + 1
|
||||
return "consumed", { Strings("%s's\n%s rose!", b.name, stat:upper()) }
|
||||
return "consumed", { Strings("%s's\n%s rose!", b.name, Strings(stat:upper())) }
|
||||
end
|
||||
-- ItemUseDireHit/ItemUseGuardSpec always set the bit and consume
|
||||
-- the item, even when it is already active
|
||||
@@ -493,7 +493,7 @@ function ItemEffects.use(data, save, itemId, target, battle, moveIndex, ow)
|
||||
-- Spanish ROM puts the stat before the name), so the extracted line
|
||||
-- cannot be filled positionally; the engine wording stands
|
||||
return "consumed", { Strings("%s's %s\nrose!", monName(data, target),
|
||||
vitaminStat == "hp" and "HP" or vitaminStat:upper()) }
|
||||
Strings(vitaminStat == "hp" and "HP" or vitaminStat:upper())) }
|
||||
end
|
||||
|
||||
-- PP UP boosts the move the player picked (ItemUsePPUp's move menu)
|
||||
|
||||
Reference in New Issue
Block a user