Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
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 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CHECKPULSE;
17 m_FullBody = true;
18 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
19 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_HIGH;
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};
ActionData m_ActionData
float m_SpecialtyWeight
Definition actionbase.c:77
int m_StanceMask
Definition actionbase.c:62
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
bool m_FullBody
Definition actionbase.c:61
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()