346 {
348
351
352 if (weapon)
353 {
354 weapon.UpdateCoolDown(dt);
355 if (hcw && weapon.CanProcessWeaponEvents())
356 {
357
358 weapon.GetCurrentState().OnUpdate(dt);
359
361 {
363 }
364
365 if (!weapon.IsIdle())
366 {
367 while (true)
368 {
369 int weaponEventId = hcw.
IsEvent();
370 if (weaponEventId == -1)
371 {
372 break;
373 }
374
376 {
377 break;
378 }
379
381
383 {
384 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" HandleWeapons: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
385 }
386
387 if (anim_event != NULL)
388 {
389 weapon.ProcessWeaponEvent(anim_event);
390 }
391 }
392
394 {
395 if (weapon.IsWaitingForActionFinish())
396 {
398 {
399 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: finished! notifying waiting state=" + weapon.GetCurrentState());
400 }
401
402 weapon.ProcessWeaponEvent(
new WeaponEventHumanCommandActionFinished(
GetDayZPlayerOwner()));
403 }
404 else
405 {
407 {
408 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: ABORT! notifying running state=" + weapon.GetCurrentState());
409 }
410
411 weapon.ProcessWeaponAbortEvent(
new WeaponEventHumanCommandActionAborted(
GetDayZPlayerOwner()));
412 }
413 }
414 }
415
417 {
419 {
421 }
422
424 {
425 exitIronSights = true;
426
428 {
430 }
431
434 }
436 {
438 }
439 }
440 }
441 }
442 }
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)