further fixed
parent
d64f25d7cf
commit
0d9abe349e
src/data
|
@ -2107,11 +2107,11 @@ export class PostTurnFormChangeAbAttr extends PostTurnAbAttr {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PostTurnHurtIfSleepingAbAttr extends PostTurnAbAttr {
|
export class PostTurnHurtIfSleepingAbAttr extends PostTurnAbAttr {
|
||||||
|
|
||||||
applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> {
|
applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> {
|
||||||
let hadEffect: boolean = false;
|
let hadEffect: boolean = false;
|
||||||
for(let oppo of pokemon.getOpponents()) {
|
for(let oppo of pokemon.getOpponents()) {
|
||||||
if(oppo.status.effect == StatusEffect.SLEEP) {
|
if(oppo.status !== undefined && oppo.status.effect == StatusEffect.SLEEP) {
|
||||||
oppo.damageAndUpdate(Math.ceil(oppo.getMaxHp() * (1 / 8)), HitResult.OTHER);
|
oppo.damageAndUpdate(Math.ceil(oppo.getMaxHp() * (1 / 8)), HitResult.OTHER);
|
||||||
pokemon.scene.queueMessage(getPokemonMessage(oppo, ' is tormeted!'));
|
pokemon.scene.queueMessage(getPokemonMessage(oppo, ' is tormeted!'));
|
||||||
hadEffect = true;
|
hadEffect = true;
|
||||||
|
|
Loading…
Reference in New Issue