Skip to content

Commit

Permalink
Tooltip: Count Rage Fist power (#2036)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviettran committed Dec 4, 2022
1 parent 9f42e01 commit d7ff75c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/battle-tooltips.ts
Expand Up @@ -1784,6 +1784,13 @@ class BattleTooltips {
value.setRange(isGKLK ? 20 : 40, 120);
}
}
// Base power based on times hit
if (move.id === 'ragefist') {
value.set(Math.min(350, 50 + 50 * pokemon.timesAttacked),
pokemon.timesAttacked > 0
? `Hit ${pokemon.timesAttacked} time${pokemon.timesAttacked > 1 ? 's' : ''}`
: undefined);
}
if (!value.value) return value;

// Other ability boosts
Expand Down
3 changes: 3 additions & 0 deletions src/battle.ts
Expand Up @@ -103,6 +103,7 @@ export class Pokemon implements PokemonDetails, PokemonHealth {
/** [[moveName, ppUsed]] */
moveTrack: [string, number][] = [];
statusData = {sleepTurns: 0, toxicTurns: 0};
timesAttacked = 0;

sprite: PokemonSprite;

Expand Down Expand Up @@ -1682,6 +1683,7 @@ export class Battle {
break;
}
} else {
poke.timesAttacked += 1;
let damageinfo = '' + Pokemon.getFormattedRange(range, damage[1] === 100 ? 0 : 1, '\u2013');
if (damage[1] !== 100) {
let hover = '' + ((damage[0] < 0) ? '\u2212' : '') +
Expand Down Expand Up @@ -2416,6 +2418,7 @@ export class Battle {
poke.boosts = {...tpoke.boosts};
poke.copyTypesFrom(tpoke);
poke.ability = tpoke.ability;
poke.timesAttacked = tpoke.timesAttacked;
const targetForme = tpoke.volatiles.formechange;
const speciesForme = (targetForme && !targetForme[1].endsWith('-Gmax')) ? targetForme[1] : tpoke.speciesForme;
const pokemon = tpoke;
Expand Down

0 comments on commit d7ff75c

Please sign in to comment.