mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-16 20:39:27 +02:00
ddd
This commit is contained in:
parent
ce8491f4a5
commit
ba6885d289
@ -1261,7 +1261,7 @@ export class EncoreTag extends MoveRestrictionBattlerTag {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!pokemon.getMoveset().some(m => m.moveId === this.moveId && m.ppUsed > 0)) {
|
||||
if (!pokemon.getMoveset().some(m => m.moveId === this.moveId && !m.isOutOfPp())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1318,7 +1318,7 @@ export class EncoreTag extends MoveRestrictionBattlerTag {
|
||||
*/
|
||||
override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||
const encoredMove = pokemon.getMoveset().find(m => m.moveId === this.moveId);
|
||||
if (isNullOrUndefined(encoredMove) || encoredMove.getPpRatio() <= 0) {
|
||||
if (isNullOrUndefined(encoredMove) || encoredMove.isOutOfPp()) {
|
||||
return false;
|
||||
}
|
||||
return super.lapse(pokemon, lapseType);
|
||||
|
@ -5711,9 +5711,9 @@ export class YawnAttr extends AddBattlerTagAttr {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: This displays a message for the cause and another "but it failed" message,
|
||||
// TODO: This does not display the cause of the "but it failed" message,
|
||||
// but fixing it would require a rework of the move failure system
|
||||
return target.canSetStatus(StatusEffect.SLEEP, false, false, user)
|
||||
return target.canSetStatus(StatusEffect.SLEEP, true, false, user)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ export class PokemonMove {
|
||||
this.ppUsed = Math.min(this.ppUsed + count, this.getMovePp());
|
||||
}
|
||||
|
||||
// TODO: Rename to `getMaxPP`
|
||||
getMovePp(): number {
|
||||
return this.maxPpOverride || this.getMove().pp + this.ppUp * toDmgValue(this.getMove().pp / 5);
|
||||
}
|
||||
@ -77,6 +78,10 @@ export class PokemonMove {
|
||||
return 1 - this.ppUsed / this.getMovePp();
|
||||
}
|
||||
|
||||
public isOutOfPp(): boolean {
|
||||
return this.ppUsed < this.getMovePp();
|
||||
}
|
||||
|
||||
getName(): string {
|
||||
return this.getMove().name;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user