add OverridesHelper.enemyStatusEffect()

This commit is contained in:
Felix Staud 2024-07-25 16:45:58 -07:00
parent 4338f7b927
commit fa8e9c38bc
1 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import { StatusEffect } from "#app/data/status-effect.js";
import { Weather, WeatherType } from "#app/data/weather";
import { Abilities } from "#app/enums/abilities.js";
import { Biome } from "#app/enums/biome";
@ -242,6 +243,17 @@ export class OverridesHelper {
return this;
}
/**
* Override the enemy (pokemon) {@linkcode StatusEffect | status-effect}
* @param statusEffect the {@linkcode StatusEffect | status-effect} to set
* @returns
*/
enemyStatusEffect(statusEffect: StatusEffect): this {
vi.spyOn(Overrides, "OPP_STATUS_OVERRIDE", "get").mockReturnValue(statusEffect);
this.log(`Enemy Pokemon status-effect set to ${StatusEffect[statusEffect]} (=${statusEffect})!`);
return this;
}
private log(...params: any[]) {
console.log("Overrides:", ...params);
}