Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionsewtarget.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousRepeat(UATimeSpent.SEW_CUTS);
6  }
7 }
8 
10 {
12  {
13  m_CallbackClass = ActionSewTargetCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
17 
18  m_Text = "#sew_targets_cuts";
19  }
20 
21  override void CreateConditionComponents()
22  {
25  }
26 
27  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
28  {
29  if (!super.ActionCondition(player, target, item))
30  return false;
31 
32  PlayerBase otherPlayer = PlayerBase.Cast(target.GetObject());
33  return otherPlayer.IsBleeding();
34  }
35 
36  override void OnFinishProgressServer(ActionData action_data)
37  {
38  if (CanReceiveAction(action_data.m_Target))
39  {
40  PlayerBase player = PlayerBase.Cast(action_data.m_Target.GetObject());
41  if (action_data.m_MainItem && player)
42  ApplyBandage(action_data.m_MainItem, player);
43  }
44  }
45 
46  override void ApplyBandage(ItemBase item, PlayerBase player)
47  {
48  if (player.GetBleedingManagerServer())
49  player.GetBleedingManagerServer().RemoveMostSignificantBleedingSourceEx(item);
50 
51  PluginTransmissionAgents transmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
52  transmissionAgents.TransmitAgents(item, player, AGT_ITEM_TO_FLESH);
53 
54  if (item.HasQuantity())
55  item.AddQuantity(-20, true);
56  else
57  item.Delete();
58  }
59 }
ItemBase
Definition: inventoryitem.c:730
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actionsewtarget.c:36
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
ActionSewTarget
ActionSewTargetCB ActionContinuousBaseCB ActionSewTarget()
Definition: actionsewtarget.c:11
ApplyBandage
override void ApplyBandage(ItemBase item, PlayerBase player)
Definition: actionsewtarget.c:46
CCTMan
Definition: cctman.c:1
UAMaxDistances
Definition: actionconstants.c:104
AGT_ITEM_TO_FLESH
const int AGT_ITEM_TO_FLESH
Definition: constants.c:475
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
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
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionsewtarget.c:27
ActionBandageBase
Definition: actionbandagebase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionsewtarget.c:21
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
ActionSewTargetCB
Definition: actionsewtarget.c:1
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
CanReceiveAction
bool CanReceiveAction(ActionTarget target)
Definition: actionbase.c:638