mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-05-03 15:04:56 +01:00
parent
3af1bdbcff
commit
7a9fc3fc8d
@ -6145,7 +6145,7 @@ export class RevivalBlessingAttr extends MoveEffectAttr {
|
||||
const faintedPokemon = globalScene.getEnemyParty().filter((p) => p.isFainted() && !p.isBoss());
|
||||
const pokemon = faintedPokemon[user.randSeedInt(faintedPokemon.length)];
|
||||
const slotIndex = globalScene.getEnemyParty().findIndex((p) => pokemon.id === p.id);
|
||||
pokemon.resetStatus();
|
||||
pokemon.resetStatus(true, false, false, true);
|
||||
pokemon.heal(Math.min(toDmgValue(0.5 * pokemon.getMaxHp()), pokemon.getMaxHp()));
|
||||
globalScene.queueMessage(i18next.t("moveTriggers:revivalBlessing", { pokemonName: getPokemonNameWithAffix(pokemon) }), 0, true);
|
||||
const allyPokemon = user.getAlly();
|
||||
|
@ -5608,13 +5608,44 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
* @param revive Whether revive should be cured; defaults to true.
|
||||
* @param confusion Whether resetStatus should include confusion or not; defaults to false.
|
||||
* @param reloadAssets Whether to reload the assets or not; defaults to false.
|
||||
* @param asPhase Whether to reset the status in a phase or immediately
|
||||
*/
|
||||
resetStatus(revive = true, confusion = false, reloadAssets = false): void {
|
||||
resetStatus(revive = true, confusion = false, reloadAssets = false, asPhase = true): void {
|
||||
const lastStatus = this.status?.effect;
|
||||
if (!revive && lastStatus === StatusEffect.FAINT) {
|
||||
return;
|
||||
}
|
||||
globalScene.unshiftPhase(new ResetStatusPhase(this, confusion, reloadAssets));
|
||||
|
||||
if (asPhase) {
|
||||
globalScene.unshiftPhase(new ResetStatusPhase(this, confusion, reloadAssets));
|
||||
} else {
|
||||
this.clearStatus(confusion, reloadAssets);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the action of clearing a Pokemon's status
|
||||
*
|
||||
* This is a helper to {@linkcode resetStatus}, which should be called directly instead of this method
|
||||
*/
|
||||
public clearStatus(confusion: boolean, reloadAssets: boolean) {
|
||||
const lastStatus = this.status?.effect;
|
||||
this.status = null;
|
||||
if (lastStatus === StatusEffect.SLEEP) {
|
||||
this.setFrameRate(10);
|
||||
if (this.getTag(BattlerTagType.NIGHTMARE)) {
|
||||
this.lapseTag(BattlerTagType.NIGHTMARE);
|
||||
}
|
||||
}
|
||||
if (confusion) {
|
||||
if (this.getTag(BattlerTagType.CONFUSED)) {
|
||||
this.lapseTag(BattlerTagType.CONFUSED);
|
||||
}
|
||||
}
|
||||
if (reloadAssets) {
|
||||
this.loadAssets(false).then(() => this.playAnim());
|
||||
}
|
||||
this.updateInfo(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1953,7 +1953,7 @@ export class PokemonInstantReviveModifier extends PokemonHeldItemModifier {
|
||||
);
|
||||
|
||||
// Remove the Pokemon's FAINT status
|
||||
pokemon.resetStatus(true, false, true);
|
||||
pokemon.resetStatus(true, false, true, false);
|
||||
|
||||
// Reapply Commander on the Pokemon's side of the field, if applicable
|
||||
const field = pokemon.isPlayer() ? globalScene.getPlayerField() : globalScene.getEnemyField();
|
||||
@ -2161,7 +2161,7 @@ export class PokemonHpRestoreModifier extends ConsumablePokemonModifier {
|
||||
restorePoints = Math.floor(restorePoints * multiplier);
|
||||
}
|
||||
if (this.fainted || this.healStatus) {
|
||||
pokemon.resetStatus(true, true);
|
||||
pokemon.resetStatus(true, true, false, false);
|
||||
}
|
||||
pokemon.hp = Math.min(
|
||||
pokemon.hp +
|
||||
@ -2181,7 +2181,7 @@ export class PokemonStatusHealModifier extends ConsumablePokemonModifier {
|
||||
* @returns always `true`
|
||||
*/
|
||||
override apply(playerPokemon: PlayerPokemon): boolean {
|
||||
playerPokemon.resetStatus(true, true);
|
||||
playerPokemon.resetStatus(true, true, false, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ export class PartyHealPhase extends BattlePhase {
|
||||
globalScene.ui.fadeOut(1000).then(() => {
|
||||
for (const pokemon of globalScene.getPlayerParty()) {
|
||||
pokemon.hp = pokemon.getMaxHp();
|
||||
pokemon.resetStatus();
|
||||
pokemon.resetStatus(true, false, false, true);
|
||||
for (const move of pokemon.moveset) {
|
||||
move.ppUsed = 0;
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { BattlePhase } from "#app/phases/battle-phase";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
|
||||
/**
|
||||
* Phase which handles resetting a Pokemon's status to none
|
||||
@ -22,23 +20,7 @@ export class ResetStatusPhase extends BattlePhase {
|
||||
}
|
||||
|
||||
public override start() {
|
||||
const lastStatus = this.pokemon.status?.effect;
|
||||
this.pokemon.status = null;
|
||||
if (lastStatus === StatusEffect.SLEEP) {
|
||||
this.pokemon.setFrameRate(10);
|
||||
if (this.pokemon.getTag(BattlerTagType.NIGHTMARE)) {
|
||||
this.pokemon.lapseTag(BattlerTagType.NIGHTMARE);
|
||||
}
|
||||
}
|
||||
if (this.affectConfusion) {
|
||||
if (this.pokemon.getTag(BattlerTagType.CONFUSED)) {
|
||||
this.pokemon.lapseTag(BattlerTagType.CONFUSED);
|
||||
}
|
||||
}
|
||||
if (this.reloadAssets) {
|
||||
this.pokemon.loadAssets(false).then(() => this.pokemon.playAnim());
|
||||
}
|
||||
this.pokemon.updateInfo(true);
|
||||
this.pokemon.clearStatus(this.affectConfusion, this.reloadAssets);
|
||||
this.end();
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ export class RevivalBlessingPhase extends BattlePhase {
|
||||
}
|
||||
|
||||
pokemon.resetTurnData();
|
||||
pokemon.resetStatus();
|
||||
pokemon.resetStatus(true, false, false, false);
|
||||
pokemon.heal(Math.min(toDmgValue(0.5 * pokemon.getMaxHp()), pokemon.getMaxHp()));
|
||||
globalScene.queueMessage(
|
||||
i18next.t("moveTriggers:revivalBlessing", {
|
||||
|
Loading…
x
Reference in New Issue
Block a user