Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actioncheckpulsetarget.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.CHECK_PULSE);
6  }
7 };
8 
10 {
11  const int TARGET_IRREGULAR_PULSE_BIT = 1 << 31;
12 
14  {
15  m_CallbackClass = ActionCheckPulseTargetCB;
16  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CHECKPULSE;
17  m_FullBody = true;
18  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
20  m_Text = "#check_pulse_target";
21  }
22 
23  static string GetPulseMessage(EPulseType pulse_type, int blood_level)
24  {
25  //builds string table keys:
26 
27  //pulse_strong
28  //pulse_decent
29  //pulse_moderate
30  //pulse_weak
31  //pulse_faint
32  //pulse_strong_irregular
33  //pulse_decent_irregular
34  //pulse_moderate_irregular
35  //pulse_weak_irregular
36  //pulse_faint_irregular
37 
38  string blood_msg = "strong";
39  string pulse_msg = "";
40 
41  if(pulse_type == EPulseType.IRREGULAR)
42  {
43  pulse_msg = "_irregular";
44  }
45  if( blood_level == EStatLevels.HIGH )
46  {
47  blood_msg = "decent";
48  }
49  if( blood_level == EStatLevels.MEDIUM )
50  {
51  blood_msg = "moderate";
52  }
53  if( blood_level == EStatLevels.LOW )
54  {
55  blood_msg = "weak";
56  }
57  if( blood_level == EStatLevels.CRITICAL )
58  {
59  blood_msg = "faint";
60  }
61  //string message = blood_msg + " " + pulse_msg + " pulse";
62  string message = "#"+ "pulse_" + blood_msg + pulse_msg;
63  return message;
64 
65  }
66 
67  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
68  {
69  PlayerBase ntarget = PlayerBase.Cast( target.GetObject() );
70  if( ntarget && ntarget.IsAlive())
71  {
72  return true;
73  }
74  return false;
75  }
76  override typename GetInputType()
77  {
79  }
80 
81  override void CreateConditionComponents()
82  {
85  }
86 
87  override void OnFinishProgressServer( ActionData action_data )
88  {
89  PlayerBase target_player = PlayerBase.Cast(action_data.m_Target.GetObject());
90  if (target_player)
91  {
92  PlayerBase player = action_data.m_Player;
93  CachedObjectsParams.PARAM1_INT.param1 = target_player.GetStatLevelBlood();
94  bool pulse_type = target_player.GetPulseType();
95  if (pulse_type == EPulseType.IRREGULAR)
96  CachedObjectsParams.PARAM1_INT.param1 = CachedObjectsParams.PARAM1_INT.param1 | (1 << TARGET_IRREGULAR_PULSE_BIT);
97 
98  GetGame().RPCSingleParam( player ,ERPCs.RPC_CHECK_PULSE, CachedObjectsParams.PARAM1_INT, true, player.GetIdentity() );
99  }
100  }
101 
102  override void OnFinishProgressClient( ActionData action_data )
103  {
104  PlayerBase ntarget = PlayerBase.Cast( action_data.m_Target.GetObject() );
105 
106  if(ntarget)
107  {
108  action_data.m_Player.m_CheckPulseLastTarget = ntarget;
109  }
110  }
111 };
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
CAContinuousTime
Definition: cacontinuoustime.c:1
ContinuousInteractActionInput
Definition: actioninput.c:521
CCTMan
Definition: cctman.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
CCINone
Definition: ccinone.c:1
ActionCheckPulseTarget
Definition: actioncheckpulsetarget.c:9
CachedObjectsParams
Definition: utilityclasses.c:9
UAMaxDistances
Definition: actionconstants.c:104
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
ActionCheckPulseTargetCB
Definition: actioncheckpulsetarget.c:1
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
EPulseType
EPulseType
Definition: epulsetype.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
EStatLevels
EStatLevels
Definition: estatlevels.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ERPCs
ERPCs
Definition: erpcs.c:1
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