mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 22:02:18 +02:00
Remove passing of grudge and destiny bond tags to faint phase
This commit is contained in:
parent
493aff4055
commit
16ea12cc5b
@ -128,6 +128,7 @@ import {
|
|||||||
TarShotTag,
|
TarShotTag,
|
||||||
AutotomizedTag,
|
AutotomizedTag,
|
||||||
PowerTrickTag,
|
PowerTrickTag,
|
||||||
|
type GrudgeTag,
|
||||||
} from "../data/battler-tags";
|
} from "../data/battler-tags";
|
||||||
import { WeatherType } from "#enums/weather-type";
|
import { WeatherType } from "#enums/weather-type";
|
||||||
import {
|
import {
|
||||||
@ -4754,8 +4755,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
new FaintPhase(
|
new FaintPhase(
|
||||||
this.getBattlerIndex(),
|
this.getBattlerIndex(),
|
||||||
false,
|
false,
|
||||||
destinyTag,
|
|
||||||
grudgeTag,
|
|
||||||
source,
|
source,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -4990,6 +4989,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**@overload */
|
||||||
|
getTag(tagType: BattlerTagType.GRUDGE): GrudgeTag | nil;
|
||||||
|
|
||||||
/** @overload */
|
/** @overload */
|
||||||
getTag(tagType: BattlerTagType): BattlerTag | nil;
|
getTag(tagType: BattlerTagType): BattlerTag | nil;
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ import {
|
|||||||
PostKnockOutAbAttr,
|
PostKnockOutAbAttr,
|
||||||
PostVictoryAbAttr,
|
PostVictoryAbAttr,
|
||||||
} from "#app/data/abilities/ability";
|
} from "#app/data/abilities/ability";
|
||||||
import type { DestinyBondTag, GrudgeTag } from "#app/data/battler-tags";
|
|
||||||
import { BattlerTagLapseType } from "#app/data/battler-tags";
|
import { BattlerTagLapseType } from "#app/data/battler-tags";
|
||||||
import { battleSpecDialogue } from "#app/data/dialogue";
|
import { battleSpecDialogue } from "#app/data/dialogue";
|
||||||
import { allMoves, PostVictoryStatStageChangeAttr } from "#app/data/moves/move";
|
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 { VictoryPhase } from "./victory-phase";
|
||||||
import { isNullOrUndefined } from "#app/utils";
|
import { isNullOrUndefined } from "#app/utils";
|
||||||
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";
|
||||||
|
|
||||||
export class FaintPhase extends PokemonPhase {
|
export class FaintPhase extends PokemonPhase {
|
||||||
/**
|
/**
|
||||||
@ -39,33 +39,15 @@ export class FaintPhase extends PokemonPhase {
|
|||||||
*/
|
*/
|
||||||
private preventEndure: boolean;
|
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
|
* The source Pokemon that dealt fatal damage
|
||||||
*/
|
*/
|
||||||
private source?: Pokemon;
|
private source?: Pokemon;
|
||||||
|
|
||||||
constructor(
|
constructor(battlerIndex: BattlerIndex, preventEndure = false, source?: Pokemon) {
|
||||||
battlerIndex: BattlerIndex,
|
|
||||||
preventEndure = false,
|
|
||||||
destinyTag?: DestinyBondTag | null,
|
|
||||||
grudgeTag?: GrudgeTag | null,
|
|
||||||
source?: Pokemon,
|
|
||||||
) {
|
|
||||||
super(battlerIndex);
|
super(battlerIndex);
|
||||||
|
|
||||||
this.preventEndure = preventEndure;
|
this.preventEndure = preventEndure;
|
||||||
this.destinyTag = destinyTag;
|
|
||||||
this.grudgeTag = grudgeTag;
|
|
||||||
this.source = source;
|
this.source = source;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,16 +56,13 @@ export class FaintPhase extends PokemonPhase {
|
|||||||
|
|
||||||
const faintPokemon = this.getPokemon();
|
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();
|
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) {
|
if (!this.preventEndure) {
|
||||||
const instantReviveModifier = globalScene.applyModifier(
|
const instantReviveModifier = globalScene.applyModifier(
|
||||||
PokemonInstantReviveModifier,
|
PokemonInstantReviveModifier,
|
||||||
|
Loading…
Reference in New Issue
Block a user