From d14144cdf33426e8ac1acdc22d6609e2a4c83276 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 15 May 2024 17:00:16 -0500 Subject: [PATCH] zerg multiplier application work --- src/engine/gameManager/CombatManager.java | 11 ++----- .../effectmodifiers/HealthEffectModifier.java | 31 ++++++------------- .../effectmodifiers/ManaEffectModifier.java | 16 +++++----- .../StaminaEffectModifier.java | 17 +++++----- 4 files changed, 31 insertions(+), 44 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 1f47a54d..709ff575 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -812,10 +812,6 @@ public enum CombatManager { float damage; damage = calculateDamage(ac, tarAc, minDamage, maxDamage, damageType, resists); - - //if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && target.getObjectType().equals(GameObjectType.PlayerCharacter)){ - // damage *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)target); - //} float d = 0f; errorTrack = 12; @@ -844,9 +840,6 @@ public enum CombatManager { } mobTarget.handleDirectAggro(ac); } - if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && tarAc.getObjectType().equals(GameObjectType.PlayerCharacter) && tarAc.equals(ac) == false){ - damage *= ((PlayerCharacter)ac).ZergMultiplier; - } if (tarAc.getHealth() > 0) d = tarAc.modifyHealth(-damage, ac, false); subTrack = 5; @@ -1041,7 +1034,9 @@ public enum CombatManager { damage += minDamage; //calculate resists in if any - + if(source.getObjectType().equals(GameObjectType.PlayerCharacter)){ + damage *= ((PlayerCharacter)source).ZergMultiplier; + } if (resists != null) return resists.getResistedDamage(source, target, damageType, damage, 0); else diff --git a/src/engine/powers/effectmodifiers/HealthEffectModifier.java b/src/engine/powers/effectmodifiers/HealthEffectModifier.java index 4c3404b0..d6cf82e7 100644 --- a/src/engine/powers/effectmodifiers/HealthEffectModifier.java +++ b/src/engine/powers/effectmodifiers/HealthEffectModifier.java @@ -171,16 +171,21 @@ 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; if (!ac.isAlive()) return; - //if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && ac.combatTarget.getObjectType().equals(GameObjectType.PlayerCharacter)){ - // modAmount *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)ac.combatTarget); - //} - int powerID = 0, effectID = 0; String powerName = ""; if (effect.getPower() != null) { @@ -199,15 +204,6 @@ public class HealthEffectModifier extends AbstractEffectModifier { //see if target is immune to heals if (modAmount > 0f) { boolean skipImmune = false; - // first tick of HoT going thru SM was removed in a later patch - /*if (effect.getAction().getPowerAction() instanceof DirectDamagePowerAction) { - ArrayList actions = effect.getPower().getActions(); - for (ActionsBase ab : actions) { - AbstractPowerAction apa = ab.getPowerAction(); - if (apa instanceof DamageOverTimePowerAction) - skipImmune = true; - } - }*/ PlayerBonuses bonus = ac.getBonuses(); if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) { @@ -318,15 +314,6 @@ public class HealthEffectModifier extends AbstractEffectModifier { AbstractCharacter ac = (AbstractCharacter) awo; if (ac.isSit()) damage *= 2.5f; // increase damage if sitting - if(source.getObjectType().equals(GameObjectType.PlayerCharacter)){ - damage *= ((PlayerCharacter)source).ZergMultiplier; - } - if(source.getObjectType().equals(GameObjectType.Mob) && ((Mob)source).isPet()){ - AbstractCharacter owner = ((Mob)source).guardCaptain; - if(owner.getObjectType().equals(GameObjectType.PlayerCharacter)){ - damage *= ((PlayerCharacter)owner).ZergMultiplier; - } - } } return damage; diff --git a/src/engine/powers/effectmodifiers/ManaEffectModifier.java b/src/engine/powers/effectmodifiers/ManaEffectModifier.java index ab9b63fd..4c00bebd 100644 --- a/src/engine/powers/effectmodifiers/ManaEffectModifier.java +++ b/src/engine/powers/effectmodifiers/ManaEffectModifier.java @@ -14,7 +14,6 @@ import engine.Enum.DamageType; import engine.Enum.ModType; import engine.Enum.SourceType; import engine.gameManager.ChatManager; -import engine.gameManager.ZergManager; import engine.jobs.AbstractEffectJob; import engine.jobs.DamageOverTimeJob; import engine.net.DispatchMessage; @@ -135,6 +134,15 @@ 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; @@ -158,9 +166,6 @@ public class ManaEffectModifier extends AbstractEffectModifier { skipImmune = true; } } - //if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && ac.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){ - // modAmount *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)ac.combatTarget); - //} PlayerBonuses bonus = ac.getBonuses(); if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) { ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID); @@ -207,9 +212,6 @@ public class ManaEffectModifier extends AbstractEffectModifier { AbstractCharacter ac = (AbstractCharacter) awo; if (ac.isSit()) damage *= 2.5f; // increase damage if sitting - if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && !source.equals(ac)){ - damage *= ((PlayerCharacter)source).ZergMultiplier; - } } return damage; diff --git a/src/engine/powers/effectmodifiers/StaminaEffectModifier.java b/src/engine/powers/effectmodifiers/StaminaEffectModifier.java index 1f33822e..2b0896d1 100644 --- a/src/engine/powers/effectmodifiers/StaminaEffectModifier.java +++ b/src/engine/powers/effectmodifiers/StaminaEffectModifier.java @@ -14,7 +14,6 @@ import engine.Enum.DamageType; import engine.Enum.ModType; import engine.Enum.SourceType; import engine.gameManager.ChatManager; -import engine.gameManager.ZergManager; import engine.jobs.AbstractEffectJob; import engine.jobs.DamageOverTimeJob; import engine.net.DispatchMessage; @@ -131,6 +130,16 @@ 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; int powerID = 0, effectID = 0; @@ -154,9 +163,6 @@ public class StaminaEffectModifier extends AbstractEffectModifier { skipImmune = true; } } - //if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && ac.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){ - // modAmount *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)ac.combatTarget); - //} PlayerBonuses bonus = ac.getBonuses(); if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) { ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID); @@ -205,9 +211,6 @@ public class StaminaEffectModifier extends AbstractEffectModifier { AbstractCharacter ac = (AbstractCharacter) awo; if (ac.isSit()) damage *= 2.5f; // increase damage if sitting - if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && !source.equals(ac)){ - damage *= ((PlayerCharacter)source).ZergMultiplier; - } } return damage;