DayZ 1.24
Loading...
Searching...
No Matches
ActionSewSelf.c
Go to the documentation of this file.
2{
7}
8
10{
11 void ActionSewSelf()
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
22 {
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
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
48 {
49 if (player.GetBleedingManagerServer())
50 player.GetBleedingManagerServer().RemoveMostSignificantBleedingSourceEx(item);
51
52 PluginTransmissionAgents transmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
54
55 if (item.HasQuantity())
56 item.AddQuantity(-20, true);
57 else
58 item.Delete();
59 }
60}
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
void CreateConditionComponents()
Definition ActionBase.c:196
bool HasTarget()
Definition ActionBase.c:210
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
ActionSewSelfCB ActionContinuousBaseCB ActionSewSelf()
PluginBase GetPlugin(typename plugin_type)
void ApplyBandage(ItemBase item, PlayerBase player)
ActionData m_ActionData
void OnFinishProgressServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
const float SEW_CUTS
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
const int AGT_ITEM_TO_FLESH
Definition constants.c:475