DayZ 1.24
Loading...
Searching...
No Matches
ActionSewSelf.c File Reference

Go to the source code of this file.

Classes

class  ActionSewSelfCB
 

Functions

ActionSewSelfCB ActionContinuousBaseCB ActionSewSelf ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override bool HasTarget ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void ApplyBandage (ItemBase item, PlayerBase player)
 

Function Documentation

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

Definition at line 32 of file ActionSewSelf.c.

33 {
34 if (!super.ActionCondition(player, target, item))
35 return false;
36
37 return player.IsBleeding();
38 }

◆ ActionSewSelf()

Definition at line 1 of file ActionSewSelf.c.

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 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

Referenced by ActionConstructor::RegisterActions(), and SewingKit::SetActions().

◆ ApplyBandage()

override void ApplyBandage ( ItemBase item,
PlayerBase player )

Definition at line 47 of file ActionSewSelf.c.

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 }
PluginBase GetPlugin(typename plugin_type)
const int AGT_ITEM_TO_FLESH
Definition constants.c:475

References AGT_ITEM_TO_FLESH, and GetPlugin().

◆ CreateActionComponent()

override void ActionSewSelf::CreateActionComponent ( )

Definition at line 12 of file ActionSewSelf.c.

12 {
13 m_CallbackClass = ActionSewSelfCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_STITCHUPSELF;
15 m_FullBody = true;

References m_FullBody, m_StanceMask, and m_Text.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 21 of file ActionSewSelf.c.

22 {
25 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ HasTarget()

override bool HasTarget ( )

Definition at line 27 of file ActionSewSelf.c.

28 {
29 return false;
30 }

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 40 of file ActionSewSelf.c.

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 }
override void ApplyBandage(ItemBase item, PlayerBase player)

References ActionBandageBase::ApplyBandage().