DayZ 1.24
Loading...
Searching...
No Matches
ActionRestrainSelf.c
Go to the documentation of this file.
2{
3 const float DEFAULT_RESTRAIN_TIME = 2;
4
5 override void CreateActionComponent()
6 {
8
9 if (m_ActionData.m_MainItem.ConfigIsExisting("RestrainTime"))
10 time = m_ActionData.m_MainItem.ConfigGetFloat("RestrainTime");
11
12 if (m_ActionData.m_Player.IsQuickRestrain())
14
16 }
17};
18
20{
22 {
24 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_RESTRAINSELF;
25 m_FullBody = true;
26 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
27 //m_Animation = "INJECTEPIPENS";
29 m_Text = "#restrain_self";
30 }
31
33 {
34 if (player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_PRONE))
35 return DayZPlayerConstants.STANCEMASK_CROUCH;
36 else
37 return DayZPlayerConstants.STANCEMASK_ERECT;
38 }
39
45
46 override bool HasTarget()
47 {
48 return false;
49 }
50
52 {
53 return true;
54 }
55
56 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
57 {
58 if (player.IsRestrained())
59 return false;
60
61 return true;
62 }
63
65 {
66 PlayerBase player = PlayerBase.Cast(action_data.m_Player);
68 if (item_in_hands)
69 {
70 //action_data.m_Player.RemoveQuickBarEntityShortcut(item_in_hands);
71 string new_item_name = MiscGameplayFunctions.ObtainRestrainItemTargetClassname(item_in_hands);
73 }
74 }
75
77 {
78 //action_data.m_Player.RemoveQuickBarEntityShortcut(action_data.m_MainItem);
79 }
80};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
ActionData m_ActionData
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ItemBase m_MainItem
Definition ActionBase.c:28
const float DEFAULT_RESTRAIN_TIME
override void CreateActionComponent()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnFinishProgressClient(ActionData action_data)
override void OnFinishProgressServer(ActionData action_data)
override bool HasAlternativeInterrupt()
override int GetStanceMask(PlayerBase player)
override void CreateConditionComponents()
override bool HasTarget()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
const float DEBUG_QUICK_UNRESTRAIN_TIME
Definition constants.c:598