349 {
351
354
355 if (weapon)
356 {
357 weapon.UpdateCoolDown(dt);
358 if (hcw && weapon.CanProcessWeaponEvents())
359 {
360
361 weapon.GetCurrentState().OnUpdate(dt);
362
364 {
366 }
367
368 if (!weapon.IsIdle())
369 {
370 while (true)
371 {
372 int weaponEventId = hcw.
IsEvent();
373 if (weaponEventId == -1)
374 {
375 break;
376 }
377
379 {
380 break;
381 }
382
384
386 {
387 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" HandleWeapons: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
388 }
389
390 if (anim_event != NULL)
391 {
392 weapon.ProcessWeaponEvent(anim_event);
393 }
394 }
395
397 {
398 if (weapon.IsWaitingForActionFinish())
399 {
401 {
402 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: finished! notifying waiting state=" + weapon.GetCurrentState());
403 }
404
405 weapon.ProcessWeaponEvent(
new WeaponEventHumanCommandActionFinished(
GetDayZPlayerOwner()));
406 }
407 else
408 {
410 {
411 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: ABORT! notifying running state=" + weapon.GetCurrentState());
412 }
413
414 weapon.ProcessWeaponAbortEvent(
new WeaponEventHumanCommandActionAborted(
GetDayZPlayerOwner()));
415 }
416 }
417 }
418
420 {
422 {
424 }
425
427 {
428 exitIronSights = true;
429
431 {
433 }
434
437 }
439 {
441 }
442 }
443 }
444 }
445 }
void wpnDebugSpamALot(string s)
void wpnDebugPrint(string s)
ref WeaponEventBase m_DeferredWeaponEvent
deferred hand event
DayZPlayer GetDayZPlayerOwner()
ref Timer m_DeferredWeaponTimer
WeaponEventBase WeaponAnimEventFactory(WeaponEvents type, DayZPlayer p=NULL, Magazine m=NULL)
creates animation system events
void fsmDebugSpam(string s)
Super root of all classes in Enforce script.
proto native bool IsActionFinished()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
proto native int IsEvent()
return -1 when there is no event, otherwise it returns pId of event from animation
proto native int GetRunningActionType()
returns -1 when no action is running or appropriate action type
static bool IsWeaponLogEnable()
signalize mechanism manipulation
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
string WeaponActionTypeToString(int A, int AT)