5 if (!super.CanPutAsAttachment(parent))
14 if (GetCompEM().GetPluggedDevice())
27 if (GetCompEM().IsPlugged())
30 return super.CanReceiveAttachment(attachment, slotId);
35 if (!super.CanPutIntoHands(parent))
40 if (HasEnergyManager())
43 if (poweredDevice && poweredDevice.IsInherited(
MetalWire))
47 else if (poweredDevice && poweredDevice.IsOn())
58 if (!super.CanPutInCargo(parent))
65 return !(poweredDevice && poweredDevice.IsInherited(
MetalWire));
70 super.OnInventoryEnter(player);
72 if (GetHierarchyParent() == player || (GetHierarchyParent() && GetHierarchyParent().GetInventory().GetCargo()))
74 if (HasEnergyManager())
83 if (poweredDevice.GetCompEM().IsPlugged())
84 poweredDevice.GetCompEM().UnplugDevice(poweredDevice.GetCompEM().GetPluggedDevice());
88 this.GetCompEM().UnplugAllDevices();
97 super.OnMovedInsideCargo(container);
99 if (HasEnergyManager())
106 if (poweredDevice.IsInherited(
MetalWire))
108 poweredDevice.GetCompEM().UnplugAllDevices();
112 this.GetCompEM().UnplugAllDevices();
120 if (GetCompEM().IsPlugged())
123 return super.CanDisplayAttachmentSlot(slot_id);
155 RegisterNetSyncVariableInt(
"m_Efficiency0To10");
173 super.OnEnergyConsumed();
176 float energyCoef = GetCompEM().GetEnergy0To1();
178 if (energyCoef < m_EfficiencyDecayStart && m_EfficiencyDecayStart > 0)
190 super.OnEnergyAdded();
193 float energyCoef = GetCompEM().GetEnergy0To1();
195 if (energyCoef < m_EfficiencyDecayStart && m_EfficiencyDecayStart > 0)
void AddAction(typename actionName)
const int INVALID
Invalid slot (-1)
provides access to slot configuration
override bool CanDisplayAttachmentSlot(int slot_id)
float m_EfficiencyDecayStart
override void OnEnergyAdded()
override void SetActions()
override bool CanPutAsAttachment(EntityAI parent)
override void OnEnergyConsumed()
override void OnInventoryEnter(Man player)
float GetEfficiencyDecayStart()
Returns efficiency of this battery. The value is synchronized from server to all clients and is accur...
override void OnMovedInsideCargo(EntityAI container)
override bool CanDetachAttachment(EntityAI parent)
override bool DisplayNameRuinAttach()
float GetEfficiency0To1()
Returns efficiency of this battery. The value is synchronized from server to all clients and is accur...
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
int m_Efficiency0To10
ENERGY CONSUMPTION.
override bool CanPutIntoHands(EntityAI parent)
override bool ShowZonesHealth()
static proto float Round(float f)
Returns mathematical round of value.