This commit is contained in:
Jakub Hanko 2024-05-19 20:58:20 +02:00
parent 4bfea8f514
commit f1450e9a67
No known key found for this signature in database
GPG Key ID: 775D427937A306CC
2 changed files with 20 additions and 6 deletions

View File

@ -1172,6 +1172,12 @@ export class IgnoreTypeImmunityTag extends BattlerTag {
return lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType);
}
/**
*
* @param types {@linkcode Type[]} of the Pokemon
* @param moveType {@linkcode Type} of the move targetting it
* @returns true if Pokemon is of tag's type and is immune to the move
*/
ignoreImmunity(types: Type[], moveType: Type): boolean {
return types.includes(this.immuneType)
&& getTypeDamageMultiplier(moveType, this.immuneType) == 0;

View File

@ -3431,18 +3431,26 @@ export class FaintCountdownAttr extends AddBattlerTagAttr {
}
}
/**
* Drops the target's immunity to types it is immune to
* and resets its evasiveness ie. Odor Sleuth, Miracle Eye,
* Foresight.
*
* @extends AddBattlerTagAttr
* @see {@linkcode apply}
*/
export class ExposedMoveAttr extends AddBattlerTagAttr {
constructor(tagType: BattlerTagType) {
super(tagType, false, true);
}
/**
* Moves that reset the target's evasiveness and makes it vulnerable
* to types it is immune to.
* @param user Pokemon that used the move
* @param target The target of the move
* @param move Move with this attribute
* @param args None
* Resets the target's evasiveness and applies the
* {@linkcode IgnoreTypeImmunityTag}
* @param user {@linkcode Pokemon} using this move
* @param target {@linkcode Pokemon} target of this move
* @param move {@linkcode Move} being used
* @param args N/A
* @returns true if the function succeeds
*/
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {