Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionsewself.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 = ActionSewSelfCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_STITCHUPSELF;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
17 
18  m_Text = "#sew_cuts";
19  }
20 
21  override void CreateConditionComponents()
22  {
24  m_ConditionTarget = new CCTSelf();
25  }
26 
27  override bool HasTarget()
28  {
29  return false;
30  }
31 
32  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
33  {
34  if (!super.ActionCondition(player, target, item))
35  return false;
36 
37  return player.IsBleeding();
38  }
39 
40  override void OnFinishProgressServer(ActionData action_data)
41  {
42  PlayerBase player = PlayerBase.Cast(action_data.m_Player);
43  if (action_data.m_MainItem && player)
44  ApplyBandage(action_data.m_MainItem, player);
45  }
46 
47  override void ApplyBandage(ItemBase item, PlayerBase player)
48  {
49  if (player.GetBleedingManagerServer())
50  player.GetBleedingManagerServer().RemoveMostSignificantBleedingSourceEx(item);
51 
52  PluginTransmissionAgents transmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
53  transmissionAgents.TransmitAgents(item, player, AGT_ITEM_TO_FLESH);
54 
55  if (item.HasQuantity())
56  item.AddQuantity(-20, true);
57  else
58  item.Delete();
59  }
60 }
ItemBase
Definition: inventoryitem.c:730
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
ActionSewSelf
ActionSewSelfCB ActionContinuousBaseCB ActionSewSelf()
Definition: actionsewself.c:11
ActionSewSelfCB
Definition: actionsewself.c:1
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
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actionsewself.c:40
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionsewself.c:32
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTSelf
Definition: cctself.c:1
HasTarget
override bool HasTarget()
Definition: actionsewself.c:27
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
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionsewself.c:21