347 {
349
352
353 if (weapon)
354 {
355 weapon.UpdateCoolDown(dt);
356 if (hcw && weapon.CanProcessWeaponEvents())
357 {
358
359 weapon.GetCurrentState().OnUpdate(dt);
360
362 {
364 }
365
366 if (!weapon.IsIdle())
367 {
368 while (true)
369 {
370 int weaponEventId = hcw.
IsEvent();
371 if (weaponEventId == -1)
372 {
373 break;
374 }
375
377 {
378 break;
379 }
380
382
384 {
385 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" HandleWeapons: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
386 }
387
388 if (anim_event != NULL)
389 {
390 weapon.ProcessWeaponEvent(anim_event);
391 }
392 }
393
395 {
396 if (weapon.IsWaitingForActionFinish())
397 {
399 {
400 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: finished! notifying waiting state=" + weapon.GetCurrentState());
401 }
402
403 weapon.ProcessWeaponEvent(
new WeaponEventHumanCommandActionFinished(
GetDayZPlayerOwner()));
404 }
405 else
406 {
408 {
409 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: ABORT! notifying running state=" + weapon.GetCurrentState());
410 }
411
412 weapon.ProcessWeaponAbortEvent(
new WeaponEventHumanCommandActionAborted(
GetDayZPlayerOwner()));
413 }
414 }
415 }
416
418 {
420 {
422 }
423
425 {
426 exitIronSights = true;
427
429 {
431 }
432
435 }
437 {
439 }
440 }
441 }
442 }
443 }
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)