first implementation, needs testing with healer

pull/632/head
Sbug98 2024-05-08 13:26:19 +02:00
parent d34ece258c
commit 372635227a
2 changed files with 17 additions and 5 deletions

View File

@ -2106,6 +2106,18 @@ export class PostTurnFormChangeAbAttr extends PostTurnAbAttr {
} }
} }
export class PostTurnHurtIfSleepingAbAttr extends PostTurnAbAttr {
applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> {
for(let oppo of pokemon.getOpponents()) {
if(oppo.status.effect == StatusEffect.SLEEP) {
oppo.damageAndUpdate(Math.ceil(oppo.getMaxHp() * (1 / 8)), HitResult.OTHER);
return true;
}
}
return false;
}
}
export class PostBiomeChangeAbAttr extends AbAttr { } export class PostBiomeChangeAbAttr extends AbAttr { }
export class PostBiomeChangeWeatherChangeAbAttr extends PostBiomeChangeAbAttr { export class PostBiomeChangeWeatherChangeAbAttr extends PostBiomeChangeAbAttr {
@ -3050,7 +3062,7 @@ export function initAbilities() {
.ignorable() .ignorable()
.partial(), .partial(),
new Ability(Abilities.BAD_DREAMS, 4) new Ability(Abilities.BAD_DREAMS, 4)
.unimplemented(), .attr(PostTurnHurtIfSleepingAbAttr),
new Ability(Abilities.PICKPOCKET, 5) new Ability(Abilities.PICKPOCKET, 5)
.attr(PostDefendStealHeldItemAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT)), .attr(PostDefendStealHeldItemAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT)),
new Ability(Abilities.SHEER_FORCE, 5) new Ability(Abilities.SHEER_FORCE, 5)

View File

@ -7,17 +7,17 @@ import { WeatherType } from "./data/weather";
export const SEED_OVERRIDE = ''; export const SEED_OVERRIDE = '';
export const STARTER_SPECIES_OVERRIDE = 0; export const STARTER_SPECIES_OVERRIDE = 0;
export const STARTER_FORM_OVERRIDE = 0; export const STARTER_FORM_OVERRIDE = 0;
export const STARTING_LEVEL_OVERRIDE = 0; export const STARTING_LEVEL_OVERRIDE = 20;
export const STARTING_WAVE_OVERRIDE = 0; export const STARTING_WAVE_OVERRIDE = 0;
export const STARTING_BIOME_OVERRIDE = Biome.TOWN; export const STARTING_BIOME_OVERRIDE = Biome.TOWN;
export const STARTING_MONEY_OVERRIDE = 0; export const STARTING_MONEY_OVERRIDE = 0;
export const WEATHER_OVERRIDE = WeatherType.NONE; export const WEATHER_OVERRIDE = WeatherType.NONE;
export const DOUBLE_BATTLE_OVERRIDE = false; export const DOUBLE_BATTLE_OVERRIDE = false;
export const ABILITY_OVERRIDE = Abilities.NONE; export const ABILITY_OVERRIDE = Abilities.BAD_DREAMS;
export const PASSIVE_ABILITY_OVERRIDE = Abilities.NONE; export const PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;
export const MOVE_OVERRIDE = Moves.NONE; export const MOVE_OVERRIDE = Moves.SLEEP_POWDER;
export const MOVE_OVERRIDE_2 = Moves.NONE; export const MOVE_OVERRIDE_2 = Moves.HYDRO_CANNON;
export const OPP_SPECIES_OVERRIDE = 0; export const OPP_SPECIES_OVERRIDE = 0;
export const OPP_ABILITY_OVERRIDE = Abilities.NONE; export const OPP_ABILITY_OVERRIDE = Abilities.NONE;
export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE; export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;