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