From bec6cbe6e646c5ab8acdaedacd314b97283c313b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 13 Jun 2024 18:54:09 -0500 Subject: [PATCH] implement stat modifications for the ZergMultiplier --- src/engine/objects/AbstractCharacter.java | 33 ++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index e43da320..8e09249c 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -1187,10 +1187,15 @@ 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 != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){ + value *= ((PlayerCharacter)attacker).ZergMultiplier; + } // Health modifications are modified by the ZergMechanic + + if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){ + value *= ((Mob)attacker).getOwner().ZergMultiplier; + }// Health modifications from pets are modified by the owner's ZergMechanic try { @@ -1254,11 +1259,19 @@ public abstract class AbstractCharacter extends AbstractWorldObject { } public final float modifyMana( - final float value, + float value, final AbstractCharacter attacker, final boolean fromCost ) { + if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){ + value *= ((PlayerCharacter)attacker).ZergMultiplier; + } // Health modifications are modified by the ZergMechanic + + if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){ + value *= ((Mob)attacker).getOwner().ZergMultiplier; + }// Health modifications from pets are modified by the owner's ZergMechanic + if (!this.isAlive()) { return 0f; } @@ -1293,11 +1306,19 @@ public abstract class AbstractCharacter extends AbstractWorldObject { } public final float modifyStamina( - final float value, + float value, final AbstractCharacter attacker, final boolean fromCost ) { + if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){ + value *= ((PlayerCharacter)attacker).ZergMultiplier; + } // Health modifications are modified by the ZergMechanic + + if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){ + value *= ((Mob)attacker).getOwner().ZergMultiplier; + }// Health modifications from pets are modified by the owner's ZergMechanic + if (!this.isAlive()) { return 0f; }