DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Hand_Actions.c
См. документацию.
1
2
7{
11 void Action (HandEventBase e) { }
12};
13
14
15class HandActionCreated extends HandActionBase
16{
17 override void Action (HandEventBase e)
18 {
19 #ifdef ENABLE_LOGGING
21 {
22 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionCreated", e.m_Player.ToString() );
23 }
24 #endif
25
26 e.m_Player.OnItemInHandsChanged();
27 }
28};
29
30class HandActionTake extends HandActionBase
31{
32 override void Action (HandEventBase e)
33 {
34 #ifdef ENABLE_LOGGING
36 {
37 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionTake", e.m_Player.ToString() );
38 }
39 #endif
40
42 e.m_Player.OnItemInHandsChanged();
43 }
44};
45
46class HandActionDrop extends HandActionBase
47{
48 override void Action (HandEventBase e)
49 {
50 #ifdef ENABLE_LOGGING
52 {
53 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionDrop", e.m_Player.ToString() );
54 }
55 #endif
56
58 e.m_Player.OnItemInHandsChanged();
59 }
60};
61
62class HandActionThrow extends HandActionBase
63{
64 override void Action (HandEventBase e)
65 {
66 #ifdef ENABLE_LOGGING
68 {
69 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionThrow", e.m_Player.ToString() );
70 }
71 #endif
72 HandEventThrow throwEvent = HandEventThrow.Cast(e);
73
75
76 DayZPlayer player = DayZPlayer.Cast(e.m_Player);
77 if ( player.GetInstanceType() != DayZPlayerInstanceType.INSTANCETYPE_REMOTE )
78 {
79 InventoryItem item = InventoryItem.Cast(e.GetSrcEntity());
80 if( item )
81 item.ThrowPhysically(player, throwEvent.GetForce());
82 else
83 Error("[hndfsm] HandActionThrow - src entity null!");
84 }
85
86 player.OnItemInHandsChanged();
87 }
88};
89
90class HandActionMoveTo extends HandActionBase
91{
92 override void Action (HandEventBase e)
93 {
94 #ifdef ENABLE_LOGGING
96 {
97 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionMoveTo", e.m_Player.ToString() );
98 }
99 #endif
100
101 HandEventMoveTo es = HandEventMoveTo.Cast(e);
102 if (es)
103 {
105 e.m_Player.OnItemInHandsChanged();
106 }
107 else
108 Error("[hndfsm] HandActionMoveTo - this is no HandEventMoveTo");
109 }
110};
111
112class HandActionDestroy extends HandActionBase
113{
114 override void Action (HandEventBase e)
115 {
116 #ifdef ENABLE_LOGGING
118 {
119 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionDestroy", e.m_Player.ToString() );
120 }
121 #endif
122
123 GetGame().ObjectDelete(e.GetSrcEntity());
124 e.m_Player.OnItemInHandsChanged();
125 }
126};
127
128class HandActionDestroyed extends HandActionBase
129{
130 override void Action (HandEventBase e)
131 {
132 #ifdef ENABLE_LOGGING
134 {
135 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionDestroyed", e.m_Player.ToString() );
136 }
137 #endif
138 e.m_Player.OnItemInHandsChanged();
139 }
140};
141
143{
144 override void Action (HandEventBase e)
145 {
146 #ifdef ENABLE_LOGGING
148 {
149 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionDestroyAndReplaceWithNew", e.m_Player.ToString() );
150 }
151 #endif
152 Man player = e.m_Player;
153 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
154
156 if (itemInHands.GetInventory().GetCurrentInventoryLocation(src))
157 {
159 if (edr)
160 {
161 edr.m_Lambda.Execute();
162 return;
163 }
164 else
165 Error("[hndfsm] HandActionDestroyAndReplaceWithNew - not a HandEventDestroyAndReplaceWithNew event");
166 }
167 else
168 Error("[hndfsm] HandActionDestroyAndReplaceWithNew - itemInHands has no InventoryLocation");
169 }
170};
171
172class HandActionDestroyAndReplaceWithNewElsewhere extends HandActionDestroyAndReplaceWithNew
173{
174 override void Action (HandEventBase e)
175 {
176 super.Action(e);
177 }
178};
179
180class HandActionReplaced extends HandActionBase
181{
182 override void Action (HandEventBase e)
183 {
184 #ifdef ENABLE_LOGGING
186 {
187 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionReplaced", e.m_Player.ToString() );
188 }
189 #endif
190 Man player = e.m_Player;
191
192 player.OnItemInHandsChanged();
193 }
194};
195
196class HandActionSwap extends HandActionBase
197{
198 override void Action (HandEventBase e)
199 {
200 #ifdef ENABLE_LOGGING
202 {
203 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionSwap", e.m_Player.ToString() );
204 }
205 #endif
206 HandEventSwap es = HandEventSwap.Cast(e);
207 if (es)
208 {
209 GameInventory.LocationSwap(es.GetSrc(), es.m_Src2, es.GetDst(), es.m_Dst2);
210 e.m_Player.OnItemInHandsChanged();
211 }
212 else
213 Error("[hndfsm] HandActionSwap - this is no HandEventSwap");
214 }
215};
216
217class HandActionForceSwap extends HandActionBase
218{
219 override void Action (HandEventBase e)
220 {
221 #ifdef ENABLE_LOGGING
223 {
224 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionForceSwap", e.m_Player.ToString() );
225 }
226 #endif
227 HandEventForceSwap es = HandEventForceSwap.Cast(e);
228 if (es)
229 {
230 GameInventory.LocationSwap(es.GetSrc(), es.m_Src2, es.GetDst(), es.m_Dst2);
231 e.m_Player.OnItemInHandsChanged();
232 }
233 else
234 Error("[hndfsm] HandActionForceSwap - this is no HandEventForceSwap");
235 }
236};
237
239
proto native void ObjectDelete(Object obj)
override void OnItemInHandsChanged()
Определения DayZPlayerImplement.c:955
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения Debug.c:147
Определения Debug.c:2
proto native HumanInventory GetHumanInventory()
Определения Building.c:6
static proto native bool LocationSyncMoveEntity(notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
synchronously removes item from current inventory location and adds it to destination no anims involv...
static proto native bool LocationSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
swaps two entities
script counterpart to engine's class Inventory
Определения Inventory.c:79
override void Action(HandEventBase e)
Определения Hand_Actions.c:17
void Action(HandEventBase e)
Определения Hand_Actions.c:11
actions
Определения Hand_Actions.c:7
override void Action(HandEventBase e)
Определения Hand_Actions.c:174
override InventoryLocation GetDst()
Определения Hand_Events.c:212
ref InventoryLocation m_Dst
Определения Hand_Events.c:272
Abstracted event, not to be used, only inherited.
Определения Hand_Events.c:209
Определения Hand_Events.c:679
proto native EntityAI GetEntityInHands()
Определения ItemBase.c:15
InventoryLocation.
Определения InventoryLocation.c:29
static bool IsInventoryHFSMLogEnable()
Определения Debug.c:668
Определения Debug.c:594
DayZPlayerInstanceType
defined in C++
Определения dayzplayer.c:1068
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90