DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
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 {
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}
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
class ActionTargets ActionTarget
ItemBase m_MainItem
Definition ActionBase.c:28
override void CreateConditionComponents()
Definition ActionPin.c:8
override void OnExecute(ActionData action_data)
Definition ActionPin.c:44
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionPin.c:19
override bool HasTarget()
Definition ActionPin.c:14
bool IsPinnable()
bool IsPinned()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602