void LightsaberCrystalComponentImplementation::updateCraftingValues(CraftingValues* values, bool firstUpdate) { int colorMax = values->getMaxValue("color"); int color = values->getCurrentValue("color"); setMaxCondition(values->getCurrentValue("hitpoints")); if (colorMax != 31) { int finalColor = MIN(color, 11); setColor(finalColor); updateCrystal(finalColor); } else { setColor(31); updateCrystal(31); } if (color == 31){ setQuality(values->getCurrentValue("quality")); setAttackSpeed(Math::getPrecision(values->getCurrentValue("attackspeed"), 2)); setMinimumDamage(MIN(values->getCurrentValue("mindamage"), 50)); setMaximumDamage(MIN(values->getCurrentValue("maxdamage"), 50)); setWoundChance(values->getCurrentValue("woundchance")); // Following are incoming positive values in script (Due to loot modifier.) // Switch to negative number. setSacHealth(MIN(values->getCurrentValue("attackhealthcost"), 9) * -1); setSacAction(MIN(values->getCurrentValue("attackactioncost"), 9) * -1); setSacMind(MIN(values->getCurrentValue("attackmindcost"), 9) * -1); setForceCost(MIN(values->getCurrentValue("forcecost"), 9) * -1); } ComponentImplementation::updateCraftingValues(values, firstUpdate); }
void WeaponObjectImplementation::updateCraftingValues(CraftingValues* values, bool firstUpdate) { /* * Incoming Values: Ranges: * mindamage Differs between weapons * maxdamage * attackspeed * woundchance * roundsused * hitpoints * zerorangemod * maxrange * maxrangemod * midrange * midrangemod * charges * attackhealthcost * attackactioncost * attackmindcost */ float value = 0.f; setMinDamage(MAX(values->getCurrentValue("mindamage"), 0)); setMaxDamage(MAX(values->getCurrentValue("maxdamage"), 0)); setAttackSpeed(values->getCurrentValue("attackspeed")); setHealthAttackCost((int)values->getCurrentValue("attackhealthcost")); setActionAttackCost((int)values->getCurrentValue("attackactioncost")); setMindAttackCost((int)values->getCurrentValue("attackmindcost")); if (isJediWeapon()) { setForceCost((int)values->getCurrentValue("forcecost")); setBladeColor(31); } value = values->getCurrentValue("woundchance"); if(value != CraftingValues::VALUENOTFOUND) setWoundsRatio(value); //value = craftingValues->getCurrentValue("roundsused"); //if(value != DraftSchematicValuesImplementation::VALUENOTFOUND) //_this.getReferenceUnsafeStaticCast()->set_______(value); value = values->getCurrentValue("zerorangemod"); if(value != CraftingValues::VALUENOTFOUND) setPointBlankAccuracy((int)value); value = values->getCurrentValue("maxrange"); if(value != CraftingValues::VALUENOTFOUND) setMaxRange((int)value); value = values->getCurrentValue("maxrangemod"); if(value != CraftingValues::VALUENOTFOUND) setMaxRangeAccuracy((int)value); value = values->getCurrentValue("midrange"); if(value != CraftingValues::VALUENOTFOUND) setIdealRange((int)value); value = values->getCurrentValue("midrangemod"); if(value != CraftingValues::VALUENOTFOUND) setIdealAccuracy((int)value); //value = craftingValues->getCurrentValue("charges"); //if(value != CraftingValues::VALUENOTFOUND) // setUsesRemaining((int)value); value = values->getCurrentValue("hitpoints"); if(value != CraftingValues::VALUENOTFOUND) setMaxCondition((int)value); setConditionDamage(0); }