From 0d9e03f84855734c39dd64c9d28dbb62b9024062 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 22 Jan 2025 21:08:38 -0600 Subject: [PATCH] PlayerCombatStats weapon speed calculations complete --- src/engine/objects/PlayerCombatStats.java | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/engine/objects/PlayerCombatStats.java b/src/engine/objects/PlayerCombatStats.java index 6336a1c2..ad70830a 100644 --- a/src/engine/objects/PlayerCombatStats.java +++ b/src/engine/objects/PlayerCombatStats.java @@ -207,6 +207,8 @@ public class PlayerCombatStats { if(this.owner.charItemManager.getEquipped(1) == null && this.owner.charItemManager.getEquipped(2) != null){ if(!this.owner.charItemManager.getEquipped(2).getItemBase().isShield()) this.atrHandOne = 0.0f; + }else if(this.owner.charItemManager.getEquipped(2) == null && this.owner.charItemManager.getEquipped(1) != null){ + this.atrHandTwo = 0.0f; } } } //perfect DO NOT TOUCH @@ -267,6 +269,8 @@ public class PlayerCombatStats { if(this.owner.charItemManager.getEquipped(1) == null && this.owner.charItemManager.getEquipped(2) != null){ if(!this.owner.charItemManager.getEquipped(2).getItemBase().isShield()) this.minDamageHandOne = 0; + }else if(this.owner.charItemManager.getEquipped(2) == null && this.owner.charItemManager.getEquipped(1) != null){ + this.minDamageHandTwo = 0; } } } @@ -330,6 +334,8 @@ public class PlayerCombatStats { if(this.owner.charItemManager.getEquipped(1) == null && this.owner.charItemManager.getEquipped(2) != null){ if(!this.owner.charItemManager.getEquipped(2).getItemBase().isShield()) this.maxDamageHandOne = 0; + }else if(this.owner.charItemManager.getEquipped(2) == null && this.owner.charItemManager.getEquipped(1) != null){ + this.maxDamageHandTwo = 0; } } } @@ -351,9 +357,10 @@ public class PlayerCombatStats { for(Effect eff : weapon.effects.values()){ for(AbstractEffectModifier mod : eff.getEffectModifiers()){ if(mod.modType.equals(Enum.ModType.WeaponSpeed) || mod.modType.equals(Enum.ModType.AttackDelay)){ - float percent = mod.getPercentMod() * 0.01f; - speed *= 1 + (mod.getPercentMod() * 0.01f); - weaponSpecificValues += (mod.getPercentMod() * 0.01f); + float percent = mod.getPercentMod(); + int trains = eff.getTrains(); + float modValue = percent + (trains * mod.getRamp()); + weaponSpecificValues += modValue * 0.01f; } } } @@ -376,8 +383,8 @@ public class PlayerCombatStats { } float bonusValues = 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.AttackDelay,Enum.SourceType.None);//1.0f; - - bonusValues -= (stanceValue + weaponSpecificValues); // take away stance modifier from alac bonus values + speed *= 1 + weaponSpecificValues; + bonusValues -= stanceValue; // take away stance modifier from alac bonus values speed *= 1 + stanceValue; // apply stance bonus speed *= bonusValues; // apply alac bonuses without stance mod @@ -391,6 +398,8 @@ public class PlayerCombatStats { if(this.owner.charItemManager.getEquipped(1) == null && this.owner.charItemManager.getEquipped(2) != null){ if(!this.owner.charItemManager.getEquipped(2).getItemBase().isShield()) this.attackSpeedHandOne = 0.0f; + }else if(this.owner.charItemManager.getEquipped(2) == null && this.owner.charItemManager.getEquipped(1) != null){ + this.attackSpeedHandTwo = 0.0f; } } } @@ -419,6 +428,8 @@ public class PlayerCombatStats { if(this.owner.charItemManager.getEquipped(1) == null && this.owner.charItemManager.getEquipped(2) != null){ if(!this.owner.charItemManager.getEquipped(2).getItemBase().isShield()) this.rangeHandOne = 0.0f; + }else if(this.owner.charItemManager.getEquipped(2) == null && this.owner.charItemManager.getEquipped(1) != null){ + this.rangeHandTwo = 0.0f; } } }