Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionbandagetarget.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 = ActionBandageTargetCB;
20  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_BANDAGETARGET;
21  m_FullBody = true;
22  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
23 
24  m_Text = "#treat_persons_wound";
25  }
26 
27  override void CreateConditionComponents()
28  {
31  }
32 
33  override int GetStanceMask(PlayerBase player)
34  {
35  if (player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_PRONE))
36  return DayZPlayerConstants.STANCEMASK_CROUCH;
37  else
38  return DayZPlayerConstants.STANCEMASK_ERECT;
39  }
40 
41  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
42  {
43  PlayerBase otherPlayer = PlayerBase.Cast(target.GetObject());
44  if (otherPlayer)
45  return otherPlayer.IsBleeding();
46 
47  return false;
48  }
49 
50  override void OnFinishProgressServer(ActionData action_data)
51  {
52  PlayerBase target = PlayerBase.Cast(action_data.m_Target.GetObject());
53 
54  if (action_data.m_MainItem && target)
55  {
56  if (CanReceiveAction(action_data.m_Target))
57  ApplyBandage(action_data.m_MainItem, target);
58  }
59  }
60 
61  override void OnFinishProgressClient(ActionData action_data)
62  {
63  GetGame().GetAnalyticsClient().OnActionBandageTarget();
64  }
65 }
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actionbandagetarget.c:50
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
CCTMan
Definition: cctman.c:1
OnFinishProgressClient
override void OnFinishProgressClient(ActionData action_data)
Definition: actionbandagetarget.c:61
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionbandagetarget.c:27
ActionBandageTargetCB
Definition: actionbandagetarget.c:1
UAMaxDistances
Definition: actionconstants.c:104
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
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
GetStanceMask
override int GetStanceMask(PlayerBase player)
Definition: actionbandagetarget.c:33
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionbandagetarget.c:41
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
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
CanReceiveAction
bool CanReceiveAction(ActionTarget target)
Definition: actionbase.c:638
ActionBandageTarget
ActionBandageTargetCB ActionContinuousBaseCB ActionBandageTarget()
Definition: actionbandagetarget.c:17