From ab5943e4b2355d6954c88175364cf7e77ac66152 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 1 Mar 2024 19:39:03 -0600 Subject: [PATCH] zerg mechanic overhaul --- src/engine/gameManager/ZergManager.java | 42 +++++++++++++++---------- src/engine/objects/Mine.java | 1 + src/engine/objects/PlayerCharacter.java | 1 + 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/engine/gameManager/ZergManager.java b/src/engine/gameManager/ZergManager.java index 7f35b5f6..5db40ec4 100644 --- a/src/engine/gameManager/ZergManager.java +++ b/src/engine/gameManager/ZergManager.java @@ -2,6 +2,7 @@ package engine.gameManager; import engine.objects.Bane; import engine.objects.Guild; +import engine.objects.Mine; import engine.objects.PlayerCharacter; public class ZergManager { @@ -9,33 +10,33 @@ public class ZergManager { float multiplier = 1.0f; switch(count){ case 1: + multiplier += 0.80f; + break; case 2: - case 5: - multiplier += 0.0f; + multiplier += 0.80f; break; case 3: - multiplier += 0.55f; + multiplier += 0.50f; break; case 4: - multiplier += 0.2f; + multiplier += 0.20f; + break; + case 5: + multiplier += 0.0f; break; case 6: - multiplier -= 0.2f; + multiplier -= 0.20f; break; case 7: - multiplier -= 0.35f; + multiplier -= 0.40f; break; case 8: - multiplier -= 0.50f; - break; - case 9: - multiplier -= 0.750f; + multiplier -= 0.60f; break; default: - multiplier -= 1.0f; + multiplier -= 0.80f; break; } - ChatManager.chatSystemInfo(pc,"Zerg Multiplier Set: " + multiplier); if(multiplier == 0.0f) return 1.0f; else @@ -232,10 +233,19 @@ public class ZergManager { } public static float getReducedZergMultiplier(PlayerCharacter source, PlayerCharacter target){ - if(source.ZergMultiplier == 0.0f) - source.ZergMultiplier = 1.0f; - if(target.ZergMultiplier == 0.0f) - target.ZergMultiplier = 1.0f; + if(source.ZergMultiplier == 0.0f) { + if(Mine.getMine(source.mineAppliedID)._playerMemory.contains(source.getObjectUUID()) == false ){ + source.ZergMultiplier = 1.0f; + } + } + if(target.ZergMultiplier == 0.0f) { + if(Mine.getMine(source.mineAppliedID)._playerMemory.contains(target.getObjectUUID()) == false){ + target.ZergMultiplier = 1.0f; + } + } + if(source.ZergMultiplier == target.ZergMultiplier){ + return 1.0f; + } if(source.ZergMultiplier > 0 && target.ZergMultiplier > 0){ if(source.ZergMultiplier > target.ZergMultiplier) { return 1 + (target.ZergMultiplier - source.ZergMultiplier); diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index f6d33056..ef2e6a78 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -735,6 +735,7 @@ public class Mine extends AbstractGameObject { player.ZergMultiplier = ZergManager.getMultiplier20Man(count,player); break; } + player.mineAppliedID = this.getObjectUUID(); } else{ player.ZergMultiplier = 1.0f; //something went wrong reset to default until next cycle } diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index b51f625c..d2da7901 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -177,6 +177,7 @@ public class PlayerCharacter extends AbstractCharacter { public boolean isBoxed = false; public float ZergMultiplier = 1.0f; + public int mineAppliedID = 0; /** * No Id Constructor */