mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 09:19:31 +02:00
flx - adding overrides
This commit is contained in:
parent
eef1f82dfc
commit
8b8f20bf37
@ -951,7 +951,7 @@ class ImprisonTag extends ArenaTrapTag {
|
||||
* @param _arena
|
||||
* @returns `true` if the source of the tag is still active on the field | `false` if not
|
||||
*/
|
||||
lapse(_arena: Arena): boolean {
|
||||
override lapse(_arena: Arena): boolean {
|
||||
return this.source.isActive(true);
|
||||
}
|
||||
|
||||
@ -960,7 +960,7 @@ class ImprisonTag extends ArenaTrapTag {
|
||||
* @param pokemon the Pokemon Imprison is applied to
|
||||
* @returns `true`
|
||||
*/
|
||||
activateTrap(pokemon: Pokemon): boolean {
|
||||
override activateTrap(pokemon: Pokemon): boolean {
|
||||
if (this.source.isActive(true)) {
|
||||
pokemon.addTag(BattlerTagType.IMPRISON, 1, Moves.IMPRISON, this.sourceId);
|
||||
}
|
||||
@ -971,7 +971,7 @@ class ImprisonTag extends ArenaTrapTag {
|
||||
* When the arena tag is removed, it also attempts to remove any related Battler Tags if they haven't already been removed from the affected Pokemon
|
||||
* @param arena
|
||||
*/
|
||||
onRemove(arena: Arena): void {
|
||||
override onRemove(arena: Arena): void {
|
||||
const party = !this.source.isPlayer() ? arena.scene.getPlayerField() : arena.scene.getEnemyField();
|
||||
party?.forEach((p: PlayerPokemon | EnemyPokemon) => {
|
||||
p.removeTag(BattlerTagType.IMPRISON);
|
||||
|
@ -2441,6 +2441,7 @@ export class MysteryEncounterPostSummonTag extends BattlerTag {
|
||||
* Battle Tag that applies the move Torment to the target Pokemon
|
||||
* Torment restricts the consecutive use of moves.
|
||||
* The tag is only removed if the target leaves the battle.
|
||||
* Torment does not interrupt the move if the move is performed consecutively in the same turn and right after Torment is applied
|
||||
*/
|
||||
export class TormentTag extends MoveRestrictionBattlerTag {
|
||||
private target: Pokemon;
|
||||
@ -2449,7 +2450,12 @@ export class TormentTag extends MoveRestrictionBattlerTag {
|
||||
super(BattlerTagType.TORMENT, BattlerTagLapseType.AFTER_MOVE, 1, Moves.TORMENT, sourceId);
|
||||
}
|
||||
|
||||
onAdd(pokemon: Pokemon) {
|
||||
/**
|
||||
* Adds the battler tag to the target Pokemon and defines the private class variable 'target'
|
||||
* 'Target' is used to track the Pokemon's current status
|
||||
* @param pokemon the Pokemon tormented
|
||||
*/
|
||||
override onAdd(pokemon: Pokemon) {
|
||||
super.onAdd(pokemon);
|
||||
this.target = pokemon;
|
||||
pokemon.scene.queueMessage(i18next.t("battlerTags:tormentOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }), 1500);
|
||||
@ -2473,7 +2479,7 @@ export class TormentTag extends MoveRestrictionBattlerTag {
|
||||
* @param move the move under investigation
|
||||
* @returns `true` if there is valid consecutive usage | `false` if the moves are different from each other
|
||||
*/
|
||||
isMoveRestricted(move: Moves): boolean {
|
||||
override isMoveRestricted(move: Moves): boolean {
|
||||
const lastMove = this.target.getLastXMoves(1)[0];
|
||||
if ( !lastMove ) {
|
||||
return false;
|
||||
@ -2490,8 +2496,6 @@ export class TormentTag extends MoveRestrictionBattlerTag {
|
||||
override selectionDeniedText(_pokemon: Pokemon, move: Moves): string {
|
||||
return i18next.t("battle:moveCannotBeSelected", { moveName: allMoves[move].name });
|
||||
}
|
||||
|
||||
//Torment does not interrupt the move if the move is performed consecutively in the same turn and right after Torment is applied
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user