Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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 
16  void ActionFillObject()
17  {
18  m_CallbackClass = ActionFillObjectCB;
19  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
20  m_FullBody = true;
21  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
23  }
24 
25  override void CreateConditionComponents()
26  {
27 
30  }
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  {
58  m_ActionState = EMPTY;
59  return true;
60  }
61  else if( hesco.GetState() == HescoBox.FILLED)
62  {
63  m_ActionState = FILLED;
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 = 0.05;
79  action_data.m_MainItem.DecreaseHealth ( "", "", action_data.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus( ITEM_DAMAGE, this.GetSpecialtyWeight() )*100 );
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  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
92  }
93 
94  override void OnFinishProgressClient( ActionData action_data )
95  {
96  HescoBox hesco;
97 
98  if ( Class.CastTo(hesco,action_data.m_Target.GetObject()) )
99  {
100  if ( hesco.GetState() == HescoBox.UNFOLDED )
101  {
102  hesco.Fill();
103  }
104  else if ( hesco.GetState() == HescoBox.FILLED )
105  {
106  hesco.Unfold();
107  }
108  }
109  }
110 };
ItemBase
Definition: inventoryitem.c:730
CAContinuousTime
Definition: cacontinuoustime.c:1
EMPTY
const string EMPTY
Lists loot spawns that are not abandoned but have no loot.
Definition: centraleconomy.c:181
UASoftSkillsWeight
Definition: actionconstants.c:118
UAMaxDistances
Definition: actionconstants.c:104
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
ActionFillObjectCB
Definition: actionfillobject.c:1
ActionFillObject
Definition: actionfillobject.c:9
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTNonRuined
Definition: cctnonruined.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53