Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionfillobject.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
5 m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.DEFAULT_FILL);
6 }
7};
8
10{
11 protected int m_ActionState;
12
13 protected const int EMPTY = 0;
14 protected const int FILLED = 1;
15
17 {
19 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
20 m_FullBody = true;
21 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
22 m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_LOW;
23 }
24
31
32 override void OnActionInfoUpdate( PlayerBase player, ActionTarget target, ItemBase item )
33 {
34 HescoBox hesco = HescoBox.Cast(target.GetObject());
35
36 if( hesco.GetState() == HescoBox.UNFOLDED )
37 {
38 m_Text = "#empty";
39 }
40 else
41 {
42 m_Text = "#fill";
43 }
44 }
45
46 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
47 {
48 if ( player.IsPlacingLocal() )
49 return false;
50
51 HescoBox hesco;
52 if ( Class.CastTo(hesco,target.GetObject()) )
53 {
54 if ( hesco.CanBeFilledAtPosition( player.GetPosition() ) )
55 {
56 if ( hesco.GetState() == HescoBox.UNFOLDED )
57 {
59 return true;
60 }
61 else if( hesco.GetState() == HescoBox.FILLED)
62 {
64 return true;
65 }
66 }
67 }
68
69 return false;
70 }
71
72 override void OnFinishProgressServer( ActionData action_data )
73 {
74 HescoBox hesco;
75
76 if ( Class.CastTo(hesco,action_data.m_Target.GetObject()) )
77 {
78 const float ITEM_DAMAGE = 5;
79 action_data.m_MainItem.DecreaseHealth("", "", ITEM_DAMAGE);
80
81 if (hesco.GetState() == HescoBox.UNFOLDED)
82 {
83 hesco.Fill();
84 }
85 else if (hesco.GetState() == HescoBox.FILLED)
86 {
87 hesco.Unfold();
88 }
89 }
90 }
91
92 override void OnFinishProgressClient( ActionData action_data )
93 {
94 HescoBox hesco;
95
96 if ( Class.CastTo(hesco,action_data.m_Target.GetObject()) )
97 {
98 if ( hesco.GetState() == HescoBox.UNFOLDED )
99 {
100 hesco.Fill();
101 }
102 else if ( hesco.GetState() == HescoBox.FILLED )
103 {
104 hesco.Unfold();
105 }
106 }
107 }
108};
ActionData m_ActionData
float m_SpecialtyWeight
Definition actionbase.c:77
int m_StanceMask
Definition actionbase.c:62
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
bool m_FullBody
Definition actionbase.c:61
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
override void OnFinishProgressServer(ActionData action_data)
override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
override void OnFinishProgressClient(ActionData action_data)
Super root of all classes in Enforce script.
Definition enscript.c:11
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602