mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 21:32:18 +02:00
Cleanup IgnoreTypeImmunityTag and update docs
This commit is contained in:
parent
f1450e9a67
commit
5ca22719d8
@ -1150,12 +1150,15 @@ export class MagnetRisenTag extends TypeImmuneTag {
|
|||||||
*
|
*
|
||||||
* Applied by moves: {@linkcode Moves.ODOR_SLEUTH},
|
* Applied by moves: {@linkcode Moves.ODOR_SLEUTH},
|
||||||
* {@linkcode Moves.MIRACLE_EYE} and {@linkcode Moves.FORESIGHT}.
|
* {@linkcode Moves.MIRACLE_EYE} and {@linkcode Moves.FORESIGHT}.
|
||||||
|
*
|
||||||
|
* @extends BattlerTag
|
||||||
|
* @see {@linkcode ignoreImmunity}
|
||||||
*/
|
*/
|
||||||
export class IgnoreTypeImmunityTag extends BattlerTag {
|
export class IgnoreTypeImmunityTag extends BattlerTag {
|
||||||
public immuneType: Type;
|
private immuneType: Type;
|
||||||
|
|
||||||
constructor(tagType: BattlerTagType, sourceMove: Moves, type: Type) {
|
constructor(tagType: BattlerTagType, sourceMove: Moves, type: Type) {
|
||||||
super(tagType, BattlerTagLapseType.TURN_END, 1, sourceMove);
|
super(tagType, BattlerTagLapseType.CUSTOM, 1, sourceMove);
|
||||||
this.immuneType = type;
|
this.immuneType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1168,15 +1171,10 @@ export class IgnoreTypeImmunityTag extends BattlerTag {
|
|||||||
this.immuneType = source.type as Type;
|
this.immuneType = source.type as Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
|
||||||
return lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param types {@linkcode Type[]} of the Pokemon
|
* @param types {@linkcode Type[]} of the Pokemon
|
||||||
* @param moveType {@linkcode Type} of the move targetting it
|
* @param moveType {@linkcode Type} of the move targetting it
|
||||||
* @returns true if Pokemon is of tag's type and is immune to the move
|
* @returns true if Pokemon is of tag's type and that type is immune to the move
|
||||||
*/
|
*/
|
||||||
ignoreImmunity(types: Type[], moveType: Type): boolean {
|
ignoreImmunity(types: Type[], moveType: Type): boolean {
|
||||||
return types.includes(this.immuneType)
|
return types.includes(this.immuneType)
|
||||||
|
Loading…
Reference in New Issue
Block a user