Extend ROM-text messages to statuses, items and the learn/evolve flows

This commit is contained in:
Juan Heredia
2026-08-03 22:54:08 +02:00
parent b831076839
commit a2bf08c6ff
7 changed files with 191 additions and 99 deletions
+6 -3
View File
@@ -385,8 +385,8 @@ local function displayName(b)
end
-- Apply the "Enemy " prefix to a pre-built message from a module that
-- only knows the raw nickname (Status.beforeMove/residual,
-- TrainerAI.useItem): splice it in before the first name occurrence.
-- only knows the raw nickname (Status.beforeMove/residual): splice it
-- in before the first name occurrence.
local function prefixEnemy(msg, battler)
if battler.isPlayer then return msg end
local s = msg:find(battler.name, 1, true)
@@ -3044,8 +3044,11 @@ function BattleState:executeAction(user, target, action)
-- trainer class AI actions (engine/battle/trainer_ai.asm)
if action.special == "aiItem" then
self.aiUses = (self.aiUses or 1) - 1
-- useItem's messages arrive final: its item line prints the raw
-- nickname on purpose (no "Enemy " in AIPrintItemUseText), so the
-- prefix splice must not touch them.
for _, m in ipairs(TrainerAI.useItem(self, action.item)) do
self:sayNext(prefixEnemy(m, self.enemy))
self:sayNext(m)
end
self:drainNext()
require("src.core.Sound").play(self.data, "Heal_Ailment")