Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actioncheckpulsetarget.c
Go to the documentation of this file.
1
class
ActionCheckPulseTargetCB
:
ActionContinuousBaseCB
2
{
3
override
void
CreateActionComponent
()
4
{
5
m_ActionData
.m_ActionComponent =
new
CAContinuousTime
(
UATimeSpent
.
CHECK_PULSE
);
6
}
7
};
8
9
class
ActionCheckPulseTarget
:
ActionContinuousBase
10
{
11
const
int
TARGET_IRREGULAR_PULSE_BIT
= 1 << 31;
12
13
void
ActionCheckPulseTarget
()
14
{
15
m_CallbackClass
=
ActionCheckPulseTargetCB
;
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
{
78
return
ContinuousInteractActionInput
;
79
}
80
81
override
void
CreateConditionComponents
()
82
{
83
m_ConditionItem
=
new
CCINone
;
84
m_ConditionTarget
=
new
CCTMan
(
UAMaxDistances
.
DEFAULT
);
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
g_Game
.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
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBaseCB::m_ActionData
ActionData m_ActionData
Definition
animatedactionbase.c:3
ActionBase::m_FullBody
bool m_FullBody
Definition
actionbase.c:67
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::m_SpecialtyWeight
float m_SpecialtyWeight
Definition
actionbase.c:83
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionBase::m_StanceMask
int m_StanceMask
Definition
actionbase.c:68
ActionCheckPulseTargetCB
Definition
actioncheckpulsetarget.c:2
ActionCheckPulseTargetCB::CreateActionComponent
override void CreateActionComponent()
Definition
actioncheckpulsetarget.c:3
ActionCheckPulseTarget::OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition
actioncheckpulsetarget.c:87
ActionCheckPulseTarget::CreateConditionComponents
override void CreateConditionComponents()
Definition
actioncheckpulsetarget.c:81
ActionCheckPulseTarget::ActionCheckPulseTarget
void ActionCheckPulseTarget()
Definition
actioncheckpulsetarget.c:13
ActionCheckPulseTarget::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actioncheckpulsetarget.c:67
ActionCheckPulseTarget::OnFinishProgressClient
override void OnFinishProgressClient(ActionData action_data)
Definition
actioncheckpulsetarget.c:102
ActionCheckPulseTarget::GetPulseMessage
static string GetPulseMessage(EPulseType pulse_type, int blood_level)
Definition
actioncheckpulsetarget.c:23
ActionCheckPulseTarget::GetInputType
override GetInputType()
Definition
actioncheckpulsetarget.c:76
ActionCheckPulseTarget::TARGET_IRREGULAR_PULSE_BIT
const int TARGET_IRREGULAR_PULSE_BIT
Definition
actioncheckpulsetarget.c:11
ActionContinuousBaseCB
Definition
actioncontinuousbase.c:2
ActionContinuousBase::ActionContinuousBase
void ActionContinuousBase()
Definition
actioncontinuousbase.c:124
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
AnimatedActionBase::m_CallbackClass
m_CallbackClass
Definition
animatedactionbase.c:145
CAContinuousTime
Definition
cacontinuoustime.c:2
CCINone
Definition
ccinone.c:2
CCTMan
Definition
cctman.c:2
CachedObjectsParams
Definition
utilityclasses.c:10
CachedObjectsParams::PARAM1_INT
static ref Param1< int > PARAM1_INT
Definition
utilityclasses.c:11
ContinuousInteractActionInput
Definition
actioninput.c:523
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
UAMaxDistances
Definition
actionconstants.c:110
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
actionconstants.c:112
UATimeSpent
Definition
actionconstants.c:28
UATimeSpent::CHECK_PULSE
const float CHECK_PULSE
Definition
actionconstants.c:54
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
EPulseType
EPulseType
Definition
epulsetype.c:2
ERPCs
ERPCs
Definition
erpcs.c:2
EStatLevels
EStatLevels
Definition
estatlevels.c:2
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
continuous
medical
actioncheckpulsetarget.c
Generated by
1.17.0