23 ref LoopedChambering_Wait4ShowBullet2
m_w4sb2;
25 ref BulletHide_W4T m_hideB;
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;
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);
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);
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");
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;
295 m_mag =
new WeaponChambering_InternalMagazine_OnExit(
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())));
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);
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");
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);
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");
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;
548 ref WeaponChambering_Base m_mag;
560 m_mag =
new WeaponChambering_InternalMagazine_OnExit(
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())));
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);
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");
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);
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");
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)
void DayZPlayerUtils()
cannot be instantiated
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
ref InventoryLocation m_srcMagazinePrevLocation
source of the cartridge
ref WeaponEndAction m_endLoop
ref WeaponStateBase m_start
class WeaponEndAction extends WeaponStartAction m_action
ref WeaponChambering_Base m_chamber
ref WeaponEjectCasingMultiMuzzle m_eject
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...
script counterpart to engine's class Inventory
proto native bool IsValid()
verify current set inventory location
proto native vector GetPos()
returns position of item in world if type is Ground
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
sets current inventory location type to Attachment with slot id set to <slotId>
provides access to slot configuration
static bool IsWeaponLogEnable()
proto bool Write(void value_out)
proto bool Read(void value_in)
signalize mechanism manipulation
weapon finite state machine
const float MAX_DROP_MAGAZINE_DISTANCE_SQ
override bool IsWaitingForActionFinish()
simple class starting animation action specified by m_action and m_actionType
ref BulletHide_W4T m_hideB
ref WeaponChambering_Base m_mag
ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag
void WeaponStateBase(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
internal state id used for load/restore
void LoopedChamberingEjectLast(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
ref WeaponStartAction m_endLoop
Magazine m_srcMagazine
destination of the ejected cartridge
ref WeaponFSM m_fsm
hierarchical parent state of this state (or null)
ref LoopedChambering_Wait4ShowBullet2 m_w4sb2
ref WeaponChambering_Cartridge m_chamber
override bool IsWaitingForActionFinish()
waiting for active animation action/actionType finish
override void OnEntry(WeaponEventBase e)
ref WeaponStateBase m_start
source of the cartridge
override bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
ref WeaponEjectCasing m_eject
ref InventoryLocation m_srcMagazinePrevLocation
source of the cartridge
override void OnAbort(WeaponEventBase e)
void WeaponEjectCasing(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
void LoopedChamberingCombineChamberInternalMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
void LoopedChambering(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
override void OnExit(WeaponEventBase e)
override bool SaveCurrentFSMState(ParamsWriteContext ctx)
represent weapon state base
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
Serializer ParamsReadContext
Serializer ParamsWriteContext
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.