From 89494fa0c8633c90d42457ff1f125ebebd7153e5 Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Wed, 15 May 2024 23:09:08 -0400 Subject: [PATCH] Add unthaw to moves that are missing it Add unthaw to all damaging fire moves Add Status Effect overrides for easier testing clean up comments and readd status cure before fainting --- src/data/move.ts | 23 ++++++++++++++++++++++- src/field/pokemon.ts | 8 ++++++++ src/overrides.ts | 3 +++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index 2d27afcbe47..438255db32c 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -387,6 +387,14 @@ export default class Move implements Localizable { export class AttackMove extends Move { constructor(id: Moves, type: Type, category: MoveCategory, power: integer, accuracy: integer, pp: integer, chance: integer, priority: integer, generation: integer) { super(id, type, category, MoveTarget.NEAR_OTHER, power, accuracy, pp, chance, priority, generation); + + /** + * {@link https://bulbapedia.bulbagarden.net/wiki/Freeze_(status_condition)} + * > All damaging Fire-type moves can now thaw a frozen target, regardless of whether or not they have a chance to burn; + */ + if (this.type === Type.FIRE) { + this.attrs.push(new HealStatusEffectAttr(false, StatusEffect.FREEZE)); + } } getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { @@ -1569,9 +1577,19 @@ export class StealEatBerryAttr extends EatBerryAttr { } } +/** + * Move attribute that signals that that move should cure a status effect + * @extends MoveEffectAttr + * @see {@linkcode apply()} + */ export class HealStatusEffectAttr extends MoveEffectAttr { + /** Array of Status Effects to cure */ private effects: StatusEffect[]; - + + /** + * @param selfTarget - Whether this move targets the user + * @param ...effects - Array of status effects to cure + */ constructor(selfTarget: boolean, ...effects: StatusEffect[]) { super(selfTarget); @@ -6373,6 +6391,7 @@ export function initMoves() { .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.STEAM_ERUPTION, Type.WATER, MoveCategory.SPECIAL, 110, 95, 5, 30, 0, 6) .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE) + .attr(HealStatusEffectAttr, false, StatusEffect.FREEZE) .attr(StatusEffectAttr, StatusEffect.BURN), new AttackMove(Moves.HYPERSPACE_HOLE, Type.PSYCHIC, MoveCategory.SPECIAL, 80, -1, 5, -1, 0, 6) .ignoresProtect(), @@ -7049,6 +7068,7 @@ export function initMoves() { .attr(MultiHitAttr, MultiHitType._2), new AttackMove(Moves.SCORCHING_SANDS, Type.GROUND, MoveCategory.SPECIAL, 70, 100, 10, 30, 0, 8) .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE) + .attr(HealStatusEffectAttr, false, StatusEffect.FREEZE) .attr(StatusEffectAttr, StatusEffect.BURN), new StatusMove(Moves.JUNGLE_HEALING, Type.GRASS, -1, 10, -1, 0, 8) .attr(HealAttr, 0.25, true, false) @@ -7431,6 +7451,7 @@ export function initMoves() { new AttackMove(Moves.MATCHA_GOTCHA, Type.GRASS, MoveCategory.SPECIAL, 80, 90, 15, 20, 0, 9) .attr(HitHealAttr) .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE) + .attr(HealStatusEffectAttr, false, StatusEffect.FREEZE) .attr(StatusEffectAttr, StatusEffect.BURN) .target(MoveTarget.ALL_NEAR_ENEMIES) .triageMove() diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index abce327a645..44ee398e740 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2561,6 +2561,10 @@ export class PlayerPokemon extends Pokemon { constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex: integer, formIndex: integer, gender: Gender, shiny: boolean, variant: Variant, ivs: integer[], nature: Nature, dataSource: Pokemon | PokemonData) { super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource); + if (Overrides.STATUS_OVERRIDE) { + this.status = new Status(Overrides.STATUS_OVERRIDE) + } + if (Overrides.SHINY_OVERRIDE) { this.shiny = true; this.initShinySparkle(); @@ -2951,6 +2955,10 @@ export class EnemyPokemon extends Pokemon { if (boss) this.setBoss(); + if (Overrides.OPP_STATUS_OVERRIDE) { + this.status = new Status(Overrides.OPP_STATUS_OVERRIDE) + } + if (!dataSource) { this.generateAndPopulateMoveset(); diff --git a/src/overrides.ts b/src/overrides.ts index b7307ab2f7f..bed50efc606 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -11,6 +11,7 @@ import { Type } from './data/type'; import { Stat } from './data/pokemon-stat'; import { PokeballCounts } from './battle-scene'; import { PokeballType } from './data/pokeball'; +import { StatusEffect } from './data/status-effect'; /** * Overrides for testing different in game situations @@ -58,6 +59,7 @@ export const STARTER_SPECIES_OVERRIDE: Species | integer = 0; export const ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const MOVESET_OVERRIDE: Array = []; +export const STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; export const SHINY_OVERRIDE: boolean = false; export const VARIANT_OVERRIDE: Variant = 0; @@ -69,6 +71,7 @@ export const OPP_SPECIES_OVERRIDE: Species | integer = 0; export const OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE; export const OPP_MOVESET_OVERRIDE: Array = []; +export const OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; export const OPP_SHINY_OVERRIDE: boolean = false; export const OPP_VARIANT_OVERRIDE: Variant = 0;