Cleanup code

This commit is contained in:
Jakub Hanko 2024-05-17 19:07:02 +02:00
parent 7afe764c28
commit 5a706d7cf8
No known key found for this signature in database
GPG Key ID: 775D427937A306CC
2 changed files with 6 additions and 4 deletions

View File

@ -1276,7 +1276,7 @@ export class CursedTag extends BattlerTag {
}
}
export class AuraTag extends BattlerTag {
export abstract class AuraTag extends BattlerTag {
constructor(tagType: BattlerTagType, sourceId: number) {
super(tagType, BattlerTagLapseType.CUSTOM, 0, undefined, sourceId);
}

View File

@ -1455,12 +1455,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
applyPreDefendAbAttrs(ReceivedMoveDamageMultiplierAbAttr, this, source, battlerMove, cancelled, power);
const reducedDamageTag = this.getTag(BattlerTagType.FRIEND_GUARD) as ReceivedMoveDamageMultiplierTag;
const abilityBypass = new Utils.BooleanHolder(false);
applyAbAttrs(MoveAbilityBypassAbAttr, source, abilityBypass);
if (!abilityBypass.value && reducedDamageTag) {
power.value *= reducedDamageTag.powerMultiplier;
if (!abilityBypass.value) {
const reducedDamageTags =
this.findTags(t => t instanceof ReceivedMoveDamageMultiplierTag) as ReceivedMoveDamageMultiplierTag[];
const powerMultiplier = reducedDamageTags.reduce((acc, t) => acc * t.powerMultiplier, 1);
power.value *= powerMultiplier;
}
power.value *= typeChangeMovePowerMultiplier.value;