Instructions Jenkins Doxygen

[Fixed] attribute list on turrets 80/780/1
authorIvojedi <ivojedi@swgemu.com>
Sun, 8 Sep 2013 14:48:26 +0000 (07:48 -0700)
committerIvojedi <ivojedi@swgemu.com>
Sun, 8 Sep 2013 14:48:26 +0000 (07:48 -0700)
[Fixed] turrets using kinetic resist for energy resist

Change-Id: Ic98238d5161bdf05bae27cc0bcfe301b1c4f6e21

MMOCoreORB/src/server/zone/objects/installation/components/TurretDataComponent.cpp

index 2c9fa02..563504f 100644 (file)
@@ -67,25 +67,151 @@ void TurretDataComponent::fillAttributeList(AttributeListMessage* alm){
        ManagedReference<InstallationObject*> turret = cast<InstallationObject*>(getParent());
 
        alm->insertAttribute("condition",String::valueOf(turret->getMaxCondition() - turret->getConditionDamage()) + "/" + String::valueOf(turret->getMaxCondition()));
-       alm->insertAttribute("armorrating","Heavy");
 
-       alm->insertAttribute("cat_armor_special_protection.armor_eff_energy",String::valueOf(getEnergy()) + "%");
-       alm->insertAttribute("cat_armor_special_protection.armor_eff_stun",String::valueOf(getStun()) + "%");
+       if (getArmorRating() == 0)
+               alm->insertAttribute("armorrating", "None");
+       else if (getArmorRating() == 1)
+               alm->insertAttribute("armorrating", "Light");
+       else if (getArmorRating() == 2)
+               alm->insertAttribute("armorrating", "Medium");
+       else if (getArmorRating() == 3)
+               alm->insertAttribute("armorrating", "Heavy");
 
-       alm->insertAttribute("cat_armor_effectiveness.armor_eff_kinetic",String::valueOf(getKinetic()) + "%");
-       alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_heat",String::valueOf(getHeat()) + "%");
-       alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_cold",String::valueOf(getCold()) + "%");
-       alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_acid",String::valueOf(getAcid()) + "%");
 
-       alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_electrical",String::valueOf(getElectricity()) + "%");
-       alm->insertAttribute("cat_armor_vulnerability.armor_eff_blast",String::valueOf(getBlast()) + "%");
+       if (getKinetic() > 90) {
+               StringBuffer txt;
+               txt << round(getKinetic()) << "%";
+               alm->insertAttribute("cat_armor_special_protection.armor_eff_kinetic", txt.toString());
+       }
+
+       if (getEnergy() > 90) {
+               StringBuffer txt;
+               txt << round(getEnergy()) << "%";
+               alm->insertAttribute("cat_armor_special_protection.armor_eff_energy", txt.toString());
+       }
+
+       if (getElectricity() > 90) {
+               StringBuffer txt;
+               txt << round(getElectricity()) << "%";
+               alm->insertAttribute("cat_armor_special_protection.armor_eff_elemental_electrical", txt.toString());
+       }
+
+       if (getStun() > 90) {
+               StringBuffer txt;
+               txt << round(getStun()) << "%";
+               alm->insertAttribute("cat_armor_special_protection.armor_eff_stun", txt.toString());
+       }
+
+       if (getBlast() > 90) {
+               StringBuffer txt;
+               txt << round(getBlast()) << "%";
+               alm->insertAttribute("cat_armor_special_protection.armor_eff_blast", txt.toString());
+       }
+
+       if (getHeat() > 90) {
+               StringBuffer txt;
+               txt << round(getHeat()) << "%";
+               alm->insertAttribute("cat_armor_special_protection.armor_eff_elemental_heat", txt.toString());
+       }
 
-       alm->insertAttribute("cat_armor_encumbrance.health","0");
-       alm->insertAttribute("cat_armor_encumbrance.action","0");
-       alm->insertAttribute("cat_armor_encumbrance.mind","0");
+       if (getCold() > 90) {
+               StringBuffer txt;
+               txt << round(getCold()) << "%";
+               alm->insertAttribute("cat_armor_special_protection.armor_eff_elemental_cold", txt.toString());
+       }
+
+       if (getAcid() > 90) {
+               StringBuffer txt;
+               txt << round(getAcid()) << "%";
+               alm->insertAttribute("cat_armor_special_protection.armor_eff_elemental_acid", txt.toString());
+       }
 
-       alm->insertAttribute("description",turret->getDetailedDescription());
-       alm->insertAttribute("owner",String::valueOf(turret->getOwnerObjectID()));
+       if (getLightSaber() > 90) {
+               StringBuffer txt;
+               txt << round(getLightSaber()) << "%";
+               alm->insertAttribute("cat_armor_special_protection.armor_eff_restraint", txt.toString());
+       }
+
+       if (getKinetic() > 0 && getKinetic() <= 90) {
+               StringBuffer txt;
+               txt << round(getKinetic()) << "%";
+               alm->insertAttribute("cat_armor_effectiveness.armor_eff_kinetic", txt.toString());
+       }
+
+       if (getEnergy() > 0 && getEnergy() <= 90) {
+               StringBuffer txt;
+               txt << round(getEnergy()) << "%";
+               alm->insertAttribute("cat_armor_effectiveness.armor_eff_energy", txt.toString());
+       }
+
+       if (getElectricity() > 0 && getElectricity() <= 90) {
+               StringBuffer txt;
+               txt << round(getElectricity()) << "%";
+               alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_electrical", txt.toString());
+       }
+
+       if (getStun() > 0 && getStun() <= 90) {
+               StringBuffer txt;
+               txt << round(getStun()) << "%";
+               alm->insertAttribute("cat_armor_effectiveness.armor_eff_stun", txt.toString());
+       }
+
+       if (getBlast() > 0 && getBlast() <= 90) {
+               StringBuffer txt;
+               txt << round(getBlast()) << "%";
+               alm->insertAttribute("cat_armor_effectiveness.armor_eff_blast", txt.toString());
+       }
+
+       if (getHeat() > 0 && getHeat() <= 90) {
+               StringBuffer txt;
+               txt << round(getHeat()) << "%";
+               alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_heat", txt.toString());
+       }
+
+       if (getCold() > 0 && getCold() <= 90) {
+               StringBuffer txt;
+               txt << round(getCold()) << "%";
+               alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_cold", txt.toString());
+       }
+
+       if (getAcid() > 0 && getAcid() <= 90) {
+               StringBuffer txt;
+               txt << round(getAcid()) << "%";
+               alm->insertAttribute("cat_armor_effectiveness.armor_eff_elemental_acid", txt.toString());
+       }
+
+       if (getLightSaber() > 0 && getLightSaber() <= 90) {
+               StringBuffer txt;
+               txt << round(getLightSaber()) << "%";
+               alm->insertAttribute("cat_armor_effectiveness.armor_eff_restraint", txt.toString());
+       }
+
+       if (getKinetic() < 0)
+               alm->insertAttribute("cat_armor_vulnerability.armor_eff_kinetic", "-");
+
+       if (getEnergy() < 0)
+               alm->insertAttribute("cat_armor_vulnerability.armor_eff_energy", "-");
+
+       if (getElectricity() < 0)
+               alm->insertAttribute("cat_armor_vulnerability.armor_eff_elemental_electrical", "-");
+
+       if (getStun() < 0)
+               alm->insertAttribute("cat_armor_vulnerability.armor_eff_stun", "-");
+
+       if (getBlast() < 0)
+               alm->insertAttribute("cat_armor_vulnerability.armor_eff_blast", "-");
+
+       if (getHeat() < 0)
+               alm->insertAttribute("cat_armor_vulnerability.armor_eff_elemental_heat", "-");
+
+       if (getCold() < 0)
+               alm->insertAttribute("cat_armor_vulnerability.armor_eff_elemental_cold", "-");
+
+       if (getAcid() < 0)
+               alm->insertAttribute("cat_armor_vulnerability.armor_eff_elemental_acid", "-");
+
+       if (getLightSaber() < 0)
+               alm->insertAttribute("cat_armor_vulnerability.armor_eff_restraint", "-");
 
 }
 void TurretDataComponent::updateAutoCooldown(float secondsToAdd){
@@ -116,7 +242,7 @@ float TurretDataComponent::getKinetic(){
 
 float TurretDataComponent::getEnergy(){
        if(templateData != NULL)
-               return templateData->getKinetic();
+               return templateData->getEnergy();
 
        return 0;
 }