Fix max elixir logic not working properly
This commit is contained in:
parent
c5eb86b0b1
commit
9a00090617
|
@ -900,7 +900,7 @@ export class PokemonPpRestoreModifier extends ConsumablePokemonMoveModifier {
|
||||||
apply(args: any[]): boolean {
|
apply(args: any[]): boolean {
|
||||||
const pokemon = args[0] as Pokemon;
|
const pokemon = args[0] as Pokemon;
|
||||||
const move = pokemon.getMoveset()[this.moveIndex];
|
const move = pokemon.getMoveset()[this.moveIndex];
|
||||||
move.ppUsed = this.restorePoints >= -1 ? Math.max(move.ppUsed - this.restorePoints, 0) : 0;
|
move.ppUsed = this.restorePoints > -1 ? Math.max(move.ppUsed - this.restorePoints, 0) : 0;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -918,7 +918,7 @@ export class PokemonAllMovePpRestoreModifier extends ConsumablePokemonModifier {
|
||||||
apply(args: any[]): boolean {
|
apply(args: any[]): boolean {
|
||||||
const pokemon = args[0] as Pokemon;
|
const pokemon = args[0] as Pokemon;
|
||||||
for (let move of pokemon.getMoveset())
|
for (let move of pokemon.getMoveset())
|
||||||
move.ppUsed = this.restorePoints >= -1 ? Math.max(move.ppUsed - this.restorePoints, 0) : 0;
|
move.ppUsed = this.restorePoints > -1 ? Math.max(move.ppUsed - this.restorePoints, 0) : 0;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue