mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-14 23:07:51 -04:00
49 lines
1.5 KiB
Java
Executable File
49 lines
1.5 KiB
Java
Executable File
package script.space.crafting;
|
|
|
|
import script.library.space_utils;
|
|
import script.library.utils;
|
|
import script.obj_id;
|
|
|
|
public class chassis_blueprints extends script.base_script
|
|
{
|
|
public chassis_blueprints()
|
|
{
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException
|
|
{
|
|
int idx = utils.getValidAttributeIndex(names);
|
|
if (idx == -1)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (hasObjVar(self, "ship_chassis.mass"))
|
|
{
|
|
float value = getFloatObjVar(self, "ship_chassis.mass");
|
|
names[idx] = "chassisMassMax";
|
|
attribs[idx] = Float.toString(value);
|
|
idx++;
|
|
}
|
|
if (hasObjVar(self, "ship_chassis.hp"))
|
|
{
|
|
float value = getFloatObjVar(self, "ship_chassis.hp");
|
|
names[idx] = "hitPointsMax";
|
|
attribs[idx] = Float.toString(value);
|
|
idx++;
|
|
}
|
|
if (hasObjVar(self, "shiptype"))
|
|
{
|
|
names[idx] = "pilotSkillRequired";
|
|
attribs[idx] = space_utils.getSkillRequiredForShip(self);
|
|
idx++;
|
|
}
|
|
names[idx] = "ship_assembly_n";
|
|
String text = " \\#pcontrast2 " + "$@obj_attr_n:ship_assembly_d$" + " \\# ";
|
|
attribs[idx] = text;
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|