Remove passing of grudge and destiny bond tags to faint phase

This commit is contained in:
Sirz Benjie 2025-04-08 15:43:23 -05:00
parent 60f507e015
commit 3e9cc86217
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
2 changed files with 11 additions and 30 deletions

View File

@ -131,6 +131,7 @@ import {
TarShotTag,
AutotomizedTag,
PowerTrickTag,
type GrudgeTag,
} from "../data/battler-tags";
import { WeatherType } from "#enums/weather-type";
import {
@ -4544,8 +4545,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
new FaintPhase(
this.getBattlerIndex(),
false,
destinyTag,
grudgeTag,
source,
),
);
@ -4780,6 +4779,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return false;
}
/**@overload */
getTag(tagType: BattlerTagType.GRUDGE): GrudgeTag | nil;
/** @overload */
getTag(tagType: BattlerTagType): BattlerTag | nil;

View File

@ -9,7 +9,6 @@ import {
PostKnockOutAbAttr,
PostVictoryAbAttr,
} from "#app/data/ability";
import type { DestinyBondTag, GrudgeTag } from "#app/data/battler-tags";
import { BattlerTagLapseType } from "#app/data/battler-tags";
import { battleSpecDialogue } from "#app/data/dialogue";
import { allMoves, PostVictoryStatStageChangeAttr } from "#app/data/moves/move";
@ -32,6 +31,7 @@ import { ToggleDoublePositionPhase } from "./toggle-double-position-phase";
import { VictoryPhase } from "./victory-phase";
import { isNullOrUndefined } from "#app/utils";
import { FRIENDSHIP_LOSS_FROM_FAINT } from "#app/data/balance/starters";
import { BattlerTagType } from "#enums/battler-tag-type";
export class FaintPhase extends PokemonPhase {
/**
@ -39,33 +39,15 @@ export class FaintPhase extends PokemonPhase {
*/
private preventEndure: boolean;
/**
* Destiny Bond tag belonging to the currently fainting Pokemon, if applicable
*/
private destinyTag?: DestinyBondTag | null;
/**
* Grudge tag belonging to the currently fainting Pokemon, if applicable
*/
private grudgeTag?: GrudgeTag | null;
/**
* The source Pokemon that dealt fatal damage
*/
private source?: Pokemon;
constructor(
battlerIndex: BattlerIndex,
preventEndure = false,
destinyTag?: DestinyBondTag | null,
grudgeTag?: GrudgeTag | null,
source?: Pokemon,
) {
constructor(battlerIndex: BattlerIndex, preventEndure = false, source?: Pokemon) {
super(battlerIndex);
this.preventEndure = preventEndure;
this.destinyTag = destinyTag;
this.grudgeTag = grudgeTag;
this.source = source;
}
@ -74,16 +56,13 @@ export class FaintPhase extends PokemonPhase {
const faintPokemon = this.getPokemon();
if (this.source) {
faintPokemon.getTag(BattlerTagType.DESTINY_BOND)?.lapse(this.source, BattlerTagLapseType.CUSTOM);
faintPokemon.getTag(BattlerTagType.GRUDGE)?.lapse(faintPokemon, BattlerTagLapseType.CUSTOM, this.source);
}
faintPokemon.resetSummonData();
if (!isNullOrUndefined(this.destinyTag) && !isNullOrUndefined(this.source)) {
this.destinyTag.lapse(this.source, BattlerTagLapseType.CUSTOM);
}
if (!isNullOrUndefined(this.grudgeTag) && !isNullOrUndefined(this.source)) {
this.grudgeTag.lapse(faintPokemon, BattlerTagLapseType.CUSTOM, this.source);
}
if (!this.preventEndure) {
const instantReviveModifier = globalScene.applyModifier(
PokemonInstantReviveModifier,