Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
actionunpin.c
Go to the documentation of this file.
1class ActionUnpin extends ActionSingleUseBase
2{
4 {
5 m_Text = "#unpin";
6 }
7
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}
ActionBase ActionData
Definition actionbase.c:30
class ActionTargets ActionTarget
string m_Text
Definition actionbase.c:64
ref CCIBase m_ConditionItem
Definition actionbase.c:70
ref CCTBase m_ConditionTarget
Definition actionbase.c:71
override void CreateConditionComponents()
Definition actionunpin.c:8
override void OnExecute(ActionData action_data)
Definition actionunpin.c:42
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition actionunpin.c:19
override bool HasTarget()
Definition actionunpin.c:14
bool IsPinned()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602