Instructions Jenkins Doxygen

[Added] vehicles now have resists - mantis 5301 17/1917/1
authorIvojedi <ivojedi@swgemu.com>
Wed, 2 Jul 2014 21:43:07 +0000 (14:43 -0700)
committerIvojedi <ivojedi@swgemu.com>
Wed, 2 Jul 2014 21:47:37 +0000 (14:47 -0700)
[Adjusted] condition based stat reduction formula
[Fixed] armor object condition based resist reduction
[Removed] redundant method in CombatManager

Change-Id: I0982fa9ae1b2990df84de48d90ec6294364af4ff

MMOCoreORB/src/server/zone/managers/combat/CombatManager.cpp
MMOCoreORB/src/server/zone/managers/combat/CombatManager.h
MMOCoreORB/src/server/zone/objects/creature/VehicleObject.idl
MMOCoreORB/src/server/zone/objects/creature/VehicleObjectImplementation.cpp
MMOCoreORB/src/server/zone/objects/tangible/TangibleObject.idl
MMOCoreORB/src/server/zone/objects/tangible/wearables/ArmorObject.idl
MMOCoreORB/src/server/zone/objects/tangible/wearables/ArmorObjectImplementation.cpp

index c57d719..77c2757 100644 (file)
@@ -791,8 +791,48 @@ ArmorObject* CombatManager::getPSGArmor(CreatureObject* defender) {
        return NULL;
 }
 
