DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
WeaponChamberingLooped.c
См. документацию.
1// load x bullets
2class LoopedChambering_EndLoop extends WeaponStartAction
3{
4 override bool IsWaitingForActionFinish () { return true; }
5};
6
7class LoopedChambering_Wait4ShowBullet2 extends WeaponStateBase
8{
9 override bool IsWaitingForActionFinish () { return false; }
10};
11
12class LoopedChambering extends WeaponStateBase
13{
17 Magazine m_srcMagazine;
18 ref InventoryLocation m_srcMagazinePrevLocation;
19
20 ref WeaponStateBase m_start;
21 ref WeaponEjectCasing m_eject;
22 ref WeaponChambering_Base m_chamber;
23 ref LoopedChambering_Wait4ShowBullet2 m_w4sb2;
24 ref WeaponStartAction m_endLoop;
25 ref BulletHide_W4T m_hideB;
26
27 void LoopedChambering (Weapon_Base w = NULL, WeaponStateBase parent = NULL, WeaponActions action = WeaponActions.NONE, int startActionType = -1, int endActionType = -1)
28 {
29 m_action = action;
30 m_startActionType = startActionType;
31 m_endActionType = endActionType;
32
33 // setup nested state machine
34 m_start = new WeaponChambering_Start(m_weapon, this, m_action, m_startActionType);
36 m_chamber = new WeaponChambering_Cartridge_ChambToMag(m_weapon, this);
37 m_w4sb2 = LoopedChambering_Wait4ShowBullet2(m_weapon, this);
38 m_hideB = new BulletHide_W4T(m_weapon, this);
39 m_endLoop = new LoopedChambering_EndLoop(m_weapon, this, m_action, m_endActionType); // @NOTE: termination playing action - dummy?
40 // events
41 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
42 WeaponEventContinuousLoadBulletStart __lS_ = new WeaponEventContinuousLoadBulletStart;
43 WeaponEventContinuousLoadBulletEnd __lE_ = new WeaponEventContinuousLoadBulletEnd;
44 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
45 WeaponEventAnimBulletHide __bh_ = new WeaponEventAnimBulletHide;
46 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
47 WeaponEventAnimBulletInMagazine __bM_ = new WeaponEventAnimBulletInMagazine;
48 WeaponEventAnimBulletShow2 _bs2_ = new WeaponEventAnimBulletShow2;
49
50 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
51 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
52 m_fsm.AddTransition(new WeaponTransition(m_start, __bs_, m_chamber));
53 m_fsm.AddTransition(new WeaponTransition(m_eject, __bs_, m_chamber));
54
55
56 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_w4sb2, NULL, new GuardAnd(new GuardAnd(new WeaponGuardHasAmmoInLoopedState(m_chamber), new WeaponGuardInternalMagazineHasRoomForBullet(m_weapon)),new WeaponGuardWeaponManagerWantContinue())));
57 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_endLoop));
58 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __bh_, m_hideB));
59 m_fsm.AddTransition(new WeaponTransition(m_hideB, __bs_, m_chamber));
60
61 m_fsm.AddTransition(new WeaponTransition(m_endLoop, _fin_, NULL));
62
63 // Safety exits
64 m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, null));
65 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, _fin_, null));
66 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
67 m_fsm.AddTransition(new WeaponTransition(m_eject , _fin_, null));
68 m_fsm.AddTransition(new WeaponTransition(m_start , _fin_, null));
69
70 m_fsm.SetInitialState(m_start);
71 }
72
73 override void OnEntry (WeaponEventBase e)
74 {
75 if (e != NULL)
76 {
77
79 if (m_srcMagazine != NULL)
80 {
81 m_weapon.SelectionBulletHide();
83 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
84
86
87 // move to LH
90 if (GameInventory.LocationSyncMoveEntity(newSrc, lhand))
91 {
92 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from inv (inv->LHand)"); }
93 }
94 else
95 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from inv");
96
97 m_chamber.m_srcMagazine = m_srcMagazine;
98 }
99 else
100 {
101 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering m_srcMagazine = NULL");
102 }
103 }
104 else
105 {
106 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
107 }
108
109 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
110 }
111 override void OnExit (WeaponEventBase e)
112 {
113 bool done = false;
114 if (m_srcMagazine)
115 {
116 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
117
118 InventoryLocation leftHandIl = new InventoryLocation;
119 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
120 if (leftHandIl.IsValid())
121 {
123 {
125 {
127 {
129 {
130 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
131 done = true;
132 }
133 }
134 }
135 }
136
137 if( !done)
138 {
140 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
141
142 if(!il || !il.IsValid())
143 {
144 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
145 {
146 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - no inventory space for ammo pile - dropped to ground - exit"); }
147 }
148 else
149 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
150
151 }
152 else
153 {
154 if (GameInventory.LocationSyncMoveEntity(leftHandIl, il))
155 {
156 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand (LHand->inv) - exit"); }
157 }
158 else
159 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from wpn - exit");
160 }
161 }
162 }
163 }
164
165 super.OnExit(e);
166 m_srcMagazine = NULL;
167 m_chamber.m_srcMagazine = NULL;
169 }
170 override void OnAbort (WeaponEventBase e)
171 {
172 bool done = false;
173 if (m_srcMagazine)
174 {
175 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
176
177 InventoryLocation leftHandIl = new InventoryLocation;
178 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
179 if (leftHandIl.IsValid())
180 {
182 {
184 {
186 {
188 {
189 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
190 done = true;
191 }
192 }
193 }
194 }
195
196 if( !done)
197 {
199 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
200
201 if(!il || !il.IsValid())
202 {
203 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
204 {
205 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - no inventory space for ammo pile - dropped to ground - abort"); }
206 }
207 else
208 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
209
210 }
211 else
212 {
213 if (GameInventory.LocationSyncMoveEntity(leftHandIl, il))
214 {
215 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
216 }
217 else
218 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from wpn - abort");
219 }
220 }
221 }
222 }
223
224 super.OnAbort(e);
225 m_srcMagazine = NULL;
226 m_chamber.m_srcMagazine = NULL;
228 }
229
231 {
232 if (!super.SaveCurrentFSMState(ctx))
233 return false;
234
235 if (!ctx.Write(m_srcMagazine))
236 {
237 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
238 return false;
239 }
240
242 {
243 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
244 return false;
245 }
246
247 return true;
248 }
249
250 override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
251 {
252 if (!super.LoadCurrentFSMState(ctx, version))
253 return false;
254
255 if (!ctx.Read(m_srcMagazine))
256 {
257 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
258 return false;
259 }
260
262 {
263 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
264 return false;
265 }
266 return true;
267 }
268};
269
270class LoopedChamberingEjectLast extends WeaponStateBase
271{
274 int m_endActionType;
275 Magazine m_srcMagazine;
276 ref InventoryLocation m_srcMagazinePrevLocation;
277
278 ref WeaponStateBase m_start;
279 ref WeaponEjectCasing m_eject;
280 ref WeaponChambering_Base m_chamber;
281 ref LoopedChambering_Wait4ShowBullet2 m_w4sb2;
282 ref WeaponStartAction m_endLoop;
283 ref BulletHide_W4T m_hideB;
284 ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag;
285
286 void LoopedChamberingEjectLast (Weapon_Base w = NULL, WeaponStateBase parent = NULL, WeaponActions action = WeaponActions.NONE, int startActionType = -1, int endActionType = -1)
287 {
288 m_action = action;
289 m_startActionType = startActionType;
290 m_endActionType = endActionType;
291
292 // setup nested state machine
293 m_start = new WeaponChambering_Start(m_weapon, this, m_action, m_startActionType);
295 m_chamber = new WeaponChambering_Cartridge_InnerMag(m_weapon, this);
296 m_w4sb2 = new LoopedChambering_Wait4ShowBullet2(m_weapon, this);
297 m_hideB = new BulletHide_W4T(m_weapon, this);
298 m_chamberFromInnerMag = new WeaponChamberFromInnerMag_W4T(m_weapon, this);
299 m_endLoop = new LoopedChambering_EndLoop(m_weapon, this, m_action, m_endActionType); // @NOTE: termination playing action - dummy?
300 // events
301 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
302 WeaponEventContinuousLoadBulletStart __lS_ = new WeaponEventContinuousLoadBulletStart;
303 WeaponEventContinuousLoadBulletEnd __lE_ = new WeaponEventContinuousLoadBulletEnd;
304 WeaponEventAnimCocked __wc_ = new WeaponEventAnimCocked;
305 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
306 WeaponEventAnimBulletHide __bh_ = new WeaponEventAnimBulletHide;
307 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
308 WeaponEventAnimBulletInMagazine __bM_ = new WeaponEventAnimBulletInMagazine;
309 WeaponEventAnimBulletShow2 _bs2_ = new WeaponEventAnimBulletShow2;
310
311 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
312 m_fsm.AddTransition(new WeaponTransition(m_start , __bs_, m_chamber));
313
314
315 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_w4sb2, NULL, new GuardAnd(new GuardAnd(new WeaponGuardHasAmmoInLoopedState(m_chamber), new WeaponGuardInternalMagazineHasRoomForBullet(m_weapon)),new WeaponGuardWeaponManagerWantContinue())));
316 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_endLoop));
317 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __bh_, m_hideB));
318 m_fsm.AddTransition(new WeaponTransition(m_hideB, __bs_, m_chamber));
319
320 m_fsm.AddTransition(new WeaponTransition(m_endLoop, _fin_, NULL));
321
322 m_fsm.AddTransition(new WeaponTransition(m_hideB, __be_, m_eject));
323 m_fsm.AddTransition(new WeaponTransition(m_endLoop, __be_, m_eject));
324 m_fsm.AddTransition(new WeaponTransition(m_eject, __wc_, m_chamberFromInnerMag));
325 m_fsm.AddTransition(new WeaponTransition(m_chamberFromInnerMag, _fin_, NULL));
326
327 // Safety exits
328 m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, null));
329 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, _fin_, null));
330 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
331 m_fsm.AddTransition(new WeaponTransition(m_eject , _fin_, null));
332 m_fsm.AddTransition(new WeaponTransition(m_start , _fin_, null));
333
334 m_fsm.SetInitialState(m_start);
335 }
336
337 override void OnEntry (WeaponEventBase e)
338 {
339 if (e != NULL)
340 {
342 if (m_srcMagazine != NULL)
343 {
345 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
346
348
349 // move to LH
352 if (GameInventory.LocationSyncMoveEntity(newSrc, lhand))
353 {
354 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from inv (inv->LHand)"); }
355 }
356 else
357 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from inv");
358
359 m_chamber.m_srcMagazine = m_srcMagazine;
360 }
361 else
362 {
363 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast m_srcMagazine = NULL");
364 }
365 }
366 else
367 {
368 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
369 }
370
371 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
372 }
373 override void OnExit (WeaponEventBase e)
374 {
375 bool done = false;
376 if (m_srcMagazine)
377 {
378 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
379
380 InventoryLocation leftHandIl = new InventoryLocation;
381 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
382 if (leftHandIl.IsValid())
383 {
385 {
387 {
389 {
391 {
392 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
393 done = true;
394 }
395 }
396 }
397 }
398
399 if (!done)
400 {
402 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
403
404 if (!il || !il.IsValid())
405 {
406 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
407 {
408 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - exit"); }
409 }
410 else
411 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
412
413 }
414 else
415 {
416 if (GameInventory.LocationSyncMoveEntity(leftHandIl, il))
417 {
418 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - exit"); }
419 }
420 else
421 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - exit");
422 }
423 }
424 }
425 }
426
427 super.OnExit(e);
428 m_srcMagazine = NULL;
429 m_chamber.m_srcMagazine = NULL;
431 }
432 override void OnAbort (WeaponEventBase e)
433 {
434 bool done = false;
435 if (m_srcMagazine)
436 {
437 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
438
439 InventoryLocation leftHandIl = new InventoryLocation;
440 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
441 if (leftHandIl.IsValid())
442 {
444 {
446 {
448 {
450 {
451 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
452 done = true;
453 }
454 }
455 }
456 }
457
458 if (!done)
459 {
461 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
462
463 if (!il || !il.IsValid())
464 {
465 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
466 {
467 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - abort"); }
468 }
469 else
470 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
471
472 }
473 else
474 {
475 if (GameInventory.LocationSyncMoveEntity(leftHandIl, il))
476 {
477 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
478 }
479 else
480 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - abort");
481 }
482 }
483 }
484 }
485
486 super.OnAbort(e);
487 m_srcMagazine = NULL;
488 m_chamber.m_srcMagazine = NULL;
490 }
491
493 {
494 if (!super.SaveCurrentFSMState(ctx))
495 return false;
496
497 if (!ctx.Write(m_srcMagazine))
498 {
499 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
500 return false;
501 }
502
504 {
505 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
506 return false;
507 }
508 return true;
509 }
510
511 override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
512 {
513 if (!super.LoadCurrentFSMState(ctx, version))
514 return false;
515
516 if (!ctx.Read(m_srcMagazine))
517 {
518 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
519 return false;
520 }
521
523 {
524 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
525 return false;
526 }
527 return true;
528 }
529};
void wpnDebugPrint(string s)
Определения Debug.c:9
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
bool OptionalLocationReadFromContext(out InventoryLocation loc, notnull ParamsReadContext ctx)
Определения InventoryLocation.c:662
bool OptionalLocationWriteToContext(InventoryLocation loc, notnull ParamsWriteContext ctx)
Определения InventoryLocation.c:640
enum FSMTransition WeaponTransition
ref LoopedChambering_Wait4ShowBullet2 m_w4sb2
Определения WeaponChambering.c:641
int m_startActionType
Определения WeaponChambering.c:632
int m_endActionType
Определения WeaponChambering.c:633
Magazine m_srcMagazine
Определения WeaponChambering.c:634
ref InventoryLocation m_srcMagazinePrevLocation
source of the cartridge
Определения WeaponChambering.c:635
ref WeaponEndAction m_endLoop
Определения WeaponChambering.c:642
ref WeaponStateBase m_start
Определения WeaponChambering.c:637
class WeaponEndAction extends WeaponStartAction m_action
ref WeaponChambering_Base m_chamber
Определения WeaponChambering.c:639
ref WeaponEjectCasingMultiMuzzle m_eject
Определения WeaponChambering.c:638
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 LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
script counterpart to engine's class Inventory
Определения Inventory.c:79
proto native bool IsValid()
verify current set inventory location
proto native vector GetPos()
returns position of item in world if type is Ground
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
sets current inventory location type to Attachment with slot id set to <slotId>
InventoryLocation.
Определения InventoryLocation.c:29
provides access to slot configuration
Определения InventorySlots.c:6
static bool IsWeaponLogEnable()
Определения Debug.c:718
Определения Debug.c:594
Определения ObjectTyped.c:2
proto bool Write(void value_out)
proto bool Read(void value_in)
shorthand
Определения BoltActionRifle_Base.c:6
Magazine m_magazine
Определения Events.c:38
DayZPlayer m_player
Определения Events.c:37
signalize mechanism manipulation
Определения Events.c:35
weapon finite state machine
const float MAX_DROP_MAGAZINE_DISTANCE_SQ
Определения WeaponManager.c:3
Определения WeaponManager.c:2
override bool IsWaitingForActionFinish()
Определения WeaponChamberingLooped.c:4
simple class starting animation action specified by m_action and m_actionType
Определения WeaponChambering.c:3
ref BulletHide_W4T m_hideB
Определения RifleEjectCasing.c:8
ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag
Определения WeaponChamberingLooped.c:284
void WeaponStateBase(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
internal state id used for load/restore
Определения WeaponStateBase.c:17
void LoopedChamberingEjectLast(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
Определения WeaponChamberingLooped.c:286
int m_startActionType
Определения WeaponChambering.c:933
ref WeaponStartAction m_endLoop
Определения WeaponChambering.c:943
Magazine m_srcMagazine
destination of the ejected cartridge
Определения RifleChambering.c:5
ref WeaponFSM m_fsm
hierarchical parent state of this state (or null)
Определения WeaponStateBase.c:14
ref LoopedChambering_Wait4ShowBullet2 m_w4sb2
Определения WeaponChambering.c:942
WeaponActions m_action
Определения RifleChambering.c:3
Weapon_Base m_weapon
Определения WeaponStateBase.c:12
ref WeaponChambering_Cartridge m_chamber
Определения RifleChambering.c:9
override bool IsWaitingForActionFinish()
Определения WeaponChamberingLooped.c:9
override void OnEntry(WeaponEventBase e)
Определения WeaponChamberingLooped.c:73
ref WeaponStateBase m_start
source of the cartridge
Определения RifleChambering.c:7
override bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
Определения WeaponChamberingLooped.c:250
ref WeaponEjectCasing m_eject
Определения RifleChambering.c:8
ref InventoryLocation m_srcMagazinePrevLocation
source of the cartridge
Определения WeaponChambering.c:378
override void OnAbort(WeaponEventBase e)
Определения WeaponChamberingLooped.c:170
void WeaponEjectCasing(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
int m_endActionType
Определения WeaponChambering.c:934
void LoopedChambering(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
Определения WeaponChamberingLooped.c:27
override void OnExit(WeaponEventBase e)
Определения WeaponChamberingLooped.c:111
override bool SaveCurrentFSMState(ParamsWriteContext ctx)
Определения WeaponChamberingLooped.c:230
represent weapon state base
Определения BulletHide.c:2
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
Определения EnConvert.c:106
Serializer ParamsReadContext
Определения gameplay.c:15
Serializer ParamsWriteContext
Определения gameplay.c:16
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90
proto void Print(void var)
Prints content of variable to console/log.
WeaponActions
actions
Определения human.c:816