Add isMega helper function

This commit is contained in:
Xavion3 2025-03-03 09:47:34 +11:00
parent 6f686a05e3
commit 6d123259ad

View File

@ -3204,6 +3204,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return maxForms.includes(this.getFormKey()) || (!!this.getFusionFormKey() && maxForms.includes(this.getFusionFormKey()!)); return maxForms.includes(this.getFormKey()) || (!!this.getFusionFormKey() && maxForms.includes(this.getFusionFormKey()!));
} }
isMega(): boolean {
const megaForms = [ SpeciesFormKey.MEGA, SpeciesFormKey.MEGA_X, SpeciesFormKey.MEGA_Y, SpeciesFormKey.PRIMAL ] as string[];
return megaForms.includes(this.getFormKey()) || (!!this.getFusionFormKey() && megaForms.includes(this.getFusionFormKey()!));
}
canAddTag(tagType: BattlerTagType): boolean { canAddTag(tagType: BattlerTagType): boolean {
if (this.getTag(tagType)) { if (this.getTag(tagType)) {
return false; return false;