8 static string LIGHT_OFF_GLASS =
"dz\\gear\\tools\\data\\flashlight_glass.rvmat";
10 static string LIGHT_ON_GLASS =
"dz\\gear\\tools\\data\\flashlight_glass_on.rvmat";
11 static string LIGHT_ON_REFLECTOR =
"dz\\weapons\\attachments\\data\\m4_flashlight_on.rvmat";
27 if ( !super.CanPutAsAttachment(parent) ) {
return false;}
29 bool req_attachment =
false;
30 bool rail_attachment_found =
false;
33 for (
int i = 0; i < parent.GetInventory().GetAttachmentSlotsCount(); i++ )
35 slot_id = parent.GetInventory().GetAttachmentSlotId(i);
38 req_attachment =
true;
39 attachment =
ItemBase.Cast(parent.GetInventory().FindAttachment(slot_id));
40 if ( attachment && attachment.ConfigIsExisting(
"hasRailFunctionality") && attachment.ConfigGetBool(
"hasRailFunctionality") )
41 rail_attachment_found =
true;
44 return !req_attachment || (req_attachment && rail_attachment_found);
52 m_Light.AttachOnMemoryPoint(
this,
"beamStart",
"beamEnd");
58 override void OnWork(
float consumed_energy )
70 m_Light.SetIntensity( efficiency, GetCompEM().GetUpdateInterval() );
97 super.OnInventoryExit(player);
99 if ( GetCompEM().IsWorking() )
103 vector ori_rotate = player.GetOrientation();
104 ori_rotate = ori_rotate +
Vector(270,0,0);
105 SetOrientation(ori_rotate);
void AddAction(typename actionName)
float GetEfficiency0To1()
Returns efficiency of this battery. The value is synchronized from server to all clients and is accur...
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
override void OnWork(float consumed_energy)
static string LIGHT_OFF_GLASS
override void OnInventoryExit(Man player)
override ScriptedLightBase GetLight()
override void OnWorkStart()
override void SetActions()
override void OnWorkStop()
void InitAttachmentsSlotsToCheck(out array< int > AttSlots)
Enter att slot types to check on attach.
static string LIGHT_OFF_REFLECTOR
static string LIGHT_ON_GLASS
static string LIGHT_ON_REFLECTOR
override bool CanPutAsAttachment(EntityAI parent)
override bool IsLightSource()
ref array< int > m_AttachmentSlotsCheck
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.