5 static int REFLECTOR_ID = 1;
6 static int GLASS_ID = 2;
8 static string LIGHT_OFF_GLASS =
"dz\\gear\\tools\\data\\flashlight_glass.rvmat";
9 static string LIGHT_OFF_REFLECTOR =
"dz\\gear\\tools\\data\\flashlight.rvmat";
10 static string LIGHT_ON_GLASS =
"dz\\gear\\tools\\data\\flashlight_glass_on.rvmat";
11 static string LIGHT_ON_REFLECTOR =
"dz\\gear\\tools\\data\\flashlight_glass_on.rvmat";
18 m_Light.AttachOnMemoryPoint(
this,
"beamStart",
"beamEnd");
21 SetObjectMaterial(GLASS_ID, LIGHT_ON_GLASS);
22 SetObjectMaterial(REFLECTOR_ID, LIGHT_ON_REFLECTOR);
25 override void OnWork(
float consumed_energy )
33 float efficiency = battery.GetEfficiency0To1();
37 m_Light.SetIntensity( efficiency, GetCompEM().GetUpdateInterval() );
57 SetObjectMaterial(GLASS_ID, LIGHT_OFF_GLASS);
58 SetObjectMaterial(REFLECTOR_ID, LIGHT_OFF_REFLECTOR);
64 super.OnInventoryExit(player);
66 if ( GetCompEM().IsWorking() )
70 vector ori_rotate = player.GetOrientation();
71 ori_rotate = ori_rotate +
Vector(270,0,0);
72 SetOrientation(ori_rotate);
87 Battery9V.Cast(GetInventory().CreateInInventory(
"Battery9V"));