DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionSewTarget.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7};
8
10{
12 {
14 //m_Animation = "sew";
15 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
16 m_FullBody = true;
17 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
19 m_Text = "#sew_targets_cuts";
20 }
21
23 {
26 }
27 /*
28 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
29 {
30 PlayerBase other_player = PlayerBase.Cast(target.GetObject());
31 return other_player.IsBleeding();
32 }
33*/
34 override void OnFinishProgressServer( ActionData action_data )
35 {
36 PlayerBase target = PlayerBase.Cast(action_data.m_Target.GetObject());
37
38 if (CanReceiveAction(action_data.m_Target))
39 {
40 if (action_data.m_MainItem && target)
41 {
42 ApplyBandage( action_data.m_MainItem, target );
43 action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
44 }
45 }
46 }
47
48 override void ApplyBandage( ItemBase item, PlayerBase player )
49 {
50 if (player.GetBleedingManagerServer() )
51 {
52 player.GetBleedingManagerServer().RemoveMostSignificantBleedingSourceEx(item);
53 }
54
55 PluginTransmissionAgents m_mta = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
56 m_mta.TransmitAgents(item, player, AGT_ITEM_TO_FLESH);
57
58 if (item.HasQuantity())
59 {
60 item.AddQuantity(-20,true);
61 }
62 else
63 {
64 item.Delete();
65 }
66 }
67};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:637
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
PluginBase GetPlugin(typename plugin_type)
protected ActionData m_ActionData
ItemBase m_MainItem
Definition ActionBase.c:28
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionTarget m_Target
Definition ActionBase.c:32
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
override void ApplyBandage(ItemBase item, PlayerBase player)
override void CreateConditionComponents()
Definition CCTMan.c:2
const float DEFAULT
const float PRECISE_MEDIUM
const float SEW_CUTS
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
const int AGT_ITEM_TO_FLESH
Definition constants.c:459