Add a default item activation message

This commit is contained in:
Guangcong Luo 2019-01-05 04:00:29 -05:00
parent 7e82afd2de
commit c1f372b3a7
2 changed files with 3 additions and 1 deletions

View File

@ -60,6 +60,7 @@ exports.BattleText = {
useGem: " The [ITEM] strengthened [POKEMON]'s power!",
eatItemWeaken: " The [ITEM] weakened damage to [POKEMON]!",
removeItem: " [POKEMON] lost its [ITEM]!",
activateItem: " ([POKEMON] used its [ITEM]!)",
damage: " ([POKEMON] was hurt!)",
damagePercentage: " ([POKEMON] lost [PERCENTAGE] of its health!)",

View File

@ -473,7 +473,8 @@ class BattleTextParser {
const template = this.template('removeItem', kwArgs.from);
return line1 + template.replace('[POKEMON]', this.pokemon(pokemon)).replace('[ITEM]', this.effect(item)).replace('[SOURCE]', this.pokemon(kwArgs.of));
}
const template = this.template('end', item, 'NODEFAULT');
let template = this.template('end', item, 'NODEFAULT');
if (!template) template = this.template('activateItem').replace('[ITEM]', this.effect(item));
return line1 + template.replace('[POKEMON]', this.pokemon(pokemon)).replace('[TARGET]', this.pokemon(kwArgs.of));
}