42 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine");
48 m_oldMagazine.GetInventory().GetCurrentInventoryLocation(oldSrc);
55 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot remove old mag from wpn");
67 if (!super.SaveCurrentFSMState(ctx))
72 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_oldMagazine for weapon=" +
m_weapon);
79 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" +
m_weapon);
88 if (!super.LoadCurrentFSMState(ctx, version))
93 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_oldMagazine for weapon=" +
m_weapon);
99 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" +
m_weapon);
123 Magazine m_newMagazine;
148 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine, error - cannot remove new mag from LHand");
173 if (!super.SaveCurrentFSMState(ctx))
178 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" +
m_weapon);
184 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" +
m_weapon);
193 if (!super.LoadCurrentFSMState(ctx, version))
198 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" +
m_weapon);
203 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" +
m_weapon);
216 Magazine m_newMagazine;
238 if (
m_newMagazine.GetInventory().GetCurrentInventoryLocation(il))
253 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine, error - cannot get curr location");
256 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine, error - no magazines configured for replace (m_new=NULL)");
269 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store, error - cannot abort detaching of magazine");
290 if (!super.SaveCurrentFSMState(ctx))
295 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" +
m_weapon);
301 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" +
m_weapon);
309 if (!super.LoadCurrentFSMState(ctx, version))
314 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" +
m_weapon);
319 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" +
m_weapon);
348 ref WeaponChamberFromAttMag_W4T
m_chamber;
349 ref WeaponCharging_CK
m_onCK;
410 WeaponEventSwapMagazine se;
413 int mi =
m_weapon.GetCurrentMuzzle();
423 if (!
m_newMagazine.GetInventory().GetCurrentInventoryLocation(newSrc))
427 if (!
m_oldMagazine.GetInventory().GetCurrentInventoryLocation(oldSrc))
441 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory, error - cannot new remove mag from inv");
460 Magazine mag = Magazine.Cast(leftHandItem);
480 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine - exit");
486 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
493 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot remove old mag from wpn - exit");
507 Magazine mag = Magazine.Cast(leftHandItem);
527 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine - abort");
533 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
540 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot remove old mag from wpn - abort");
547 if (!super.SaveCurrentFSMState(ctx))
552 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" +
m_weapon);
558 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_oldMagazine for weapon=" +
m_weapon);
564 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" +
m_weapon);
573 if (!super.LoadCurrentFSMState(ctx, version))
578 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" +
m_weapon);
583 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_oldMagazine for weapon=" +
m_weapon);
590 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" +
m_weapon);
void wpnDebugPrint(string s)
void DayZPlayerUtils()
cannot be instantiated
void WeaponGuardHasAmmo(Weapon_Base w=NULL)
FindInventoryLocationType
flags for searching locations in inventory
bool OptionalLocationReadFromContext(out InventoryLocation loc, notnull ParamsReadContext ctx)
InventoryLocationType
types of Inventory Location
bool OptionalLocationWriteToContext(InventoryLocation loc, notnull ParamsWriteContext ctx)
enum FSMTransition WeaponTransition
ref WeaponStateBase m_start
class WeaponEndAction extends WeaponStartAction m_action
attach mag in LH into weapon
Super root of all classes in Enforce script.
detaches old magazine from weapon and stores it in left hand (LH)
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...
script counterpart to engine's class Inventory
proto native bool IsValid()
verify current set inventory location
static string DumpToStringNullSafe(InventoryLocation loc)
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
sets current inventory location type to Attachment with slot id set to <slotId>
proto native void SetItem(notnull EntityAI item)
provides access to slot configuration
static bool IsWeaponLogEnable()
hides old magazine, but keep it in LH
proto bool Write(void value_out)
proto bool Read(void value_in)
old magazine to inventory, new to left hand
signalize mechanism manipulation
weapon finite state machine
replace current magazine with new one
simple class starting animation action specified by m_action and m_actionType
void AttachNewMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
ref OldMagazineHide m_hideOld
int m_actionType
action to be played
void WeaponStateBase(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
internal state id used for load/restore
ref DetachOldMagazine m_detach
void WeaponStartAction(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
specific action sub-type
ref WeaponFSM m_fsm
hierarchical parent state of this state (or null)
void DetachOldMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
ref AttachNewMagazine m_attach
ref WeaponChambering_Cartridge m_chamber
override bool IsWaitingForActionFinish()
override void OnEntry(WeaponEventBase e)
ref SwapOldAndNewMagazine m_swapMags
ref WeaponCharging_CK m_onCK
ref WeaponStateBase m_start
source of the cartridge
ref InventoryLocation m_newDst
magazine that will be detached
override bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
ref WeaponEjectCasing m_eject
void WeaponReplacingMagAndChamberNext(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
override void OnAbort(WeaponEventBase e)
Magazine m_newMagazine
magazine that will be detached
void WeaponEjectCasing(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
override void OnExit(WeaponEventBase e)
override bool SaveCurrentFSMState(ParamsWriteContext ctx)
represent weapon state base
Serializer ParamsReadContext
Serializer ParamsWriteContext
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.