mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-16 08:11:35 +02:00
Extend ROM-text messages to statuses, items and the learn/evolve flows
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user