DayZ 1.24
Loading...
Searching...
No Matches
ActionCheckPulseTarget.c
Go to the documentation of this file.
8
10{
11 const int TARGET_IRREGULAR_PULSE_BIT = 1 << 31;
12
14 {
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
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 pulse_msg = "_irregular";
43 if (blood_level == EStatLevels.HIGH)
44 blood_msg = "decent";
45 if (blood_level == EStatLevels.MEDIUM)
46 blood_msg = "moderate";
47 if (blood_level == EStatLevels.LOW)
48 blood_msg = "weak";
49 if (blood_level == EStatLevels.CRITICAL)
50 blood_msg = "faint";
51 //string message = blood_msg + " " + pulse_msg + " pulse";
52 string message = "#" + "pulse_" + blood_msg + pulse_msg;
53 return message;
54
55 }
56
57 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
58 {
59 PlayerBase ntarget = PlayerBase.Cast(target.GetObject());
60 if (ntarget && ntarget.IsAlive())
61 return true;
62 return false;
63 }
64 override typename GetInputType()
65 {
67 }
68
74
76 {
77 PlayerBase target_player = PlayerBase.Cast(action_data.m_Target.GetObject());
78 if (target_player)
79 {
80 PlayerBase player = action_data.m_Player;
81 CachedObjectsParams.PARAM1_INT.param1 = target_player.GetStatLevelBlood();
82 bool pulse_type = target_player.GetPulseType();
83 if (pulse_type == EPulseType.IRREGULAR)
85
86 GetGame().RPCSingleParam(player, ERPCs.RPC_CHECK_PULSE, CachedObjectsParams.PARAM1_INT, true, player.GetIdentity());
87 }
88 }
89
91 {
92 PlayerBase ntarget = PlayerBase.Cast(action_data.m_Target.GetObject());
93
94 if (ntarget)
95 action_data.m_Player.m_CheckPulseLastTarget = ntarget;
96 }
97};
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
EPulseType
Definition EPulseType.c:2
ERPCs
Definition ERPCs.c:2
EStatLevels
Definition EStatLevels.c:2
ActionData m_ActionData
override void OnFinishProgressServer(ActionData action_data)
override void OnFinishProgressClient(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
static string GetPulseMessage(EPulseType pulse_type, int blood_level)
ref CABase m_ActionComponent
Definition ActionBase.c:30
Definition CCTMan.c:2
static ref Param1< int > PARAM1_INT
const float DEFAULT
const float CHECK_PULSE
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()