23 ref LoopedChambering_Wait4ShowBullet2
m_w4sb2;
25 ref BulletHide_W4T m_hideB;
27 void LoopedChambering (
Weapon_Base w = NULL,
WeaponStateBase parent = NULL, WeaponActions action = WeaponActions.NONE,
int startActionType = -1,
int endActionType = -1)
38 m_hideB =
new BulletHide_W4T(
m_weapon,
this);
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;
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())));
83 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
95 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering, error - cannot remove ammo pile from inv");
101 Print(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering m_srcMagazine = NULL");
119 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
120 if (leftHandIl.IsValid())
130 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
142 if(!il || !il.IsValid())
144 if (DayZPlayerUtils.HandleDropMagazine(e.m_player,
m_srcMagazine))
146 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering, ok - no inventory space for ammo pile - dropped to ground - exit"); }
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");
159 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering, error - cannot remove ammo pile from wpn - exit");
178 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
179 if (leftHandIl.IsValid())
189 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
201 if(!il || !il.IsValid())
203 if (DayZPlayerUtils.HandleDropMagazine(e.m_player,
m_srcMagazine))
205 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering, ok - no inventory space for ammo pile - dropped to ground - abort"); }
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");
215 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
218 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering, error - cannot remove ammo pile from wpn - abort");
232 if (!super.SaveCurrentFSMState(ctx))
237 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" +
m_weapon);
243 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" +
m_weapon);
252 if (!super.LoadCurrentFSMState(ctx, version))
257 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" +
m_weapon);
263 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" +
m_weapon);
280 ref LoopedChambering_Wait4ShowBullet2
m_w4sb2;
282 ref BulletHide_W4T m_hideB;
283 ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag;
286 void LoopedChamberingEjectLast (
Weapon_Base w = NULL,
WeaponStateBase parent = NULL, WeaponActions action = WeaponActions.NONE,
int startActionType = -1,
int endActionType = -1)
295 m_mag =
new WeaponChambering_InternalMagazine_OnExit(
m_weapon,
this);
297 m_hideB =
new BulletHide_W4T(
m_weapon,
this);
298 m_chamberFromInnerMag =
new WeaponChamberFromInnerMag_W4T(
m_weapon,
this);
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;
315 m_fsm.AddTransition(
new WeaponTransition(m_mag, __bM_,
m_w4sb2, NULL,
new GuardAnd(
new GuardAnd(
new WeaponGuardHasAmmoInLoopedState(m_mag),
new WeaponGuardInternalMagazineHasRoomForBullet(
m_weapon)),
new WeaponGuardWeaponManagerWantContinue())));
326 m_fsm.AddTransition(
new WeaponTransition(m_chamberFromInnerMag, _fin_, NULL));
335 m_fsm.SetInitialState(
m_start);
346 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
358 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot remove ammo pile from inv");
364 Print(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast m_srcMagazine = NULL");
382 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
383 if (leftHandIl.IsValid())
393 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
405 if (!il || !il.IsValid())
407 if (DayZPlayerUtils.HandleDropMagazine(e.m_player,
m_srcMagazine))
409 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - exit"); }
412 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
419 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - exit"); }
422 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - exit");
430 m_mag.m_srcMagazine = NULL;
441 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
442 if (leftHandIl.IsValid())
452 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
464 if (!il || !il.IsValid())
466 if (DayZPlayerUtils.HandleDropMagazine(e.m_player,
m_srcMagazine))
468 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - abort"); }
471 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
478 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
481 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - abort");
489 m_mag.m_srcMagazine = NULL;
495 if (!super.SaveCurrentFSMState(ctx))
500 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" +
m_weapon);
506 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" +
m_weapon);
514 if (!super.LoadCurrentFSMState(ctx, version))
519 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" +
m_weapon);
525 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" +
m_weapon);
532class LoopedChamberingCombineChamberInternalMagazine
extends WeaponStateBase
542 ref LoopedChambering_Wait4ShowBullet2
m_w4sb2;
544 ref BulletHide_W4T m_hideB;
545 ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag;
551 void LoopedChamberingCombineChamberInternalMagazine (
Weapon_Base w = NULL,
WeaponStateBase parent = NULL, WeaponActions action = WeaponActions.NONE,
int startActionType = -1,
int endActionType = -1)
560 m_mag =
new WeaponChambering_InternalMagazine_OnExit(
m_weapon,
this);
562 m_hideB =
new BulletHide_W4T(
m_weapon,
this);
563 m_chamberFromInnerMag =
new WeaponChamberFromInnerMag_W4T(
m_weapon,
this);
567 WeaponEventContinuousLoadBulletStart __lS_ =
new WeaponEventContinuousLoadBulletStart;
568 WeaponEventContinuousLoadBulletEnd __lE_ =
new WeaponEventContinuousLoadBulletEnd;
569 WeaponEventAnimCocked __wc_ =
new WeaponEventAnimCocked;
570 WeaponEventAnimBulletShow __bs_ =
new WeaponEventAnimBulletShow;
571 WeaponEventAnimBulletHide __bh_ =
new WeaponEventAnimBulletHide;
572 WeaponEventAnimBulletEject __be_ =
new WeaponEventAnimBulletEject;
573 WeaponEventAnimBulletInMagazine __bM_ =
new WeaponEventAnimBulletInMagazine;
574 WeaponEventAnimBulletInChamber __bc_ =
new WeaponEventAnimBulletInChamber;
575 WeaponEventAnimBulletShow2 _bs2_ =
new WeaponEventAnimBulletShow2;
581 m_fsm.AddTransition(
new WeaponTransition(m_mag, __bM_,
m_w4sb2, NULL,
new GuardAnd(
new GuardAnd(
new WeaponGuardHasAmmoInLoopedState(m_mag),
new WeaponGuardInternalMagazineHasRoomForBullet(
m_weapon)),
new WeaponGuardWeaponManagerWantContinue())));
582 m_fsm.AddTransition(
new WeaponTransition(
m_chamber, __bc_,
m_w4sb2, NULL,
new GuardAnd(
new GuardAnd(
new WeaponGuardHasAmmoInLoopedState(
m_chamber),
new WeaponGuardInternalMagazineHasRoomForBullet(
m_weapon)),
new WeaponGuardWeaponManagerWantContinue())));
600 m_fsm.SetInitialState(
m_start);
611 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
623 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot remove ammo pile from inv");
630 Print(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast m_srcMagazine = NULL");
648 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
649 if (leftHandIl.IsValid())
659 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
671 if (!il || !il.IsValid())
673 if (DayZPlayerUtils.HandleDropMagazine(e.m_player,
m_srcMagazine))
675 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - exit"); }
678 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
685 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - exit"); }
688 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - exit");
697 m_mag.m_srcMagazine = NULL;
708 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
709 if (leftHandIl.IsValid())
719 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
731 if (!il || !il.IsValid())
733 if (DayZPlayerUtils.HandleDropMagazine(e.m_player,
m_srcMagazine))
735 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - abort"); }
738 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
745 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
748 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - abort");
757 m_mag.m_srcMagazine = NULL;
763 if (!super.SaveCurrentFSMState(ctx))
768 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" +
m_weapon);
774 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" +
m_weapon);
782 if (!super.LoadCurrentFSMState(ctx, version))
787 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" +
m_weapon);
793 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" +
m_weapon);
void wpnDebugPrint(string s)
script counterpart to engine's class Inventory
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...
provides access to slot configuration
Serialization general interface. Serializer API works with:
signalize mechanism manipulation
weapon finite state machine
simple class starting animation action specified by m_action and m_actionType
represent weapon state base
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
HandStateEquipped OnEntry
FindInventoryLocationType
flags for searching locations in inventory
bool OptionalLocationReadFromContext(out InventoryLocation loc, notnull ParamsReadContext ctx)
bool OptionalLocationWriteToContext(InventoryLocation loc, notnull ParamsWriteContext ctx)
enum FSMTransition WeaponTransition
ref LoopedChambering_Wait4ShowBullet2 m_w4sb2
class WeaponChambering extends WeaponStateBase IsWaitingForActionFinish
ref InventoryLocation m_srcMagazinePrevLocation
source of the cartridge
ref WeaponEndAction m_endLoop
ref WeaponStateBase m_start
class WeaponChambering_Chamber_OnEntry extends WeaponChambering_Base OnExit
class WeaponEndAction extends WeaponStartAction m_action
override bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
ref WeaponChambering_Base m_chamber
ref WeaponEjectCasingMultiMuzzle m_eject
override bool SaveCurrentFSMState(ParamsWriteContext ctx)