Skip to content

Commit

Permalink
use upgradeArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 committed Sep 14, 2023
1 parent 6b1aa77 commit c838999
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/battle-text-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ class BattleTextParser {
break;
}

case '-heal': {
let [, pokemon] = args;
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 +937,7 @@ class BattleTextParser {
case '-heal': {
let [, pokemon] = args;
let template = this.template('heal', kwArgs.from, 'NODEFAULT');
const line1 = this.maybeAbility(kwArgs.from, BattleTextParser.effectId(kwArgs.from) === 'hospitality' ? kwArgs.of : 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
2 changes: 1 addition & 1 deletion src/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ export class Battle {
if (kwArgs.from) {
let effect = Dex.getEffect(kwArgs.from);
let ofpoke = this.getPokemon(kwArgs.of);
this.activateAbility(effect.id === 'hospitality' ? ofpoke : poke, effect);
this.activateAbility(ofpoke || poke, effect);
if (effect.effectType === 'Item' && !CONSUMED.includes(poke.prevItemEffect)) {
if (poke.prevItem !== effect.name) {
poke.item = effect.name;
Expand Down

0 comments on commit c838999

Please sign in to comment.