mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 13:22:18 +02:00
Cleanup code
This commit is contained in:
parent
7afe764c28
commit
5a706d7cf8
@ -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) {
|
constructor(tagType: BattlerTagType, sourceId: number) {
|
||||||
super(tagType, BattlerTagLapseType.CUSTOM, 0, undefined, sourceId);
|
super(tagType, BattlerTagLapseType.CUSTOM, 0, undefined, sourceId);
|
||||||
}
|
}
|
||||||
|
@ -1455,12 +1455,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
applyPreDefendAbAttrs(ReceivedMoveDamageMultiplierAbAttr, this, source, battlerMove, cancelled, power);
|
applyPreDefendAbAttrs(ReceivedMoveDamageMultiplierAbAttr, this, source, battlerMove, cancelled, power);
|
||||||
|
|
||||||
const reducedDamageTag = this.getTag(BattlerTagType.FRIEND_GUARD) as ReceivedMoveDamageMultiplierTag;
|
|
||||||
const abilityBypass = new Utils.BooleanHolder(false);
|
const abilityBypass = new Utils.BooleanHolder(false);
|
||||||
applyAbAttrs(MoveAbilityBypassAbAttr, source, abilityBypass);
|
applyAbAttrs(MoveAbilityBypassAbAttr, source, abilityBypass);
|
||||||
|
|
||||||
if (!abilityBypass.value && reducedDamageTag) {
|
if (!abilityBypass.value) {
|
||||||
power.value *= reducedDamageTag.powerMultiplier;
|
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;
|
power.value *= typeChangeMovePowerMultiplier.value;
|
||||||
|
Loading…
Reference in New Issue
Block a user