mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-29 21:12:45 +02:00
Added effect of reviver seed (leveraging consumable logic)
This commit is contained in:
parent
5c93a0c9b0
commit
15e729e3e8
@ -20,7 +20,6 @@ import type { EnemyPokemon } from "#app/field/pokemon";
|
|||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { HitResult, PlayerPokemon, PokemonMove } from "#app/field/pokemon";
|
import { HitResult, PlayerPokemon, PokemonMove } from "#app/field/pokemon";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import { PokemonInstantReviveModifier } from "#app/modifier/modifier";
|
|
||||||
import { SwitchType } from "#enums/switch-type";
|
import { SwitchType } from "#enums/switch-type";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { DamageAnimPhase } from "./damage-anim-phase";
|
import { DamageAnimPhase } from "./damage-anim-phase";
|
||||||
@ -33,6 +32,8 @@ import { VictoryPhase } from "./victory-phase";
|
|||||||
import { isNullOrUndefined } from "#app/utils/common";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import { FRIENDSHIP_LOSS_FROM_FAINT } from "#app/data/balance/starters";
|
import { FRIENDSHIP_LOSS_FROM_FAINT } from "#app/data/balance/starters";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
import { applyHeldItems } from "#app/items/all-held-items";
|
||||||
|
import { ITEM_EFFECT } from "#app/items/held-item";
|
||||||
|
|
||||||
export class FaintPhase extends PokemonPhase {
|
export class FaintPhase extends PokemonPhase {
|
||||||
public readonly phaseName = "FaintPhase";
|
public readonly phaseName = "FaintPhase";
|
||||||
@ -66,17 +67,7 @@ export class FaintPhase extends PokemonPhase {
|
|||||||
faintPokemon.resetSummonData();
|
faintPokemon.resetSummonData();
|
||||||
|
|
||||||
if (!this.preventInstantRevive) {
|
if (!this.preventInstantRevive) {
|
||||||
const instantReviveModifier = globalScene.applyModifier(
|
applyHeldItems(ITEM_EFFECT.INSTANT_REVIVE, { pokemon: faintPokemon });
|
||||||
PokemonInstantReviveModifier,
|
|
||||||
this.player,
|
|
||||||
faintPokemon,
|
|
||||||
) as PokemonInstantReviveModifier;
|
|
||||||
|
|
||||||
if (instantReviveModifier) {
|
|
||||||
faintPokemon.loseHeldItem(instantReviveModifier);
|
|
||||||
globalScene.updateModifiers(this.player);
|
|
||||||
return this.end();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user