From 2b1299ec4aa87a14847b363d3ad4a272a25d8f09 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 28 May 2024 21:07:38 -0500 Subject: [PATCH] ZergMultiplier fix --- src/engine/objects/AbstractCharacter.java | 16 +++++++++------- .../effectmodifiers/HealthEffectModifier.java | 9 --------- .../effectmodifiers/ManaEffectModifier.java | 9 --------- .../effectmodifiers/StaminaEffectModifier.java | 9 --------- 4 files changed, 9 insertions(+), 34 deletions(-) diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index 931fc704..34be1f0d 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -1188,11 +1188,9 @@ public abstract class AbstractCharacter extends AbstractWorldObject { } } - public final float modifyHealth( - final float value, - final AbstractCharacter attacker, - final boolean fromCost) { - + public final float modifyHealth(float value,final AbstractCharacter attacker,final boolean fromCost) { + if(attacker.getObjectType().equals(GameObjectType.PlayerCharacter)) + value *= ((PlayerCharacter)attacker).ZergMultiplier; try { try { @@ -1248,9 +1246,11 @@ public abstract class AbstractCharacter extends AbstractWorldObject { } public final float modifyMana( - final float value, + float value, final AbstractCharacter attacker ) { + if(attacker.getObjectType().equals(GameObjectType.PlayerCharacter)) + value *= ((PlayerCharacter)attacker).ZergMultiplier; return this.modifyMana(value, attacker, false); } @@ -1287,9 +1287,11 @@ public abstract class AbstractCharacter extends AbstractWorldObject { */ public final float modifyStamina( - final float value, + float value, final AbstractCharacter attacker ) { + if(attacker.getObjectType().equals(GameObjectType.PlayerCharacter)) + value *= ((PlayerCharacter)attacker).ZergMultiplier; return this.modifyStamina(value, attacker, false); } diff --git a/src/engine/powers/effectmodifiers/HealthEffectModifier.java b/src/engine/powers/effectmodifiers/HealthEffectModifier.java index d6cf82e7..a4741b3a 100644 --- a/src/engine/powers/effectmodifiers/HealthEffectModifier.java +++ b/src/engine/powers/effectmodifiers/HealthEffectModifier.java @@ -171,15 +171,6 @@ public class HealthEffectModifier extends AbstractEffectModifier { } if (modAmount == 0f) return; - if(source.getObjectType().equals(GameObjectType.PlayerCharacter)){ - modAmount *= ((PlayerCharacter)source).ZergMultiplier; - } - if(source.getObjectType().equals(GameObjectType.Mob)){ - Mob mob = (Mob)source; - if(mob.isPet() && mob.guardCaptain.getObjectType().equals(GameObjectType.PlayerCharacter)){ - modAmount *= ((PlayerCharacter)mob.guardCaptain).ZergMultiplier; - } - } if (AbstractWorldObject.IsAbstractCharacter(awo)) { AbstractCharacter ac = (AbstractCharacter) awo; diff --git a/src/engine/powers/effectmodifiers/ManaEffectModifier.java b/src/engine/powers/effectmodifiers/ManaEffectModifier.java index 4c00bebd..d70b9a2c 100644 --- a/src/engine/powers/effectmodifiers/ManaEffectModifier.java +++ b/src/engine/powers/effectmodifiers/ManaEffectModifier.java @@ -134,15 +134,6 @@ public class ManaEffectModifier extends AbstractEffectModifier { } if (modAmount == 0f) return; - if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){ - modAmount *= ((PlayerCharacter)source).ZergMultiplier; - } - if(source.getObjectType().equals(Enum.GameObjectType.Mob)){ - Mob mob = (Mob)source; - if(mob.isPet() && mob.guardCaptain.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){ - modAmount *= ((PlayerCharacter)mob.guardCaptain).ZergMultiplier; - } - } if (AbstractWorldObject.IsAbstractCharacter(awo)) { AbstractCharacter ac = (AbstractCharacter) awo; int powerID = 0, effectID = 0; diff --git a/src/engine/powers/effectmodifiers/StaminaEffectModifier.java b/src/engine/powers/effectmodifiers/StaminaEffectModifier.java index 2b0896d1..22864533 100644 --- a/src/engine/powers/effectmodifiers/StaminaEffectModifier.java +++ b/src/engine/powers/effectmodifiers/StaminaEffectModifier.java @@ -130,15 +130,6 @@ public class StaminaEffectModifier extends AbstractEffectModifier { } if (modAmount == 0f) return; - if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){ - modAmount *= ((PlayerCharacter)source).ZergMultiplier; - } - if(source.getObjectType().equals(Enum.GameObjectType.Mob)){ - Mob mob = (Mob)source; - if(mob.isPet() && mob.guardCaptain.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){ - modAmount *= ((PlayerCharacter)mob.guardCaptain).ZergMultiplier; - } - } if (AbstractWorldObject.IsAbstractCharacter(awo)) { AbstractCharacter ac = (AbstractCharacter) awo;