DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionFillObject.c
См. документацию.
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};
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
float m_SpecialtyWeight
Определения ActionBase.c:77
int m_StanceMask
Определения ActionBase.c:62
string m_Text
Определения ActionBase.c:58
ref CCIBase m_ConditionItem
Определения ActionBase.c:64
bool m_FullBody
Определения ActionBase.c:61
ref CCTBase m_ConditionTarget
Определения ActionBase.c:65
ActionData m_ActionData
Определения AnimatedActionBase.c:3
void ActionContinuousBase()
Определения ActionContinuousBase.c:124
int m_ActionState
Определения ActionFillObject.c:11
override void OnFinishProgressServer(ActionData action_data)
Определения ActionFillObject.c:72
override void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionFillObject.c:32
const int EMPTY
Определения ActionFillObject.c:13
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionFillObject.c:46
const int FILLED
Определения ActionFillObject.c:14
override void CreateConditionComponents()
Определения ActionFillObject.c:25
void ActionFillObject()
Определения ActionFillObject.c:16
override void OnFinishProgressClient(ActionData action_data)
Определения ActionFillObject.c:92
override void CreateActionComponent()
Определения ActionFillObject.c:3
int m_CommandUID
Определения AnimatedActionBase.c:143
Определения CCINonRuined.c:2
Определения CCTNonRuined.c:2
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения InventoryItem.c:731
Определения PlayerBaseClient.c:2
const float DEFAULT
Определения ActionConstants.c:112
const float DEFAULT_FILL
Определения ActionConstants.c:31
Определения ActionConstants.c:28
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.