Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionbandageself.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
5 float effectivity = m_ActionData.m_MainItem.GetBandagingEffectivity();
6 float adjustedTimeSpent = 0;
7
8 if (effectivity > 0)
9 adjustedTimeSpent = UATimeSpent.BANDAGE / effectivity;
10
11 m_ActionData.m_ActionComponent = new CAContinuousRepeat(adjustedTimeSpent);
12 }
13}
14
16{
18 {
19 m_CallbackClass = ActionBandageSelfCB;
20 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_BANDAGE;
21 m_FullBody = true;
22 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
23
24 m_Text = "#treat_wound";
25 }
26
28 {
29 m_ConditionItem = new CCINonRuined();
30 m_ConditionTarget = new CCTSelf();
31 }
32
33 override bool HasTarget()
34 {
35 return false;
36 }
37
38 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
39 {
40 return player.IsBleeding();
41 }
42
43 override void OnFinishProgressServer(ActionData action_data)
44 {
45 PlayerBase target = PlayerBase.Cast(action_data.m_Player);
46 if (action_data.m_MainItem && target)
47 ApplyBandage(action_data.m_MainItem, target);
48 }
49}
ActionBandageSelfCB ActionContinuousBaseCB ActionBandageSelf()
int m_CommandUID
Definition actionbase.c:31
int m_StanceMask
Definition actionbase.c:33
override void ApplyBandage(ItemBase item, PlayerBase player)
ActionData m_ActionData
bool HasTarget()
Definition actionbase.c:244
void CreateConditionComponents()
Definition actionbase.c:230
void OnFinishProgressServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602