Fix Mega evolution message in Let's Go

This commit is contained in:
Guangcong Luo
2018-11-20 15:02:46 -06:00
parent ee74274633
commit 69aa657e1a
2 changed files with 11 additions and 5 deletions

View File

@@ -24,6 +24,7 @@ exports.BattleText = {
abilityActivation: " [[POKEMON]'s [ABILITY]]",
mega: " [POKEMON]'s [ITEM] is reacting to the Key Stone!",
megaNoItem: " [POKEMON] is reacting to [TRAINER]'s Key Stone!",
megaGen6: " [POKEMON]'s [ITEM] is reacting to [TRAINER]'s Mega Bracelet!",
transformMega: "[POKEMON] has Mega Evolved into Mega [SPECIES]!",
primal: "[POKEMON]'s Primal Reversion! It reverted to its primal state!",
@@ -405,7 +406,7 @@ exports.BattleText = {
activate: " [TARGET] took the Doom Desire attack!",
},
dragonascent: {
mega: "[TRAINER]'s fervent wish has reached [POKEMON]!\n[POKEMON] has Mega Evolved into [SPECIES]!",
megaNoItem: " [TRAINER]'s fervent wish has reached [POKEMON]!",
},
electrify: {
start: " [POKEMON]'s moves have been electrified!",

View File

@@ -852,12 +852,17 @@ class BattleTextParser {
case '-mega': case '-primal': {
const [, pokemon, species, item] = args;
let id = '';
if (species === 'Rayquaza') id = 'dragonascent';
if (!id && cmd === '-mega' && this.gen < 7) cmd = '-megaGen6';
let template = this.template(cmd.slice(1));
let templateId = cmd.slice(1);
if (species === 'Rayquaza') {
id = 'dragonascent';
templateId = 'megaNoItem';
}
if (!id && cmd === '-mega' && this.gen < 7) templateId = 'megaGen6';
if (!item && cmd === '-mega') templateId = 'megaNoItem';
let template = this.template(templateId);
const side = pokemon.slice(0, 2);
const pokemonName = this.pokemon(pokemon);
if (cmd.startsWith('-mega')) {
if (cmd === '-mega') {
const template2 = this.template('transformMega');
template += template2.replace('[POKEMON]', pokemonName).replace('[SPECIES]', species);
}