15 if (!super.CanPutAsAttachment(parent))
23 if ( battery_owner && !battery_owner.IsInherited(
PlayerBase) )
35 EntityAI energy_source = GetCompEM().GetEnergySource();
39 string ES_model = energy_source.GetModelName();
40 EntityAI powered_device = GetCompEM().GetPluggedDevice();
46 ShowSelection(selection_wire);
51 ShowSelection(selection_plug);
54 int selection_index = GetHiddenSelectionIndex(selection_plug);
55 string texture_path = powered_device.GetCompEM().GetCordTextureFile();
56 SetObjectTexture( selection_index, texture_path );
62 ShowSelection(selection_wire2);
74 super.OnInventoryEnter( player );
78 if ( player_PB.GetItemInHands() ==
this && GetCompEM().IsPlugged() )
87 GetCompEM().UnplugAllDevices();
89 if ( !player_PB.IsPlacingLocal() )
91 GetCompEM().UnplugThis();
106 GetCompEM().UnplugAllDevices();
AttachActionData ActionData ActionAttach()
void AddAction(typename actionName)
Super root of all classes in Enforce script.
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override void OnIsPlugged(EntityAI source_device)
override void OnOwnSocketReleased(EntityAI device)
override void OnOwnSocketTaken(EntityAI device)
override void SetActions()
static string SEL_WIRE_ROLLED
static string SEL_PLUG_SUFIX
static string SEL_WIRE_PREFIX
override void OnIsUnplugged(EntityAI last_energy_source)
static string SEL_WIRE_SUFIX
void UpdateAllSelections()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
proto int ToLower()
Changes string to lowercase. Returns length.