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