From cbcdaaa221527e42d2cd9fb4082888d6cbdbfc01 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 4 Mar 2025 18:44:43 -0600 Subject: [PATCH] style casting fix --- src/engine/objects/PlayerCombatStats.java | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/engine/objects/PlayerCombatStats.java b/src/engine/objects/PlayerCombatStats.java index ec3e58b6..4216e73d 100644 --- a/src/engine/objects/PlayerCombatStats.java +++ b/src/engine/objects/PlayerCombatStats.java @@ -1056,14 +1056,27 @@ public class PlayerCombatStats { atr += (modifiedDexterity * 0.5f) + weaponATR1 + weaponATR2; atr *= precise; atr += atrBuffs; - if(pc.getWeaponPower() != null){ - DeferredPowerJob dpj = pc.getWeaponPower(); - dpj.endEffect(); + + float weaponMoveBonus = 0.0f; + if(pc.effects != null){ + if(pc.effects.containsKey("WeaponMove")){ + Effect eff = pc.effects.get("WeaponMove"); + for(AbstractEffectModifier mod : eff.getEffectModifiers()){ + if(mod.modType.equals(Enum.ModType.OCV)){ + float min = mod.getPercentMod(); + float ramp = mod.getRamp() * eff.getTrains(); + weaponMoveBonus += (min + ramp) * 0.01f; + } + } + } } + float subtraction = (stanceMod - 1) - (precise - 1) - healerDefStance; + float bonuses = 0.0f; if(pc.bonuses != null) - atr *= 1 + (pc.bonuses.getFloatPercentAll(Enum.ModType.OCV, Enum.SourceType.None) - (stanceMod - 1) - (precise - 1) - healerDefStance); + bonuses = pc.bonuses.getFloatPercentAll(Enum.ModType.OCV, Enum.SourceType.None) - subtraction - weaponMoveBonus; + atr *= 1+ bonuses; atr *= stanceMod; return atr; }