Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionunpin.c
Go to the documentation of this file.
1 class ActionUnpin extends ActionSingleUseBase
2 {
3  void ActionUnpin()
4  {
5  m_Text = "#unpin";
6  }
7 
8  override void CreateConditionComponents()
9  {
12  }
13 
14  override bool HasTarget()
15  {
16  return false;
17  }
18 
19  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
20  {
21  if ( item.IsInherited(Grenade_Base) )
22  {
23  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_UNPINGRENAGE;
24  }
25  else
26  {
27  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_ITEM_ON;
28  }
29 
30  Grenade_Base grenade = Grenade_Base.Cast(item);
31  if( grenade )
32  {
33  if( grenade.IsPinned() )
34  {
35  return true;
36  }
37  }
38 
39  return false;
40  }
41 
42  override void OnExecute( ActionData action_data )
43  {
44  Grenade_Base grenade = Grenade_Base.Cast(action_data.m_MainItem);
45  if( grenade )
46  {
47  grenade.Unpin();
48  }
49  }
50 }
ItemBase
Definition: inventoryitem.c:730
OnExecute
override void OnExecute(ActionData action_data)
Definition: actionpacktent.c:111
Grenade_Base
Definition: flashgrenade.c:1
CCTNone
Definition: cctnone.c:1
HasTarget
bool HasTarget()
Definition: actionbase.c:232
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
CreateConditionComponents
void CreateConditionComponents()
Definition: actionbase.c:218
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
ActionCondition
protected bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionbase.c:372
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