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)
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");
174 super.SetCEBasedQuantity();
182 super.OnEnergyConsumed();
185 float energyCoef = GetCompEM().GetEnergy0To1();
187 if (energyCoef < m_EfficiencyDecayStart && m_EfficiencyDecayStart > 0)
199 super.OnEnergyAdded();
202 float energyCoef = GetCompEM().GetEnergy0To1();
204 if (energyCoef < m_EfficiencyDecayStart && m_EfficiencyDecayStart > 0)
void AddAction(typename actionName)
override float GetQuantity()
override int GetQuantityMax()
provides access to slot configuration
const int INVALID
Invalid slot (-1)
float GetEfficiencyDecayStart()
Returns efficiency of this battery. The value is synchronized from server to all clients and is accur...
override bool ShowZonesHealth()
override bool CanPutIntoHands(EntityAI player)
override void OnEnergyAdded()
override bool CanPutInCargo(EntityAI parent)
override bool CanDisplayAttachmentSlot(int slot_id)
static private float m_EfficiencyDecayStart
override void SetCEBasedQuantity()
override void OnMovedInsideCargo(EntityAI container)
private int m_Efficiency0To10
ENERGY CONSUMPTION.
override bool CanPutAsAttachment(EntityAI parent)
override void OnInventoryEnter(Man player)
override bool DisplayNameRuinAttach()
override bool CanDetachAttachment(EntityAI parent)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
float GetEfficiency0To1()
Returns efficiency of this battery. The value is synchronized from server to all clients and is accur...
override void SetActions()
override void OnEnergyConsumed()
static proto float Round(float f)
Returns mathematical round of value.