Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionplugintofence.c
Go to the documentation of this file.
2 {
4  {
5  m_Text = "#plug_in";
6  }
7 
8  override void CreateConditionComponents()
9  {
12  }
13 
14  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
15  {
16  Object targetObject = target.GetObject();
17 
18  if ( targetObject && item && targetObject.IsInherited(BaseBuildingBase))
19  {
20  BaseBuildingBase target_BBB = BaseBuildingBase.Cast( targetObject );
21 
22  BarbedWire bw = BarbedWire.Cast( target_BBB.GetAttachmentByType(BarbedWire) );
23 
24  if ( bw && bw.GetCompEM().CanReceivePlugFrom(item) )
25  {
26  return true;
27  }
28  }
29 
30  return false;
31  }
32 
33  override void OnExecuteServer( ActionData action_data )
34  {
35  Object targetObject = action_data.m_Target.GetObject();
36  ItemBase target_IB = ItemBase.Cast( targetObject );
37  BarbedWire bw = BarbedWire.Cast( target_IB.GetAttachmentByType(BarbedWire) );
38  action_data.m_MainItem.GetCompEM().PlugThisInto(bw);
39 
40  if ( !action_data.m_Player.IsPlacingServer() )
41  {
42  //action_data.m_Player.TogglePlacing( action_data.m_Target, action_data.m_MainItem );
43  }
44  }
45 };
ItemBase
Definition: inventoryitem.c:730
UAMaxDistances
Definition: actionconstants.c:104
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
BaseBuildingBase
Definition: fence.c:1
CCTNonRuined
Definition: cctnonruined.c:1
Object
Definition: objecttyped.c:1
ActionPlugIntoFence
Definition: actionplugintofence.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionSingleUseBase
Definition: actionsingleusebase.c:41
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56