From 372635227a5fcfd1c31256a16d696944594d7d50 Mon Sep 17 00:00:00 2001 From: Sbug98 Date: Wed, 8 May 2024 13:26:19 +0200 Subject: [PATCH] first implementation, needs testing with healer --- src/data/ability.ts | 14 +++++++++++++- src/overrides.ts | 8 ++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 0d2c0cc27..a6551789e 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2106,6 +2106,18 @@ export class PostTurnFormChangeAbAttr extends PostTurnAbAttr { } } +export class PostTurnHurtIfSleepingAbAttr extends PostTurnAbAttr { + applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise { + 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 PostBiomeChangeWeatherChangeAbAttr extends PostBiomeChangeAbAttr { @@ -3050,7 +3062,7 @@ export function initAbilities() { .ignorable() .partial(), new Ability(Abilities.BAD_DREAMS, 4) - .unimplemented(), + .attr(PostTurnHurtIfSleepingAbAttr), new Ability(Abilities.PICKPOCKET, 5) .attr(PostDefendStealHeldItemAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT)), new Ability(Abilities.SHEER_FORCE, 5) diff --git a/src/overrides.ts b/src/overrides.ts index 7608275ea..ef8fce815 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -7,17 +7,17 @@ import { WeatherType } from "./data/weather"; export const SEED_OVERRIDE = ''; export const STARTER_SPECIES_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_BIOME_OVERRIDE = Biome.TOWN; export const STARTING_MONEY_OVERRIDE = 0; export const WEATHER_OVERRIDE = WeatherType.NONE; 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 MOVE_OVERRIDE = Moves.NONE; -export const MOVE_OVERRIDE_2 = Moves.NONE; +export const MOVE_OVERRIDE = Moves.SLEEP_POWDER; +export const MOVE_OVERRIDE_2 = Moves.HYDRO_CANNON; export const OPP_SPECIES_OVERRIDE = 0; export const OPP_ABILITY_OVERRIDE = Abilities.NONE; export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;