fixed beahviour if 2+ opponents are on field, also added message

pull/632/head
Sbug98 2024-05-08 13:54:12 +02:00
parent 372635227a
commit d64f25d7cf
2 changed files with 8 additions and 4 deletions

View File

@ -2107,15 +2107,19 @@ export class PostTurnFormChangeAbAttr extends PostTurnAbAttr {
}
export class PostTurnHurtIfSleepingAbAttr extends PostTurnAbAttr {
applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> {
let hadEffect: boolean = false;
for(let oppo of pokemon.getOpponents()) {
if(oppo.status.effect == StatusEffect.SLEEP) {
oppo.damageAndUpdate(Math.ceil(oppo.getMaxHp() * (1 / 8)), HitResult.OTHER);
return true;
pokemon.scene.queueMessage(getPokemonMessage(oppo, ' is tormeted!'));
hadEffect = true;
}
}
return false;
return hadEffect;
}
}
export class PostBiomeChangeAbAttr extends AbAttr { }

View File

@ -16,8 +16,8 @@ export const DOUBLE_BATTLE_OVERRIDE = false;
export const ABILITY_OVERRIDE = Abilities.BAD_DREAMS;
export const PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;
export const MOVE_OVERRIDE = Moves.SLEEP_POWDER;
export const MOVE_OVERRIDE_2 = Moves.HYDRO_CANNON;
export const MOVE_OVERRIDE = Moves.DARK_VOID;
export const MOVE_OVERRIDE_2 = Moves.HYPER_BEAM;
export const OPP_SPECIES_OVERRIDE = 0;
export const OPP_ABILITY_OVERRIDE = Abilities.NONE;
export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;