Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actioncpr.c
Go to the documentation of this file.
2 {
3  private const float REPEAT_AFTER_SEC = 1;
4 
5  override void CreateActionComponent()
6  {
7  m_ActionData.m_ActionComponent = new CAContinuousRepeat(REPEAT_AFTER_SEC);
8  }
9 };
10 
12 {
13  void ActionCPR()
14  {
15  m_CallbackClass = ActionCPRCB;
16  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CPR;
17  m_FullBody = true;
18  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
20  m_Text = "#cpr";
21  }
22 
23  override typename GetInputType()
24  {
26  }
27 
28  override void OnStartClient(ActionData action_data)
29  {
30  action_data.m_Player.TryHideItemInHands(true);
31  }
32 
33  override void OnStartServer(ActionData action_data)
34  {
35  action_data.m_Player.TryHideItemInHands(true);
36  }
37 
38  override void CreateConditionComponents()
39  {
42  }
43 
44  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
45  {
46  PlayerBase other_player = PlayerBase.Cast(target.GetObject());
47  bool holds_heavy_item = item && item.IsHeavyBehaviour();
48  return other_player.IsUnconscious() && !holds_heavy_item;
49  }
50 
51  /*override void OnFinishProgressClient(ActionData action_data)
52  {
53  action_data.m_Player.TryHideItemInHands(false);
54  }*/
55 
56  override void OnFinishProgressServer(ActionData action_data)
57  {
58  PlayerBase other_player = PlayerBase.Cast(action_data.m_Target.GetObject());
59  other_player.GiveShock(5);
60  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
61  }
62 
63  override void OnExecuteServer(ActionData action_data)
64  {
65 
66  }
67 
68  override void OnEndServer( ActionData action_data )
69  {
70  if ( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(false);
71  }
72 
73  override void OnEndClient( ActionData action_data )
74  {
75  if ( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(false);
76  }
77 
78 };
ItemBase
Definition: inventoryitem.c:730
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
ActionCPR
Definition: actioncpr.c:11
ContinuousInteractActionInput
Definition: actioninput.c:521
CCTMan
Definition: cctman.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
CCINone
Definition: ccinone.c:1
UAMaxDistances
Definition: actionconstants.c:104
REPEAT_AFTER_SEC
const private float REPEAT_AFTER_SEC
Definition: actiondialcombinationlock.c:2
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
ActionCPRCB
Definition: actioncpr.c:1