Files
dsrc/sku.0/sys.server/compiled/game/script/space/crafting/component_missile.script
T

72 lines
1.4 KiB
Plaintext

include library.space_crafting;
include library.space_utils;
include library.utils;
trigger OnInitialize()
{
return SCRIPT_CONTINUE;
}
trigger OnGetAttributes( obj_id player, string[] names, string[] attribs )
{
int idx = utils.getValidAttributeIndex(names);
if (idx == -1)
return SCRIPT_CONTINUE;
// check to see if the component has any values that need displaying
if (hasObjVar(self, "fltMinDamage"))
{
float value = getFloatObjVar(self, "fltMinDamage");
names[idx] = "damage_min";
attribs[idx] = Float.toString(value);
idx++;
}
if (hasObjVar(self, "fltMaxDamage"))
{
float value = getFloatObjVar(self, "fltMaxDamage");
names[idx] = "damage_max";
attribs[idx] = Float.toString(value);
idx++;
}
if (hasObjVar(self, "fltRefireRate"))
{
float value = getFloatObjVar(self, "fltRefireRate");
names[idx] = "refire_rate";
attribs[idx] = Float.toString(value);
idx++;
}
if (hasObjVar(self, "fltShieldEffectiveness"))
{
float value = getFloatObjVar(self, "fltShieldEffectiveness");
names[idx] = "effective_shields";
attribs[idx] = Float.toString(value);
idx++;
}
if (hasObjVar(self, "fltArmorEffectiveness"))
{
float value = getFloatObjVar(self, "fltArmorEffectiveness");
names[idx] = "effective_armor";
attribs[idx] = Float.toString(value);
idx++;
}
if (getCount(self) > 0)
{
int ammo = getCount(self);
names[idx] = "ammo";
attribs[idx] = Integer.toString(ammo);
idx++;
}
return SCRIPT_CONTINUE;
}