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

Go to the source code of this file.

Classes

class  ActionSewTargetCB
 

Functions

ActionSewTargetCB ActionContinuousBaseCB ActionSewTarget ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
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 27 of file ActionSewTarget.c.

28 {
29 if (!super.ActionCondition(player, target, item))
30 return false;
31
32 PlayerBase otherPlayer = PlayerBase.Cast(target.GetObject());
33 return otherPlayer.IsBleeding();
34 }

◆ ActionSewTarget()

Definition at line 1 of file ActionSewTarget.c.

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 }
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 46 of file ActionSewTarget.c.

47 {
48 if (player.GetBleedingManagerServer())
49 player.GetBleedingManagerServer().RemoveMostSignificantBleedingSourceEx(item);
50
51 PluginTransmissionAgents transmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
53
54 if (item.HasQuantity())
55 item.AddQuantity(-20, true);
56 else
57 item.Delete();
58 }
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 ActionSewTarget::CreateActionComponent ( )

Definition at line 12 of file ActionSewTarget.c.

12 {
13 m_CallbackClass = ActionSewTargetCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
15 m_FullBody = true;

References m_FullBody, m_StanceMask, and m_Text.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 21 of file ActionSewTarget.c.

22 {
25 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
Definition CCTMan.c:2
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 36 of file ActionSewTarget.c.

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 }
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:594
override void ApplyBandage(ItemBase item, PlayerBase player)

References ActionBandageBase::ApplyBandage(), and CanReceiveAction().