Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionunpin.c
Go to the documentation of this file.
1class ActionUnpin extends ActionSingleUseBase
2{
3 void ActionUnpin()
4 {
5 m_Text = "#unpin";
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 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}
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 IsPinned()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602