From 7d0e7f1d555787ee5304bb289c853fd5554ef5d3 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sun, 19 May 2024 20:12:49 +0100 Subject: [PATCH] Zero to Hero documentation and form reset on summon --- src/battle-scene.ts | 7 +++++-- src/data/ability.ts | 12 +++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 0f75447a500..61f585cfa60 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -45,7 +45,7 @@ import UIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin'; import { addUiThemeOverrides } from './ui/ui-theme'; import PokemonData from './system/pokemon-data'; import { Nature } from './data/nature'; -import { SpeciesFormChangeTimeOfDayTrigger, SpeciesFormChangeTrigger, pokemonFormChanges } from './data/pokemon-forms'; +import { SpeciesFormChangeManualTrigger, SpeciesFormChangeTimeOfDayTrigger, SpeciesFormChangeTrigger, pokemonFormChanges } from './data/pokemon-forms'; import { FormChangePhase, QuietFormChangePhase } from './form-change-phase'; import { BattleSpec } from './enums/battle-spec'; import { getTypeRgb } from './data/type'; @@ -931,7 +931,10 @@ export default class BattleScene extends SceneBase { for (let pokemon of this.getParty()) { if (pokemon) { if (resetArenaState) - pokemon.resetBattleData(); + { + pokemon.resetBattleData(); + this.triggerPokemonFormChange(pokemon, SpeciesFormChangeManualTrigger); + } this.triggerPokemonFormChange(pokemon, SpeciesFormChangeTimeOfDayTrigger); } } diff --git a/src/data/ability.ts b/src/data/ability.ts index e1e3b3bc8ce..d9dae04d1ce 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1703,7 +1703,9 @@ export class PreSwitchOutHealAbAttr extends PreSwitchOutAbAttr { } /** - * + * Attribute for form changes that occur on switching out + * @extends PreSwitchOutAbAttr + * @see {@linkcode applyPreSwitchOut} */ export class PreSwitchOutFormChangeAbAttr extends PreSwitchOutAbAttr { private formFunc: (p: Pokemon) => integer; @@ -1716,10 +1718,10 @@ export class PreSwitchOutFormChangeAbAttr extends PreSwitchOutAbAttr { /** * - * @param pokemon - * @param passive - * @param args - * @returns + * @param pokemon The pokemon switching out and changing form {@linkcode Pokemon} + * @param passive N/A + * @param args N/A + * @returns true if the form change was successful */ applyPreSwitchOut(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise { const formIndex = this.formFunc(pokemon);