Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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 
27  override void CreateConditionComponents()
28  {
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 }
ItemBase
Definition: inventoryitem.c:730
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
ActionBandageSelfCB
Definition: actionbandageself.c:1
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionbandageself.c:27
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionbandageself.c:38
ActionBandageSelf
ActionBandageSelfCB ActionContinuousBaseCB ActionBandageSelf()
Definition: actionbandageself.c:17
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTSelf
Definition: cctself.c:1
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actionbandageself.c:43
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
ActionBandageBase
Definition: actionbandagebase.c:1
ApplyBandage
override void ApplyBandage(ItemBase item, PlayerBase player)
Definition: actionsewself.c:47
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CCINonRuined
Definition: ccinonruined.c:1
HasTarget
override bool HasTarget()
Definition: actionbandageself.c:33
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53