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
This commit is contained in:
Dmitriy 2024-05-15 23:09:08 -04:00
parent 33f8365192
commit 89494fa0c8
3 changed files with 33 additions and 1 deletions

View File

@ -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()

View File

@ -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();

View File

@ -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<Moves> = [];
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<Moves> = [];
export const OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
export const OPP_SHINY_OVERRIDE: boolean = false;
export const OPP_VARIANT_OVERRIDE: Variant = 0;