Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Hospitality activation message #2150

Merged
merged 3 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/battle-text-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ class BattleTextParser {
break;
}

case '-heal': {
const id = BattleTextParser.effectId(kwArgs.from);
if (['dryskin', 'eartheater', 'voltabsorb', 'waterabsorb'].includes(id)) kwArgs.of = '';
break;
}

case '-nothing':
// OLD: |-nothing
// NEW: |-activate||move:Splash
Expand Down Expand Up @@ -930,7 +936,7 @@ class BattleTextParser {
case '-heal': {
let [, pokemon] = args;
let template = this.template('heal', kwArgs.from, 'NODEFAULT');
const line1 = this.maybeAbility(kwArgs.from, pokemon);
const line1 = this.maybeAbility(kwArgs.from, kwArgs.of || pokemon);
if (template) {
return line1 + template.replace('[POKEMON]', this.pokemon(pokemon)).replace('[SOURCE]', this.pokemon(kwArgs.of)).replace('[NICKNAME]', kwArgs.wisher);
}
Expand Down
3 changes: 2 additions & 1 deletion src/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,8 @@ export class Battle {

if (kwArgs.from) {
let effect = Dex.getEffect(kwArgs.from);
this.activateAbility(poke, effect);
let ofpoke = this.getPokemon(kwArgs.of);
this.activateAbility(ofpoke || poke, effect);
if (effect.effectType === 'Item' && !CONSUMED.includes(poke.prevItemEffect)) {
if (poke.prevItem !== effect.name) {
poke.item = effect.name;
Expand Down