DayZ 1.24
Loading...
Searching...
No Matches
ActionCheckPulse.c
Go to the documentation of this file.
2{
3 const int TARGET_IRREGULAR_PULSE_BIT = 1 << 31;
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
16
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 pulse_msg = "_irregular";
37 if (blood_level == EStatLevels.HIGH)
38 blood_msg = "decent";
39 if (blood_level == EStatLevels.MEDIUM)
40 blood_msg = "moderate";
41 if (blood_level == EStatLevels.LOW)
42 blood_msg = "weak";
43 if (blood_level == EStatLevels.CRITICAL)
44 blood_msg = "faint";
45 //string message = blood_msg + " " + pulse_msg + " pulse";
46 string message = "#" + "pulse_" + blood_msg + pulse_msg;
47 return message;
48
49 }
50
51 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
52 {
53 PlayerBase ntarget = PlayerBase.Cast(target.GetObject());
54 if (ntarget && ntarget.IsAlive())
55 return true;
56 return false;
57 }
58
60 {
61 PlayerBase target_player = PlayerBase.Cast(action_data.m_Target.GetObject());
62 if (target_player)
63 {
64 PlayerBase player = action_data.m_Player;
65 CachedObjectsParams.PARAM1_INT.param1 = target_player.GetStatLevelBlood();
66 bool pulse_type = target_player.GetPulseType();
67 if (pulse_type == EPulseType.IRREGULAR)
69
70 GetGame().RPCSingleParam(player, ERPCs.RPC_CHECK_PULSE, CachedObjectsParams.PARAM1_INT, true, player.GetIdentity());
71 }
72 }
73
74
76 {
77 PlayerBase ntarget = PlayerBase.Cast(action_data.m_Target.GetObject());
78
79 if (ntarget)
80 action_data.m_Player.m_CheckPulseLastTarget = ntarget;
81 }
82
84 {
85 /*
86 PlayerBase target_player = PlayerBase.Cast(action_data.m_Target.GetObject());
87 PlayerBase player = action_data.m_Player;
88 CachedObjectsParams.PARAM1_INT.param1 = target_player.GetStatLevelBlood();
89 GetGame().RPCSingleParam( target_player ,ERPCs.RPC_CHECK_PULSE, CachedObjectsParams.PARAM1_INT, true, target_player.GetIdentity() );
90 */
91 }
92}
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
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
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
static string GetPulseMessage(EPulseType pulse_type, int blood_level)
override void CreateConditionComponents()
override void OnExecuteClient(ActionData action_data)
override void OnExecuteServer(ActionData action_data)
const int TARGET_IRREGULAR_PULSE_BIT
override void OnEndServer(ActionData action_data)
Definition CCTMan.c:2
static ref Param1< int > PARAM1_INT
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()