Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionpin.c
Go to the documentation of this file.
1class ActionPin extends ActionSingleUseBase
2{
3 void ActionPin()
4 {
5 m_Text = "#pin";
6 }
7
8 override void CreateConditionComponents()
9 {
10 m_ConditionItem = new CCINonRuined;
11 m_ConditionTarget = new CCTNone;
12 }
13
14 override bool HasTarget()
15 {
16 return false;
17 }
18
19 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
20 {
21 /*
22 if ( item.IsInherited(Grenade_Base) )
23 {
24 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PINGRENAGE;
25 }
26 else
27 */
28 {
29 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_ITEM_ON;
30 }
31
32 Grenade_Base grenade = Grenade_Base.Cast(item);
33 if( grenade )
34 {
35 if( !grenade.IsPinned() && grenade.IsPinnable() )
36 {
37 return true;
38 }
39 }
40
41 return false;
42 }
43
44 override void OnExecute( ActionData action_data )
45 {
46 Grenade_Base grenade = Grenade_Base.Cast(action_data.m_MainItem);
47 if( grenade )
48 {
49 grenade.Pin();
50 }
51 }
52}
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
int m_CommandUID
Definition actionbase.c:31
override void OnExecute(ActionData action_data)
override bool HasTarget()
bool IsPinnable()
bool IsPinned()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602