mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-12 18:39:30 +02:00
Removed Mortal-spin exclusive LapseTagAttr
This commit is contained in:
parent
93525b5803
commit
a6f2e5ba04
@ -1,3 +1,4 @@
|
|||||||
|
import type { BattlerTag } from "#data/battler-tags";
|
||||||
import { AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrParams } from "#abilities/ability";
|
import { AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrParams } from "#abilities/ability";
|
||||||
import {
|
import {
|
||||||
applyAbAttrs
|
applyAbAttrs
|
||||||
@ -5825,45 +5826,25 @@ export class CurseAttr extends MoveEffectAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LapseBattlerTagAttr extends MoveEffectAttr {
|
/**
|
||||||
public tagTypes: BattlerTagType[];
|
* Attribute to remove all {@linkcode BattlerTag}s matching one or more tag types.
|
||||||
|
*/
|
||||||
constructor(tagTypes: BattlerTagType[], selfTarget: boolean = false) {
|
|
||||||
super(selfTarget);
|
|
||||||
|
|
||||||
this.tagTypes = tagTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
|
||||||
if (!super.apply(user, target, move, args)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const tagType of this.tagTypes) {
|
|
||||||
(this.selfTarget ? user : target).lapseTag(tagType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class RemoveBattlerTagAttr extends MoveEffectAttr {
|
export class RemoveBattlerTagAttr extends MoveEffectAttr {
|
||||||
public tagTypes: BattlerTagType[];
|
/** An array of {@linkcode BattlerTagType}s to clear. */
|
||||||
|
public tagTypes: [BattlerTagType, ...BattlerTagType[]];
|
||||||
|
|
||||||
constructor(tagTypes: BattlerTagType[], selfTarget: boolean = false) {
|
constructor(tagTypes: [BattlerTagType, ...BattlerTagType[]], selfTarget = false) {
|
||||||
super(selfTarget);
|
super(selfTarget);
|
||||||
|
|
||||||
this.tagTypes = tagTypes;
|
this.tagTypes = tagTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, _args: any[]): boolean {
|
||||||
if (!super.apply(user, target, move, args)) {
|
if (!super.apply(user, target, move, _args)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const tagType of this.tagTypes) {
|
(this.selfTarget ? user : target).findAndRemoveTags(t => this.tagTypes.includes(t.tagType));
|
||||||
(this.selfTarget ? user : target).removeTag(tagType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user