+int CombatManager::getArmorNpcReduction(AiAgent* defender, WeaponObject* weapon) {
+       int damageType = weapon->getDamageType();
+
+       float resist = 0;
+
+       switch (damageType) {
+       case WeaponObject::KINETIC:
+               resist = defender->getKinetic();
+               break;
+       case WeaponObject::ENERGY:
+               resist = defender->getEnergy();
+               break;
+       case WeaponObject::ELECTRICITY:
+               resist = defender->getElectricity();
+               break;
+       case WeaponObject::STUN:
+               resist = defender->getStun();
+               break;
+       case WeaponObject::BLAST:
+               resist = defender->getBlast();
+               break;
+       case WeaponObject::HEAT:
+               resist = defender->getHeat();
+               break;
+       case WeaponObject::COLD:
+               resist = defender->getCold();
+               break;
+       case WeaponObject::ACID:
+               resist = defender->getAcid();
+               break;
+       case WeaponObject::LIGHTSABER:
+               resist = defender->getLightSaber();
+               break;
+       case WeaponObject::FORCE:
+               resist = 0;
+               break;
+       }
 
-int CombatManager::getArmorNpcReduction(CreatureObject* attacker, AiAgent* defender, WeaponObject* weapon) {
+       return (int)resist;
+}
+
+int CombatManager::getArmorVehicleReduction(VehicleObject* defender, WeaponObject* weapon) {
        int damageType = weapon->getDamageType();
 
        float resist = 0;
@@ -833,13 +873,16 @@ int CombatManager::getArmorNpcReduction(CreatureObject* attacker, AiAgent* defen
        return (int)resist;
 }
 
-int CombatManager::getArmorReduction(CreatureObject* attacker, WeaponObject* weapon, CreatureObject* defender, float damage, int poolToDamage, const CreatureAttackData& data) {
+int CombatManager::getArmorReduction(TangibleObject* attacker, WeaponObject* weapon, CreatureObject* defender, float damage, int poolToDamage, const CreatureAttackData& data){
        if (poolToDamage == 0)
                return 0;
 
+       if(weapon == NULL)
+               return 0;
+
        // the easy calculation
        if (defender->isAiAgent()) {
-               float armorReduction = getArmorNpcReduction(attacker, cast<AiAgent*>(defender), weapon);
+               float armorReduction = getArmorNpcReduction(cast<AiAgent*>(defender), weapon);
 
                if (armorReduction >= 0)
                        damage *= getArmorPiercing(cast<AiAgent*>(defender), weapon);
@@ -847,6 +890,15 @@ int CombatManager::getArmorReduction(CreatureObject* attacker, WeaponObject* wea
                if (armorReduction > 0) damage *= (1.f - (armorReduction / 100.f));
 
                return damage;
+       } else if (defender->isVehicleObject()) {
+               float armorReduction = getArmorVehicleReduction(cast<VehicleObject*>(defender), weapon);
+
+               if (armorReduction >= 0)
+                       damage *= getArmorPiercing(cast<VehicleObject*>(defender), weapon);
+
+               if (armorReduction > 0) damage *= (1.f - (armorReduction / 100.f));
+
+               return damage;
        }
 
        // start with PSG reduction
@@ -912,6 +964,7 @@ int CombatManager::getArmorReduction(CreatureObject* attacker, WeaponObject* wea
                float armorReduction = getArmorObjectReduction(weapon, armor);
 
                damage *= armorPiercing;
+
                if (armorReduction > 0) damage *= (1.f - (armorReduction / 100.f));
 
                // inflict condition damage
@@ -936,6 +989,9 @@ float CombatManager::getArmorPiercing(TangibleObject* defender, WeaponObject* we
 
                if (armorDefender != NULL && !armorDefender->isBroken())
                        armorReduction = armorDefender->getRating();
+       } else if (defender->isVehicleObject()) {
+               VehicleObject* vehicleDefender = cast<VehicleObject*>(defender);
+               armorReduction = vehicleDefender->getArmor();
        } else {
                DataObjectComponentReference* data = defender->getDataObjectComponent();
                if(data != NULL){
@@ -2097,77 +2153,6 @@ int CombatManager::doAreaCombatAction(TangibleObject* attacker, WeaponObject* we
        return 0;
 }
 
-
-int CombatManager::getArmorReduction(TangibleObject* attacker, WeaponObject* weapon, CreatureObject* defender, float damage, int poolToDamage, const CreatureAttackData& data){
-       if (poolToDamage == 0)
-               return 0;
-
-       if(weapon == NULL)
-               return 0;
-
-       // the easy calculation
-       if (defender->isAiAgent()) {
-               float armorReduction = getArmorNpcReduction(NULL, cast<AiAgent*>(defender), weapon);
-
-               if (armorReduction >= 0)
-                       damage *= getArmorPiercing(cast<AiAgent*>(defender), weapon);
-
-               if (armorReduction > 0) damage *= (1.f - (armorReduction / 100.f));
-
-               return damage;
-       }
-
-       // start with PSG reduction
-       ManagedReference<ArmorObject*> psg = getPSGArmor(defender);
-
-       if (psg != NULL && !psg->isVulnerable(weapon->getDamageType())) {
-               float armorPiercing = getArmorPiercing(psg, weapon);
-               float armorReduction =  getArmorObjectReduction(weapon, psg);
-
-               if (armorPiercing > 1) damage *= armorPiercing;
-               if (armorReduction > 0) damage *= (1.f - (armorReduction / 100.f));
-
-               // inflict condition damage
-               // TODO: this formula makes PSG's take more damage than regular armor, but that's how it was on live
-               // it can be fixed by doing condition damage after all damage reductions
-               psg->inflictDamage(psg, 0, damage * 0.1, true, true);
-       }
-
-       if (data.getAttackType() == CombatManager::WEAPONATTACK) {
-               // Force Armor
-               float rawDamage = damage;
-
-               int forceArmor = defender->getSkillMod("force_armor");
-               if (forceArmor > 0)
-                       defender->notifyObservers(ObserverEventType::FORCEBUFFHIT, attacker, rawDamage - (damage *= 1.f - (forceArmor / 100.f)));
-       }
-
-       // now apply the rest of the damage to the regular armor
-       ManagedReference<ArmorObject*> armor = NULL;
-
-       if (poolToDamage & CombatManager::HEALTH)
-               armor = getHealthArmor(defender);
-       else if (poolToDamage & CombatManager::ACTION)
-               armor = getActionArmor(defender);
-       else if (poolToDamage & CombatManager::MIND)
-               armor = getMindArmor(defender);
-
-       if (armor != NULL && !armor->isVulnerable(weapon->getDamageType())) {
-               // use only the damage applied to the armor for piercing (after the PSG takes some off)
-               float armorPiercing = getArmorPiercing(armor, weapon);
-               float armorReduction = getArmorObjectReduction(weapon, armor);
-
-               damage *= armorPiercing;
-
-               if (armorReduction > 0) damage *= (1.f - (armorReduction / 100.f));
-
-               // inflict condition damage
-               armor->inflictDamage(armor, 0, damage * 0.1, true, true);
-       }
-
-       return damage;
-}
-
 int CombatManager::getArmorTurretReduction(CreatureObject* attacker, TangibleObject* defender, WeaponObject* weapon){
        int resist = 0;
 
index 794c599..01dd0ee 100644 (file)
@@ -11,6 +11,7 @@
 #include "engine/engine.h"
 #include "server/zone/objects/creature/CreatureObject.h"
 #include "server/zone/objects/creature/NonPlayerCreatureObject.h"
+#include "server/zone/objects/creature/VehicleObject.h"
 #include "server/zone/objects/tangible/weapon/WeaponObject.h"
 #include "server/zone/objects/tangible/wearables/ArmorObject.h"
 
@@ -215,9 +216,9 @@ protected:
        int doTargetCombatAction(TangibleObject* attacker, WeaponObject* weapon, TangibleObject* tano, const CreatureAttackData& data);
        int getArmorObjectReduction(WeaponObject* weapon, ArmorObject* armor);
        int getArmorReduction(TangibleObject* attacker, WeaponObject* weapon, CreatureObject* defender, float damage, int poolsToDamage, const CreatureAttackData& data);
-       int getArmorReduction(CreatureObject* attacker, WeaponObject* weapon, CreatureObject* defender, float damage, int poolsToDamage, const CreatureAttackData& data);
        float getArmorPiercing(TangibleObject* defender, WeaponObject* weapon);
-       int getArmorNpcReduction(CreatureObject* attacker, AiAgent* defender, WeaponObject* weapon);
+       int getArmorNpcReduction(AiAgent* defender, WeaponObject* weapon);
+       int getArmorVehicleReduction(VehicleObject* defender, WeaponObject* weapon);
        int getArmorTurretReduction(CreatureObject* attacker, TangibleObject* defender, WeaponObject* weapon);
 
        ArmorObject* getHealthArmor( CreatureObject* defender);
index 0956c5e..ce7e796 100644 (file)
@@ -95,7 +95,7 @@ class VehicleObject extends CreatureObject {
         * @param object player creature to which the message is sent
         */
        @local
-       public native void fillAttributeList(AttributeListMessage msg, CreatureObject object);  
+       public native void fillAttributeList(AttributeListMessage alm, CreatureObject object);  
        
        public native boolean checkInRangeGarage();
        
@@ -233,4 +233,44 @@ class VehicleObject extends CreatureObject {
        public boolean isVehicleObject() {
                return true;
        }
+
+       public unsigned int getArmor() {
+               return 0;
+       }
+
+       public float getKinetic() {
+               return 30 - getConditionReduction(30);
+       }
+       
+       public float getEnergy() {
+               return 25 - getConditionReduction(25);
+       }
+       
+       public float getElectricity() {
+               return 25 - getConditionReduction(25);
+       }
+       
+       public float getStun() {
+               return 25 - getConditionReduction(25);
+       }
+       
+       public float getBlast() {
+               return 25 - getConditionReduction(25);
+       }
+       
+       public float getHeat() {
+               return 25 - getConditionReduction(25);
+       }
+       
+       public float getCold() {
+               return 25 - getConditionReduction(25);
+       }
+       
+       public float getAcid() {
+               return 25 - getConditionReduction(25);
+       }
+       
+       public float getLightSaber() {
+               return 25 - getConditionReduction(25);
+       }
 }
index 6056057..52b3114 100644 (file)
@@ -33,13 +33,51 @@ void VehicleObjectImplementation::fillObjectMenuResponse(ObjectMenuResponse* men
                menuResponse->addRadialMenuItem(62, 3, "@pet/pet_menu:menu_repair_vehicle"); //Repair Vehicle
 }
 
-void VehicleObjectImplementation::fillAttributeList(AttributeListMessage* msg, CreatureObject* object){
+void VehicleObjectImplementation::fillAttributeList(AttributeListMessage* alm, CreatureObject* object){
+
+       alm->insertAttribute("armorrating", "@obj_attr_n:armor_pierce_none"); //None
+
+       StringBuffer kin;
+       kin << Math::getPrecision(getKinetic(),1) << "%";
+       alm->insertAttribute("cat_armor_special_protection.armor_eff_kinetic", kin.toString());
+
+       StringBuffer ene;
+       ene << Math::getPrecision(getEnergy(),1) << "%";
+       alm->insertAttribute("cat_armor_effectiveness.armor_eff_energy", ene.toString());
+
+       StringBuffer bla;
+       bla << Math::getPrecision(getBlast(),1) << "%";
+       alm->insertAttribute("cat_armor_effectiveness.armor_eff_blast", bla.toString());
+
+       StringBuffer stu;
+       stu << Math::getPrecision(getStun(),1) << "%";
+       alm->insertAttribute("cat_armor_effectiveness.armor_eff_stun", stu.toString());
+
+       StringBuffer lig;
+       lig << Math::getPrecision(getLightSaber(),1) << "%";
+       alm->insertAttribute("cat_armor_effectiveness.armor_eff_restraint", lig.toString());
+
+       StringBuffer hea;
+       hea << Math::getPrecision(getHeat(),1) << "%";
+       alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_heat", hea.toString());
+
+       StringBuffer col;
+       col << Math::getPrecision(getCold(),1) << "%";
+       alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_cold", col.toString());
+
+       StringBuffer aci;
+       aci << Math::getPrecision(getAcid(),1) << "%";
+       alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_acid", aci.toString());
+
+       StringBuffer ele;
+       ele << Math::getPrecision(getElectricity(),1) << "%";
+       alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_electrical", ele.toString());
 
        ManagedReference<CreatureObject* > linkedCreature = this->linkedCreature.get();
        if( linkedCreature == NULL )
                return;
 
-       msg->insertAttribute("@obj_attr_n:owner", linkedCreature->getFirstName());
+       alm->insertAttribute("@obj_attr_n:owner", linkedCreature->getFirstName());
 
 }
 
index 2c51018..5ff261e 100644 (file)
@@ -615,13 +615,13 @@ class TangibleObject extends SceneObject {
        
        protected float getConditionReduction(float value) {
                if(isBroken())
-                       return 0.95 * value;
+                       return 0.5 * value;
                
                float ratio = (float)getConditionDamage() / (float)getMaxCondition() * 100.0;
                if(ratio < 75.0)
                        return 0;
                
-               float reductionPercent = (ratio - 75.0) / 25.0;
+               float reductionPercent = (ratio - 75.0) / 12.5;
                        
                return reductionPercent * value;
        }
index dc5846b..7e08219 100644 (file)
@@ -178,7 +178,8 @@ class ArmorObject extends WearableObject {
        private native float getTypeValue(int type, float value);
        
        public float getKinetic() {
-               return getTypeValue(WeaponObject.KINETIC, kinetic) - getConditionReduction(kinetic);
+               float value = getTypeValue(WeaponObject.KINETIC, kinetic);
+               return value - getConditionReduction(value);
        }
        
        public void setKinetic(float value) {
@@ -186,7 +187,8 @@ class ArmorObject extends WearableObject {
        }
 
        public float getEnergy() {
-               return getTypeValue(WeaponObject.ENERGY, energy) - getConditionReduction(energy);
+               float value = getTypeValue(WeaponObject.ENERGY, energy);
+               return value - getConditionReduction(value);
        }
        
        public void setEnergy(float value) {
@@ -194,7 +196,8 @@ class ArmorObject extends WearableObject {
        }
 
        public float getElectricity() {
-               return getTypeValue(WeaponObject.ELECTRICITY, electricity) - getConditionReduction(electricity);
+               float value = getTypeValue(WeaponObject.ELECTRICITY, electricity);
+               return value - getConditionReduction(value);
        }
        
        public void setElectricity(float value) {
@@ -202,7 +205,8 @@ class ArmorObject extends WearableObject {
        }
 
        public float getStun() {
-               return getTypeValue(WeaponObject.STUN, stun) - getConditionReduction(stun);
+               float value = getTypeValue(WeaponObject.STUN, stun);
+               return value - getConditionReduction(value);
        }
        
        public void setStun(float value) {
@@ -210,7 +214,8 @@ class ArmorObject extends WearableObject {
        }
 
        public float getBlast() {
-               return getTypeValue(WeaponObject.BLAST, blast) - getConditionReduction(blast);
+               float value = getTypeValue(WeaponObject.BLAST, blast);
+               return value - getConditionReduction(value);
        }
        
        public void setBlast(float value) {
@@ -218,7 +223,8 @@ class ArmorObject extends WearableObject {
        }
 
        public float getHeat() {
-               return getTypeValue(WeaponObject.HEAT, heat) - getConditionReduction(heat);
+               float value = getTypeValue(WeaponObject.HEAT, heat);
+               return value - getConditionReduction(value);
        }
        
        public void setHeat(float value) {
@@ -226,7 +232,8 @@ class ArmorObject extends WearableObject {
        }
 
        public float getCold() {
-               return getTypeValue(WeaponObject.COLD, cold) - getConditionReduction(cold);
+               float value = getTypeValue(WeaponObject.COLD, cold);
+               return value - getConditionReduction(value);
        }
        
        public void setCold(float value) {
@@ -234,7 +241,8 @@ class ArmorObject extends WearableObject {
        }
 
        public float getAcid() {
-               return getTypeValue(WeaponObject.ACID, acid) - getConditionReduction(acid);
+               float value = getTypeValue(WeaponObject.ACID, acid);
+               return value - getConditionReduction(value);
        }
        
        public void setAcid(float value) {
@@ -242,7 +250,8 @@ class ArmorObject extends WearableObject {
        }
 
        public float getLightSaber() {
-               return getTypeValue(WeaponObject.LIGHTSABER, lightSaber) - getConditionReduction(lightSaber);
+               float value = getTypeValue(WeaponObject.LIGHTSABER, lightSaber);
+               return value - getConditionReduction(value);
        }
        
        public void setLightSaber(float value) {
index 78ff1be..04ac664 100644 (file)
@@ -86,59 +86,59 @@ void ArmorObjectImplementation::fillAttributeList(AttributeListMessage* alm, Cre
        //Check for special protections
        if ((isSpecial(WeaponObject::KINETIC) || isVulnerable(WeaponObject::KINETIC)) && getKinetic() >= 0.5) {
                StringBuffer txt;
-               txt << round(getKinetic()) << "%";
+               txt << Math::getPrecision(getKinetic(),1) << "%";
                alm->insertAttribute("cat_armor_special_protection.armor_eff_kinetic",
                                txt.toString());
        }
        if ((isSpecial(WeaponObject::ENERGY) || isVulnerable(WeaponObject::ENERGY)) && getEnergy() >= 0.5) {
                StringBuffer txt;
-               txt << round(getEnergy()) << "%";
+               txt << Math::getPrecision(getEnergy(),1) << "%";
                alm->insertAttribute("cat_armor_special_protection.armor_eff_energy",
                                txt.toString());
        }
        if ((isSpecial(WeaponObject::ELECTRICITY) || isVulnerable(WeaponObject::ELECTRICITY)) && getElectricity() >= 0.5) {
                StringBuffer txt;
-               txt << round(getElectricity()) << "%";
+               txt << Math::getPrecision(getElectricity(),1) << "%";
                alm->insertAttribute(
                                "cat_armor_special_protection.armor_eff_elemental_electrical",
                                txt.toString());
        }
        if ((isSpecial(WeaponObject::STUN) || isVulnerable(WeaponObject::STUN)) &&  getStun() >= 0.5) {
                StringBuffer txt;
-               txt << round(getStun()) << "%";
+               txt << Math::getPrecision(getStun(),1) << "%";
                alm->insertAttribute("cat_armor_special_protection.armor_eff_stun",
                                txt.toString());
        }
        if ((isSpecial(WeaponObject::BLAST) || isVulnerable(WeaponObject::BLAST)) && getBlast() >= 0.5) {
                StringBuffer txt;
-               txt << round(getBlast()) << "%";
+               txt << Math::getPrecision(getBlast(),1) << "%";
                alm->insertAttribute("cat_armor_special_protection.armor_eff_blast",
                                txt.toString());
        }
        if ((isSpecial(WeaponObject::HEAT) || isVulnerable(WeaponObject::HEAT)) && getHeat() >= 0.5) {
                StringBuffer txt;
-               txt << round(getHeat()) << "%";
+               txt << Math::getPrecision(getHeat(),1) << "%";
                alm->insertAttribute(
                                "cat_armor_special_protection.armor_eff_elemental_heat",
                                txt.toString());
        }
        if ((isSpecial(WeaponObject::COLD) || isVulnerable(WeaponObject::COLD)) && getCold() >= 0.5) {
                StringBuffer txt;
-               txt << round(getCold()) << "%";
+               txt << Math::getPrecision(getCold(),1) << "%";
                alm->insertAttribute(
                                "cat_armor_special_protection.armor_eff_elemental_cold",
                                txt.toString());
        }
        if ((isSpecial(WeaponObject::ACID) || isVulnerable(WeaponObject::ACID)) && getAcid() >= 0.5) {
                StringBuffer txt;
-               txt << round(getAcid()) << "%";
+               txt << Math::getPrecision(getAcid(),1) << "%";
                alm->insertAttribute(
                                "cat_armor_special_protection.armor_eff_elemental_acid",
                                txt.toString());
        }
        if ((isSpecial(WeaponObject::LIGHTSABER) || isVulnerable(WeaponObject::LIGHTSABER)) && getLightSaber() >= 0.5) {
                StringBuffer txt;
-               txt << round(getLightSaber()) << "%";
+               txt << Math::getPrecision(getLightSaber(),1) << "%";
                alm->insertAttribute(
                                "cat_armor_special_protection.armor_eff_restraint",
                                txt.toString());
@@ -146,59 +146,59 @@ void ArmorObjectImplementation::fillAttributeList(AttributeListMessage* alm, Cre
        //Check for Effectiveness protections(Normal)
        if (!isSpecial(WeaponObject::KINETIC) && !isVulnerable(WeaponObject::KINETIC) && getKinetic() >= 0.5) {
                StringBuffer txt;
-               txt << round(getKinetic()) << "%";
+               txt << Math::getPrecision(getKinetic(),1) << "%";
                alm->insertAttribute("cat_armor_effectiveness.armor_eff_kinetic",
                                txt.toString());
        }
        if (!isSpecial(WeaponObject::ENERGY) && !isVulnerable(WeaponObject::ENERGY) && getEnergy() >= 0.5) {
                StringBuffer txt;
-               txt << round(getEnergy()) << "%";
+               txt << Math::getPrecision(getEnergy(),1) << "%";
                alm->insertAttribute("cat_armor_effectiveness.armor_eff_energy",
                                txt.toString());
        }
        if (!isSpecial(WeaponObject::ELECTRICITY) && !isVulnerable(WeaponObject::ELECTRICITY) && getElectricity() >= 0.5) {
                StringBuffer txt;
-               txt << round(getElectricity()) << "%";
+               txt << Math::getPrecision(getElectricity(),1) << "%";
                alm->insertAttribute(
                                "cat_armor_effectiveness.armor_eff_elemental_electrical",
                                txt.toString());
        }
        if (!isSpecial(WeaponObject::STUN) && !isVulnerable(WeaponObject::STUN) && getStun() >= 0.5) {
                StringBuffer txt;
-               txt << round(getStun()) << "%";
+               txt << Math::getPrecision(getStun(),1) << "%";
                alm->insertAttribute("cat_armor_effectiveness.armor_eff_stun",
                                txt.toString());
        }
        if (!isSpecial(WeaponObject::BLAST) && !isVulnerable(WeaponObject::BLAST) && getBlast() >= 0.5) {
                StringBuffer txt;
-               txt << round(getBlast()) << "%";
+               txt << Math::getPrecision(getBlast(),1) << "%";
                alm->insertAttribute("cat_armor_effectiveness.armor_eff_blast",
                                txt.toString());
        }
        if (!isSpecial(WeaponObject::HEAT) && !isVulnerable(WeaponObject::HEAT) && getHeat() >= 0.5) {
                StringBuffer txt;
-               txt << round(getHeat()) << "%";
+               txt << Math::getPrecision(getHeat(),1) << "%";
                alm->insertAttribute(
                                "cat_armor_effectiveness.armor_eff_elemental_heat",
                                txt.toString());
        }
        if (!isSpecial(WeaponObject::COLD) && !isVulnerable(WeaponObject::COLD) && getCold() >= 0.5) {
                StringBuffer txt;
-               txt << round(getCold()) << "%";
+               txt << Math::getPrecision(getCold(),1) << "%";
                alm->insertAttribute(
                                "cat_armor_effectiveness.armor_eff_elemental_cold",
                                txt.toString());
        }
        if (!isSpecial(WeaponObject::ACID) && !isVulnerable(WeaponObject::ACID) && getAcid() >= 0.5) {
                StringBuffer txt;
-               txt << round(getAcid()) << "%";
+               txt << Math::getPrecision(getAcid(),1) << "%";
                alm->insertAttribute(
                                "cat_armor_effectiveness.armor_eff_elemental_acid",
                                txt.toString());
        }
        if (!isSpecial(WeaponObject::LIGHTSABER) && !isVulnerable(WeaponObject::LIGHTSABER) && getLightSaber() >= 0.5) {
                StringBuffer txt;
-               txt << round(getLightSaber()) << "%";
+               txt << Math::getPrecision(getLightSaber(),1) << "%";
                alm->insertAttribute("cat_armor_effectiveness.armor_eff_restraint",
                                txt.toString());
        }