Make ExposedAttr extend AddBattlerTagAttr and fail on overlap

pull/812/head
Jakub Hanko 2024-05-13 23:15:49 +02:00
parent 07fe307022
commit 33e71605b4
No known key found for this signature in database
GPG Key ID: 775D427937A306CC
1 changed files with 18 additions and 23 deletions

View File

@ -1830,29 +1830,6 @@ export class ResetStatsAttr extends MoveEffectAttr {
}
}
export class ExposedAttr extends MoveEffectAttr {
private tagType: BattlerTagType;
constructor(tagType: BattlerTagType) {
super();
this.tagType = tagType;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!super.apply(user, target, move, args))
return false;
target.summonData.battleStats[BattleStat.EVA] = 0;
target.updateInfo();
target.addTag(this.tagType, 20, move.id, user.id);
target.scene.queueMessage(`${getPokemonMessage(user, " identified\n")}${getPokemonMessage(target, "!")}`);
return true;
}
}
/**
* Attribute used for moves which swap the user and the target's stat changes.
*/
@ -3109,6 +3086,24 @@ export class FaintCountdownAttr extends AddBattlerTagAttr {
}
}
export class ExposedAttr extends AddBattlerTagAttr {
constructor(tagType: BattlerTagType) {
super(tagType, false, true);
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!super.apply(user, target, move, args))
return false;
target.summonData.battleStats[BattleStat.EVA] = 0;
target.updateInfo();
target.scene.queueMessage(`${getPokemonMessage(user, " identified\n")}${getPokemonMessage(target, "!")}`);
return true;
}
}
export class HitsTagAttr extends MoveAttr {
public tagType: BattlerTagType;
public doubleDamage: boolean;