DayZ 1.24
Loading...
Searching...
No Matches
WeaponStateBase Class Reference

represent weapon state base More...

Collaboration diagram for WeaponStateBase:
[legend]

Private Member Functions

override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
void RifleChambering (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void RifleEjectCasing (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
void RifleReChambering (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void RemoveNewMagazineFromInventory (Weapon_Base w=NULL, WeaponStateBase parent=NULL)
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void WeaponAttachMagazine (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
void WeaponChamberFromAttMag (Weapon_Base w=NULL, WeaponStateBase parent=NULL, int action=-1, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
void WeaponChamberFromInnerMag (Weapon_Base w=NULL, WeaponStateBase parent=NULL, int action=-1, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
void WeaponChamberFromAttMagOnExit (Weapon_Base w=NULL, WeaponStateBase parent=NULL, int action=-1, int actionType=-1)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 source of the cartridge
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
override bool IsWaitingForActionFinish ()
 waiting for active animation action/actionType finish
 
void WeaponChambering (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
bool FindNextFreeMuzzle (int currentMuzzle, out int nextMuzzle)
 
override void OnEntry (WeaponEventBase e)
 
void WeaponMagnumChambering (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
override bool IsWaitingForActionFinish ()
 
void LoopedChambering (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void LoopedChamberingEjectLast (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void WeaponCharging (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override bool IsWaitingForActionFinish ()
 
override void OnEntry (WeaponEventBase e)
 
override void OnEntry (WeaponEventBase e)
 destination of the cartridge
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
override void OnEntry (WeaponEventBase e)
 destination of the cartridge
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void WeaponChargingInnerMag (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
void WeaponChargingMultiple (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
void WeaponChargingStretch (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void WeaponDetachingMag (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void WeaponEjectBullet (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void WeaponEjectCasing (Weapon_Base w=NULL, WeaponStateBase parent=NULL)
 
override void OnEntry (WeaponEventBase e)
 
void WeaponEjectCasingMultiMuzzle (Weapon_Base w=NULL, WeaponStateBase parent=NULL)
 
override void OnEntry (WeaponEventBase e)
 
override bool IsWaitingForActionFinish ()
 
void WeaponEjectAllMuzzles (Weapon_Base w=NULL, WeaponStateBase parent=NULL)
 
override void OnEntry (WeaponEventBase e)
 
override bool IsWaitingForActionFinish ()
 
void WeaponFireAndChamberNext (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnUpdate (float dt)
 
override void OnExit (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
void WeaponFireAndChamberNextFromInnerMag (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnUpdate (float dt)
 
override void OnExit (WeaponEventBase e)
 
void WeaponFireLast (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
void WeaponRechamber (Weapon_Base w=NULL, WeaponStateBase parent=NULL, int actionEject=-1, int actionTypeEject=-1, int actionLoad=-1, int actionTypeLoad=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void DetachOldMagazine (Weapon_Base w=NULL, WeaponStateBase parent=NULL)
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void AttachNewMagazine (Weapon_Base w=NULL, WeaponStateBase parent=NULL)
 
override bool IsWaitingForActionFinish ()
 
override void OnEntry (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
override bool IsWaitingForActionFinish ()
 
void WeaponReplacingMagAndChamberNext (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
void WeaponStartAction (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 specific action sub-type
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
void WeaponStateBase (Weapon_Base w=NULL, WeaponStateBase parent=NULL)
 internal state id used for load/restore
 
void SetParentState (WeaponStateBase parent)
 allows construction of hierarchical state machine
 
WeaponStateBase GetParentState ()
 
bool HasFSM ()
 
WeaponFSM GetFSM ()
 
void SetInternalStateID (int i)
 
int GetInternalStateID ()
 
bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
bool ProcessEvent (WeaponEventBase e)
 
void AddTransition (WeaponTransition t)
 adds transition into m_fsm transition table
 
void OnEntry (WeaponEventBase e)
 
void OnUpdate (float dt)
 
void OnAbort (WeaponEventBase e)
 
void OnExit (WeaponEventBase e)
 
bool IsWaitingForActionFinish ()
 
bool IsIdle ()
 idle state does not expect any animation events
 
bool IsBoltOpen ()
 
void OnSubMachineChanged (WeaponStateBase src, WeaponStateBase dst)
 called when sub-machine has changed its state
 
void OnStateChanged (WeaponStateBase src, WeaponStateBase dst)
 called on current state when state machine has changed its state
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 
override bool SaveCurrentFSMState (ParamsWriteContext ctx)
 
override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
override bool IsWaitingForActionFinish ()
 
void WeaponUnjamming (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnExit (WeaponEventBase e)
 

Private Attributes

WeaponActions m_action
 
int m_actionType
 action to be played
 
Magazine m_srcMagazine
 destination of the ejected cartridge
 
ref WeaponStateBase m_start
 source of the cartridge
 
ref WeaponEjectCasing m_eject
 
ref WeaponChambering_Cartridge m_chamber
 
ref WeaponChambering_W4T m_w4t
 
ref WeaponStartAction m_start
 
ref BulletHide_W4T m_hideB
 
Magazine m_dstMagazine
 
ref WeaponEjectBullet_Cartridge m_eject
 
Magazine m_newMagazine
 magazine that will be detached
 
ref InventoryLocation m_newSrc
 magazine that will be removed from inventory
 
ref AttachNewMagazine m_attach
 
ref WeaponChamberFromAttMag_W4T m_chamber
 
ref WeaponCharging_CK m_onCK
 
float m_damage
 
string m_type
 
string m_magazineType
 
ref InventoryLocation m_srcMagazinePrevLocation
 source of the cartridge
 
int m_startActionType
 
int m_endActionType
 
ref WeaponEjectAllMuzzles m_eject
 
ref WeaponCylinderRotate m_rotate
 
ref WeaponChambering_Base m_chamber
 
ref LoopedChambering_Wait4ShowBullet2 m_w4sb2
 
ref WeaponStartAction m_endLoop
 
ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag
 
ref WeaponCharging_Start m_start
 
ref WeaponEjectAndChamberFromAttMag m_ejectChamber
 
ref WeaponEjectBullet_Cartridge_W4T m_onBE
 
ref WeaponEjectCasing_W4T m_onBEFireOut
 
ref WeaponChamberFromInnerMag_W4T m_chamber
 
Magazine m_magazine
 
ref InventoryLocation m_dst
 magazine that will be detached
 
ref WeaponDetachingMag_Store m_store
 
ref MagazineHide_W4T m_hideM
 
ref WeaponEjectBullet_Start m_start
 destination of the cartridge
 
ref WeaponEjectBullet_Cartridge_W4T m_eject
 
float m_dtAccumulator
 
ref WeaponFire m_fire
 
ref WeaponFireWithEject m_fire
 
int m_actionEject
 
int m_actionTypeEject
 
int m_actionLoad
 
int m_actionTypeLoad
 
ref WeaponEjectBullet m_eje
 source of the loaded cartridge
 
ref WeaponChambering m_loa
 
Magazine m_oldMagazine
 
ref InventoryLocation m_newDst
 magazine that will be detached
 
ref DetachOldMagazine m_detach
 
ref OldMagazineHide m_hideOld
 
ref SwapOldAndNewMagazine m_swapMags
 
ref AttachNewMagazine_W4T m_attach
 
Weapon_Base m_weapon
 
WeaponStateBase m_parentState
 weapon that this state relates to
 
ref WeaponFSM m_fsm
 hierarchical parent state of this state (or null)
 
int m_InternalID = -1
 nested state machine (or null)
 
float m_jamTime
 
ref WeaponUnjamming_Start m_start
 
ref WeaponUnjamming_Cartridge_W4T m_eject
 
ref WeaponUnjamming_W4T m_w4t
 

Detailed Description

represent weapon state base

Class comes with entry/update/abort/exit hooks that can be overriden in custom states

Class is ready for hierarchic composition, i.e. this state having a sub-machine running under hood. If no m_fsm member is configured, class acts as ordinary plain finite machine state.

Definition at line 1 of file BulletHide.c.

Constructor & Destructor Documentation

◆ WeaponStateBase()

void WeaponStateBase::WeaponStateBase ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate

internal state id used for load/restore

Definition at line 17 of file WeaponStateBase.c.

17{ m_weapon = w; m_parentState = parent; }
WeaponStateBase m_parentState
weapon that this state relates to
Weapon_Base m_weapon

References m_parentState, and m_weapon.

Member Function Documentation

◆ AddTransition()

WeaponStateBase::AddTransition ( WeaponTransition t)
inlineprivate

adds transition into m_fsm transition table

Definition at line 89 of file WeaponStateBase.c.

90 {
91 if (HasFSM())
92 m_fsm.AddTransition(t);
93 else
94 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " adding transition to state without FSM. Configure FSM first.");
95 }
ref WeaponFSM m_fsm
hierarchical parent state of this state (or null)
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), HasFSM(), m_fsm, and m_weapon.

◆ AttachNewMagazine()

void WeaponStateBase::AttachNewMagazine ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate

Definition at line 217 of file WeaponReplacingMagAndChamberNext.c.

218 {
220 m_newDst = NULL;
221 }
ref InventoryLocation m_newDst
magazine that will be detached
Magazine m_newMagazine
magazine that will be detached

Referenced by WeaponAttachMagazine().

◆ DetachOldMagazine()

void WeaponStateBase::DetachOldMagazine ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate

Definition at line 10 of file WeaponReplacingMagAndChamberNext.c.

References m_oldMagazine.

◆ FindNextFreeMuzzle()

bool WeaponStateBase::FindNextFreeMuzzle ( int currentMuzzle,
out int nextMuzzle )
inlineprivate

Definition at line 880 of file WeaponChambering.c.

881 {
883 int nMuzzles = m_weapon.GetMuzzleCount();
884
885 for (int i = 0; i < nMuzzles; ++i)
886 {
887 --nextMuzzle;
889 if (m_weapon.IsChamberEmpty(nextMuzzle))
890 return true;
891 }
892
893 return false;
894 }
Definition EnMath.c:7
static proto int WrapInt(int i, int min, int max)
Returns wrap number to specified interval [min, max[.

References m_weapon, and Math::WrapInt().

◆ GetFSM()

WeaponFSM WeaponStateBase::GetFSM ( )
inlineprivate

Definition at line 29 of file WeaponStateBase.c.

29{ return m_fsm; }

References m_fsm.

◆ GetInternalStateID()

int WeaponStateBase::GetInternalStateID ( )
inlineprivate

Definition at line 32 of file WeaponStateBase.c.

32{ return m_InternalID; }
int m_InternalID
nested state machine (or null)

References m_InternalID.

◆ GetParentState()

WeaponStateBase::GetParentState ( )
inlineprivate
Returns
state that owns this sub-state (or null if plain state)

Definition at line 26 of file WeaponStateBase.c.

26{ return m_parentState; }

References m_parentState.

◆ HasFSM()

bool WeaponStateBase::HasFSM ( )
inlineprivate

◆ IsBoltOpen()

WeaponStateBase::IsBoltOpen ( )
inlineprivate
Returns
true if weapon bolt is open

Definition at line 162 of file WeaponStateBase.c.

162{ return false; }

◆ IsIdle()

WeaponStateBase::IsIdle ( )
inlineprivate

idle state does not expect any animation events

Returns
true if this state is idle

Definition at line 157 of file WeaponStateBase.c.

157{ return false; }

Referenced by LoadCurrentFSMState(), and SaveCurrentFSMState().

◆ IsWaitingForActionFinish() [1/9]

WeaponStateBase::IsWaitingForActionFinish ( )
inlineprivate

waiting for active animation action/actionType finish

Returns
true if this state or active substate is waiting for finish signal

Definition at line 359 of file WeaponChambering.c.

359{ return true; }

◆ IsWaitingForActionFinish() [2/9]

override bool WeaponStateBase::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 9 of file WeaponChamberingLooped.c.

9{ return false; }

◆ IsWaitingForActionFinish() [3/9]

override bool WeaponStateBase::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 70 of file WeaponCharging.c.

70{ return true; }

◆ IsWaitingForActionFinish() [4/9]

override bool WeaponStateBase::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 43 of file WeaponEjectCasingAndChamberFromAttMag.c.

44 {
45 return false;
46 }

◆ IsWaitingForActionFinish() [5/9]

override bool WeaponStateBase::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 117 of file WeaponEjectCasingAndChamberFromAttMag.c.

118 {
119 return false;
120 }

◆ IsWaitingForActionFinish() [6/9]

override bool WeaponStateBase::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 223 of file WeaponReplacingMagAndChamberNext.c.

224 {
225 return true;
226 }

◆ IsWaitingForActionFinish() [7/9]

override bool WeaponStateBase::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 326 of file WeaponReplacingMagAndChamberNext.c.

326{ return true; }

◆ IsWaitingForActionFinish() [8/9]

bool WeaponStateBase::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 151 of file WeaponStateBase.c.

151{ return HasFSM() && m_fsm.IsRunning() && m_fsm.GetCurrentState().IsWaitingForActionFinish(); }

References HasFSM(), and m_fsm.

◆ IsWaitingForActionFinish() [9/9]

override bool WeaponStateBase::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 161 of file WeaponUnjamming.c.

161{ return true; }

◆ LoadCurrentFSMState() [1/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 87 of file RifleChambering.c.

88 {
89 if (!super.LoadCurrentFSMState(ctx, version))
90 return false;
91
92 if (!ctx.Read(m_srcMagazine))
93 {
94 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RifleChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
95 return false;
96 }
97 return true;
98 }
Magazine m_srcMagazine
destination of the ejected cartridge

References Error(), m_srcMagazine, and m_weapon.

◆ LoadCurrentFSMState() [2/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 104 of file RifleReChambering.c.

105 {
106 if (!super.LoadCurrentFSMState(ctx, version))
107 return false;
108
109 if (!ctx.Read(m_dstMagazine))
110 {
111 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber.LoadCurrentFSMState: cannot read m_dstMagazine for weapon=" + m_weapon);
112 return false;
113 }
114 if (!ctx.Read(m_srcMagazine))
115 {
116 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
117 return false;
118 }
119 return true;
120 }

References Error(), m_srcMagazine, and m_weapon.

◆ LoadCurrentFSMState() [3/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 82 of file WeaponAttachMagazine.c.

83 {
84 if (!super.LoadCurrentFSMState(ctx, version))
85 return false;
86
87 if (!ctx.Read(m_newMagazine))
88 {
89 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" + m_weapon);
90 return false;
91 }
92
94 {
95 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory.LoadCurrentFSMState: cannot read m_newSrc for weapon=" + m_weapon);
96 return false;
97 }
98 return true;
99 }
bool OptionalLocationReadFromContext(out InventoryLocation loc, notnull ParamsReadContext ctx)
ref InventoryLocation m_newSrc
magazine that will be removed from inventory

References Error(), m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [4/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 55 of file WeaponChambering.c.

56 {
57 if (!super.LoadCurrentFSMState(ctx, version))
58 return false;
59
60 if (!ctx.Read(m_damage))
61 {
62 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_damage for weapon=" + m_weapon);
63 return false;
64 }
65 if (!ctx.Read(m_type))
66 {
67 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_type for weapon=" + m_weapon);
68 return false;
69 }
70 if (!ctx.Read(m_magazineType))
71 {
72 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_magazineType for weapon=" + m_weapon);
73 return false;
74 }
75 if (!ctx.Read(m_srcMagazine))
76 {
77 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
78 return false;
79 }
80 return true;
81 }

References Error(), m_srcMagazine, and m_weapon.

◆ LoadCurrentFSMState() [5/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 587 of file WeaponChambering.c.

588 {
589 if (!super.LoadCurrentFSMState(ctx, version))
590 return false;
591
592 if (!ctx.Read(m_srcMagazine))
593 {
594 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
595 return false;
596 }
597
599 {
600 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
601 return false;
602 }
603 return true;
604 }
ref InventoryLocation m_srcMagazinePrevLocation
source of the cartridge

References Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [6/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 1160 of file WeaponChambering.c.

1161 {
1162 if (!super.LoadCurrentFSMState(ctx, version))
1163 return false;
1164
1165 if (!ctx.Read(m_srcMagazine))
1166 {
1167 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
1168 return false;
1169 }
1170
1172 {
1173 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
1174 return false;
1175 }
1176 return true;
1177 }

References Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [7/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 246 of file WeaponChamberingLooped.c.

247 {
248 if (!super.LoadCurrentFSMState(ctx, version))
249 return false;
250
251 if (!ctx.Read(m_srcMagazine))
252 {
253 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
254 return false;
255 }
256
258 {
259 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
260 return false;
261 }
262 return true;
263 }

References Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [8/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 503 of file WeaponChamberingLooped.c.

504 {
505 if (!super.LoadCurrentFSMState(ctx, version))
506 return false;
507
508 if (!ctx.Read(m_srcMagazine))
509 {
510 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
511 return false;
512 }
513
515 {
516 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
517 return false;
518 }
519 return true;
520 }

References Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [9/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 120 of file WeaponCharging.c.

121 {
122 if (!super.LoadCurrentFSMState(ctx, version))
123 return false;
124
125 if (!ctx.Read(m_dstMagazine))
126 {
127 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponEjectBullet_Cartridge.LoadCurrentFSMState: cannot read m_dstMagazine for weapon=" + m_weapon);
128 return false;
129 }
130 return true;
131 }

References Error(), and m_weapon.

◆ LoadCurrentFSMState() [10/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 180 of file WeaponCharging.c.

181 {
182 if (!super.LoadCurrentFSMState(ctx, version))
183 return false;
184
185 if (!ctx.Read(m_dstMagazine))
186 {
187 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponEjectBullet_Cartridge.LoadCurrentFSMState: cannot read m_dstMagazine for weapon=" + m_weapon);
188 return false;
189 }
190 return true;
191 }

References Error(), and m_weapon.

◆ LoadCurrentFSMState() [11/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 73 of file WeaponDetachingMag.c.

74 {
75 if (!super.LoadCurrentFSMState(ctx, version))
76 return false;
77
78 if (!ctx.Read(m_magazine))
79 {
80 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store.LoadCurrentFSMState: cannot read m_magazine for weapon=" + m_weapon);
81 return false;
82 }
84 {
85 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store.LoadCurrentFSMState: cannot read m_dst for weapon=" + m_weapon);
86 return false;
87 }
88 return true;
89 }
ref InventoryLocation m_dst
magazine that will be detached

References Error(), m_dst, m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [12/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 179 of file WeaponDetachingMag.c.

180 {
181 if (!super.LoadCurrentFSMState(ctx, version))
182 return false;
183
184 if (!ctx.Read(m_magazine))
185 {
186 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag.LoadCurrentFSMState: cannot read m_magazine for weapon=" + m_weapon);
187 return false;
188 }
190 {
191 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag.LoadCurrentFSMState: cannot read m_dst for weapon=" + m_weapon);
192 return false;
193 }
194 return true;
195 }

References Error(), m_dst, m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [13/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 125 of file WeaponEjectBullet.c.

126 {
127 if (!super.LoadCurrentFSMState(ctx, version))
128 return false;
129
130 if (!ctx.Read(m_dstMagazine))
131 {
132 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponEjectBullet.LoadCurrentFSMState: cannot read m_dstMagazine for weapon=" + m_weapon);
133 return false;
134 }
135 return true;
136 }

References Error(), and m_weapon.

◆ LoadCurrentFSMState() [14/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 86 of file WeaponReChamber.c.

87 {
88 if (!super.LoadCurrentFSMState(ctx, version))
89 return false;
90
91 if (!ctx.Read(m_dstMagazine))
92 {
93 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_dstMagazine for weapon=" + m_weapon);
94 return false;
95 }
96 if (!ctx.Read(m_srcMagazine))
97 {
98 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
99 return false;
100 }
101 return true;
102 }

References Error(), m_srcMagazine, and m_weapon.

◆ LoadCurrentFSMState() [15/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 86 of file WeaponReplacingMagAndChamberNext.c.

87 {
88 if (!super.LoadCurrentFSMState(ctx, version))
89 return false;
90
91 if (!ctx.Read(m_oldMagazine))
92 {
93 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.LoadCurrentFSMState: cannot read m_oldMagazine for weapon=" + m_weapon);
94 return false;
95 }
96
98 {
99 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" + m_weapon);
100 return false;
101 }
102 return true;
103 }

References Error(), m_oldMagazine, m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [16/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 189 of file WeaponReplacingMagAndChamberNext.c.

190 {
191 if (!super.LoadCurrentFSMState(ctx, version))
192 return false;
193
194 if (!ctx.Read(m_newMagazine))
195 {
196 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " SwapOldAndNewMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" + m_weapon);
197 return false;
198 }
200 {
201 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " SwapOldAndNewMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" + m_weapon);
202 return false;
203 }
204
205 return true;
206 }

References Error(), m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [17/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 305 of file WeaponReplacingMagAndChamberNext.c.

306 {
307 if (!super.LoadCurrentFSMState(ctx, version))
308 return false;
309
310 if (!ctx.Read(m_newMagazine))
311 {
312 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " AttachNewMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" + m_weapon);
313 return false;
314 }
316 {
317 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " AttachNewMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" + m_weapon);
318 return false;
319 }
320 return true;
321 }

References Error(), m_weapon, and OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [18/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 565 of file WeaponReplacingMagAndChamberNext.c.

566 {
567 if (!super.LoadCurrentFSMState(ctx, version))
568 return false;
569
570 if (!ctx.Read(m_newMagazine))
571 {
572 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" + m_weapon);
573 return false;
574 }
575 if (!ctx.Read(m_oldMagazine))
576 {
577 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.LoadCurrentFSMState: cannot read m_oldMagazine for weapon=" + m_weapon);
578 return false;
579 }
581
582 if (!m_newDst.ReadFromContext(ctx))
583 {
584 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" + m_weapon);
585 return false;
586 }
587
588 return true;
589 }
InventoryLocation.

References Error(), m_oldMagazine, and m_weapon.

◆ LoadCurrentFSMState() [19/20]

bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 54 of file WeaponStateBase.c.

55 {
56 if (HasFSM())
57 {
58 if (IsIdle())
59 {
60 if (LogManager.IsWeaponLogEnable()) wpnDebugSpam("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponStateBase::LoadCurrentFSMState - idle state, skipping other substates");
61 if (m_fsm.LoadCurrentFSMState(ctx, version))
62 return true;
63 else
64 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponStateBase::LoadCurrentFSMState - Cannot load stable state for weapon=" + this);
65 }
66 else
67 {
68 // if parent state is !idle (unstable) then load whole machine
69 if (LogManager.IsWeaponLogEnable()) wpnDebugSpam("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponStateBase::LoadCurrentFSMState - NOT idle state, loading full submachine state");
70 if (m_fsm.LoadCurrentUnstableFSMState(ctx, version))
71 return true;
72 else
73 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponStateBase::LoadCurrentFSMState - Cannot load unstable state for weapon=" + this);
74 }
75 return false;
76 }
77 return true;
78 }
void wpnDebugSpam(string s)
Definition Debug.c:17
static bool IsWeaponLogEnable()
Definition Debug.c:799
bool IsIdle()
idle state does not expect any animation events

References Error(), HasFSM(), IsIdle(), LogManager::IsWeaponLogEnable(), m_fsm, m_weapon, and wpnDebugSpam().

◆ LoadCurrentFSMState() [20/20]

override bool WeaponStateBase::LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 134 of file WeaponUnjamming.c.

135 {
136 if (!super.LoadCurrentFSMState(ctx, version))
137 return false;
138
139 if (!ctx.Read(m_damage))
140 {
141 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponUnjamming_Cartridge.LoadCurrentFSMState: cannot read m_damage for weapon=" + m_weapon);
142 return false;
143 }
144 if (!ctx.Read(m_type))
145 {
146 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponUnjamming_Cartridge.LoadCurrentFSMState: cannot read m_type for weapon=" + m_weapon);
147 return false;
148 }
149 return true;
150 }

References Error(), and m_weapon.

◆ LoopedChambering()

void WeaponStateBase::LoopedChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int startActionType = -1,
int endActionType = -1 )
inlineprivate

Definition at line 27 of file WeaponChamberingLooped.c.

28 {
32
33 // setup nested state machine
38 m_hideB = new BulletHide_W4T(m_weapon, this);
39 m_endLoop = new LoopedChambering_EndLoop(m_weapon, this, m_action, m_endActionType); // @NOTE: termination playing action - dummy?
40 // events
41 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
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;
49
50 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
51 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
52 m_fsm.AddTransition(new WeaponTransition(m_start, __bs_, m_chamber));
53 m_fsm.AddTransition(new WeaponTransition(m_eject, __bs_, m_chamber));
54
55
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())));
57 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_endLoop));
58 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __bh_, m_hideB));
59 m_fsm.AddTransition(new WeaponTransition(m_hideB, __bs_, m_chamber));
60
61 m_fsm.AddTransition(new WeaponTransition(m_endLoop, _fin_, NULL));
62
63 // Safety exits
64 m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, null));
65 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, _fin_, null));
66 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
67 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, null));
68 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
69
70 m_fsm.SetInitialState(m_start);
71 }
enum FSMTransition WeaponTransition
signalize mechanism manipulation
Definition Events.c:35
weapon finite state machine
ref BulletHide_W4T m_hideB
ref WeaponStartAction m_endLoop
ref LoopedChambering_Wait4ShowBullet2 m_w4sb2
WeaponActions m_action
ref WeaponChambering_Cartridge m_chamber
ref WeaponStateBase m_start
source of the cartridge
ref WeaponEjectCasing m_eject
void WeaponEjectCasing(Weapon_Base w=NULL, WeaponStateBase parent=NULL)

References m_action, m_chamber, m_eject, m_endActionType, m_endLoop, m_start, m_startActionType, m_w4sb2, m_weapon, and WeaponEjectCasing().

◆ LoopedChamberingEjectLast()

void WeaponStateBase::LoopedChamberingEjectLast ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int startActionType = -1,
int endActionType = -1 )
inlineprivate

Definition at line 282 of file WeaponChamberingLooped.c.

283 {
287
288 // setup nested state machine
293 m_hideB = new BulletHide_W4T(m_weapon, this);
295 m_endLoop = new LoopedChambering_EndLoop(m_weapon, this, m_action, m_endActionType); // @NOTE: termination playing action - dummy?
296 // events
297 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
298 WeaponEventContinuousLoadBulletStart __lS_ = new WeaponEventContinuousLoadBulletStart;
299 WeaponEventContinuousLoadBulletEnd __lE_ = new WeaponEventContinuousLoadBulletEnd;
300 WeaponEventAnimCocked __wc_ = new WeaponEventAnimCocked;
301 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
302 WeaponEventAnimBulletHide __bh_ = new WeaponEventAnimBulletHide;
303 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
304 WeaponEventAnimBulletInMagazine __bM_ = new WeaponEventAnimBulletInMagazine;
305 WeaponEventAnimBulletShow2 _bs2_ = new WeaponEventAnimBulletShow2;
306
307 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
308 m_fsm.AddTransition(new WeaponTransition(m_start, __bs_, m_chamber));
309
310
311 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())));
312 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_endLoop));
313 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __bh_, m_hideB));
314 m_fsm.AddTransition(new WeaponTransition(m_hideB, __bs_, m_chamber));
315
316 m_fsm.AddTransition(new WeaponTransition(m_endLoop, _fin_, NULL));
317
318 m_fsm.AddTransition(new WeaponTransition(m_hideB, __be_, m_eject));
319 m_fsm.AddTransition(new WeaponTransition(m_endLoop, __be_, m_eject));
322
323 // Safety exits
324 m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, null));
325 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, _fin_, null));
326 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
327 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, null));
328 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
329
330 m_fsm.SetInitialState(m_start);
331 }
ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag

References m_action, m_chamber, m_eject, m_endActionType, m_endLoop, m_start, m_startActionType, m_w4sb2, m_weapon, and WeaponEjectCasing().

◆ OnAbort() [1/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 62 of file RifleChambering.c.

63 {
64 super.OnAbort(e);
66 }

References m_srcMagazine.

◆ OnAbort() [2/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 72 of file RifleReChambering.c.

73 {
74 super.OnAbort(e);
77 }

References m_srcMagazine.

◆ OnAbort() [3/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 46 of file WeaponAttachMagazine.c.

47 {
49 m_newSrc = NULL;
50
51 super.OnAbort(e);
52 }

◆ OnAbort() [4/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 190 of file WeaponAttachMagazine.c.

191 {
192 EntityAI leftHandItem = e.m_player.GetInventory().FindAttachment(InventorySlots.LEFTHAND);
194
195 if (mag)
196 {
197 e.m_player.GetInventory().ClearInventoryReservationEx(mag, null);
199 e.m_player.GetInventory().FindFreeLocationFor(mag, FindInventoryLocationType.CARGO, il);
200
201 if (!il || !il.IsValid())
202 {
203 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, mag))
204 {
205 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponAttachMagazine, ok - no inventory space for old magazine - dropped to ground");
206 }
207 else
208 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponAttachMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine");
209
210 }
211 else
212 {
214 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
215
217 {
218 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponAttachMagazine, ok - old magazine removed from wpn (LHand->inv)");
219 }
220 else
221 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponAttachMagazine, error - cannot remove old mag from wpn");
222 }
223 }
224 super.OnAbort(e);
225 }
void wpnDebugPrint(string s)
Definition Debug.c:9
void DayZPlayerUtils()
cannot be instantiated
FindInventoryLocationType
flags for searching locations in inventory
script counterpart to engine's class Inventory
Definition Inventory.c:79
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...
provides access to slot configuration

References DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon, and wpnDebugPrint().

◆ OnAbort() [5/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 448 of file WeaponChambering.c.

449 {
450 bool done = false;
451 if (m_srcMagazine)
452 {
453 e.m_player.GetInventory().ClearInventoryReservationEx(m_srcMagazine, m_srcMagazinePrevLocation);
454
456 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
457 if (leftHandIl.IsValid())
458 {
460 {
462 {
464 {
466 {
467 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort");
468 done = true;
469 }
470 }
471 }
472 }
473
474 if (!done)
475 {
477 e.m_player.GetInventory().FindFreeLocationFor(m_srcMagazine, FindInventoryLocationType.CARGO, il);
478
479 if (!il || !il.IsValid())
480 {
481 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
482 {
483 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - no inventory space for ammo pile - dropped to ground - abort");
484 }
485 else
486 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
487
488 }
489 else
490 {
492 {
493 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from left hand (LHand->inv) - abort");
494 }
495 else
496 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot remove ammo pile from wpn - abort");
497 }
498 }
499 }
500 }
501
502 super.OnAbort(e);
504 m_chamber.m_srcMagazine = NULL;
506 }
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...
const float MAX_DROP_MAGAZINE_DISTANCE_SQ
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.

References DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ, and wpnDebugPrint().

◆ OnAbort() [6/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 1080 of file WeaponChambering.c.

1081 {
1082 bool done = false;
1083 if (m_srcMagazine)
1084 {
1085 e.m_player.GetInventory().ClearInventoryReservationEx(m_srcMagazine, m_srcMagazinePrevLocation);
1086
1088 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
1089 if (leftHandIl.IsValid())
1090 {
1092 {
1094 {
1096 {
1098 {
1099 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort");
1100 done = true;
1101 }
1102 }
1103 }
1104 }
1105
1106 if (!done)
1107 {
1109 e.m_player.GetInventory().FindFreeLocationFor(m_srcMagazine, FindInventoryLocationType.CARGO, il);
1110
1111 if (!il || !il.IsValid())
1112 {
1113 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
1114 {
1115 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - no inventory space for ammo pile - dropped to ground - abort");
1116 }
1117 else
1118 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
1119
1120 }
1121 else
1122 {
1124 {
1125 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from left hand (LHand->inv) - abort");
1126 }
1127 else
1128 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from wpn - abort");
1129 }
1130 }
1131 }
1132 }
1133
1134 super.OnAbort(e);
1136 m_chamber.m_srcMagazine = NULL;
1138 }

References DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ, and wpnDebugPrint().

◆ OnAbort() [7/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 166 of file WeaponChamberingLooped.c.

167 {
168 bool done = false;
169 if (m_srcMagazine)
170 {
171 e.m_player.GetInventory().ClearInventoryReservationEx(m_srcMagazine, m_srcMagazinePrevLocation);
172
174 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
175 if (leftHandIl.IsValid())
176 {
178 {
180 {
182 {
184 {
185 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort");
186 done = true;
187 }
188 }
189 }
190 }
191
192 if (!done)
193 {
195 e.m_player.GetInventory().FindFreeLocationFor(m_srcMagazine, FindInventoryLocationType.CARGO, il);
196
197 if (!il || !il.IsValid())
198 {
199 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
200 {
201 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - no inventory space for ammo pile - dropped to ground - abort");
202 }
203 else
204 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
205
206 }
207 else
208 {
210 {
211 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand (LHand->inv) - abort");
212 }
213 else
214 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from wpn - abort");
215 }
216 }
217 }
218 }
219
220 super.OnAbort(e);
222 m_chamber.m_srcMagazine = NULL;
224 }

References DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ, and wpnDebugPrint().

◆ OnAbort() [8/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 424 of file WeaponChamberingLooped.c.

425 {
426 bool done = false;
427 if (m_srcMagazine)
428 {
429 e.m_player.GetInventory().ClearInventoryReservationEx(m_srcMagazine, m_srcMagazinePrevLocation);
430
432 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
433 if (leftHandIl.IsValid())
434 {
436 {
438 {
440 {
442 {
443 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort");
444 done = true;
445 }
446 }
447 }
448 }
449
450 if (!done)
451 {
453 e.m_player.GetInventory().FindFreeLocationFor(m_srcMagazine, FindInventoryLocationType.CARGO, il);
454
455 if (!il || !il.IsValid())
456 {
457 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
458 {
459 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - abort");
460 }
461 else
462 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
463
464 }
465 else
466 {
468 {
469 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - abort");
470 }
471 else
472 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - abort");
473 }
474 }
475 }
476 }
477
478 super.OnAbort(e);
480 m_chamber.m_srcMagazine = NULL;
482 }

References DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ, and wpnDebugPrint().

◆ OnAbort() [9/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 95 of file WeaponCharging.c.

96 {
98 super.OnAbort(e);
99 }

◆ OnAbort() [10/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 155 of file WeaponCharging.c.

156 {
158 super.OnAbort(e);
159 }

◆ OnAbort() [11/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 22 of file WeaponDetachingMag.c.

23 {
25 m_dst = NULL;
26
27 super.OnAbort(e);
28 }

References m_dst.

◆ OnAbort() [12/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 100 of file WeaponEjectBullet.c.

101 {
103 super.OnAbort(e);
104 }

◆ OnAbort() [13/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 65 of file WeaponFireAndChamberNext.c.

66 {
67 m_weapon.ResetBurstCount();
68 super.OnAbort(e);
69 }

References m_weapon.

◆ OnAbort() [14/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 21 of file WeaponReplacingMagAndChamberNext.c.

22 {
23 super.OnAbort(e);
25 m_newDst = NULL;
26 }

References m_oldMagazine.

◆ OnAbort() [15/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 151 of file WeaponReplacingMagAndChamberNext.c.

152 {
153 //m_weapon.HideMagazine();
154
156 m_newDst = NULL;
157
158 super.OnAbort(e);
159 }

◆ OnAbort() [16/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 258 of file WeaponReplacingMagAndChamberNext.c.

259 {
260 if (m_newMagazine && m_newDst)
261 {
262 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_newMagazine))
263 {
264 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store, ok - aborting, detached magazine dropped to ground");
265 }
266 else
267 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store, error - cannot abort detaching of magazine");
268
269 m_weapon.HideMagazine(); // force hide on abort
270 }
271
272 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " AttachNewMagazine, aborting, but attached new magazine already in place");
274 m_newDst = NULL;
275
276 super.OnAbort(e);
277 }

References DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ OnAbort() [17/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 496 of file WeaponReplacingMagAndChamberNext.c.

497 {
498 super.OnAbort(e);
499
500 EntityAI leftHandItem = e.m_player.GetInventory().FindAttachment(InventorySlots.LEFTHAND);
502
503 if (mag)
504 {
505 if (m_newMagazine)
506 e.m_player.GetInventory().ClearInventoryReservationEx(m_newMagazine, null);
507 if (m_oldMagazine)
508 e.m_player.GetInventory().ClearInventoryReservationEx(m_oldMagazine, null);
509
511
512 e.m_player.GetInventory().FindFreeLocationFor(mag, FindInventoryLocationType.CARGO, il);
513
514 if (!il.IsValid())
515 {
516 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, mag))
517 {
518 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, ok - no inventory space for old magazine - dropped to ground - abort");
519 }
520 else
521 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine - abort");
522
523 }
524 else
525 {
527 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
528
530 {
531 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, ok - old magazine removed from wpn (LHand->inv) - abort");
532 }
533 else
534 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, error - cannot remove old mag from wpn - abort");
535 }
536 }
537 }

References DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_oldMagazine, m_weapon, and wpnDebugPrint().

◆ OnAbort() [18/18]

void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 128 of file WeaponStateBase.c.

129 {
130 if (HasFSM() && m_fsm.IsRunning())
131 {
132 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " OnAbort " + this.Type().ToString() + " Has Sub-FSM! Aborting submachine...");
133 m_fsm.Abort(e);
134 }
135 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } ABORTED " + this.Type().ToString());
136 }

References HasFSM(), LogManager::IsWeaponLogEnable(), m_fsm, m_weapon, and wpnDebugPrint().

◆ OnEntry() [1/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 3 of file BulletHide.c.

4 {
5 super.OnEntry(e);
6 if (e)
7 m_weapon.SelectionBulletHide();
8 }

References m_weapon.

◆ OnEntry() [2/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 3 of file BulletShow.c.

4 {
5 super.OnEntry(e);
6 if (e)
8 }
override void ShowBullet(int muzzleIndex)
Definition Magnum.c:297

References m_weapon.

◆ OnEntry() [3/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 18 of file BulletShow.c.

19 {
20 super.OnEntry(e);
21 if (e)
23 }

References m_weapon.

◆ OnEntry() [4/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 3 of file MagazineHide.c.

4 {
5 super.OnEntry(e);
6 //m_weapon.HideMagazine();
7 }

◆ OnEntry() [5/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 3 of file MagazineShow.c.

4 {
5 super.OnEntry(e);
6 if (e)
7 m_weapon.ShowMagazine();
8 }

References m_weapon.

◆ OnEntry() [6/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 42 of file RifleChambering.c.

43 {
44 if (e != NULL)
45 {
46 if (e.m_magazine != NULL)
47 {
48 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RifleChambering, taking mag from event e.mag=" + e.m_magazine.ToString());
49 m_srcMagazine = e.m_magazine;
50 m_chamber.m_srcMagazine = m_srcMagazine;
51 }
52 }
53 else
54 {
55 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RifleChambering (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
56 }
57 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " m_srcMagazine=" + m_srcMagazine.ToString());
58
59 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
60 }

References LogManager::IsWeaponLogEnable(), m_chamber, m_srcMagazine, m_srcMagazine, m_weapon, and wpnDebugPrint().

◆ OnEntry() [7/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 43 of file RifleReChambering.c.

44 {
45 if (e)
46 {
47 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber, mag=" + e.m_magazine.ToString());
48 m_srcMagazine = e.m_magazine;
49 m_chamber.m_srcMagazine = m_srcMagazine;
50
51 // prepare magazine for ejected ammo
52 int mi = m_weapon.GetCurrentMuzzle();
53 string magazineTypeName = m_weapon.GetChamberedCartridgeMagazineTypeName(mi);
54 float damage = 0.0;
55 string type;
56 if (m_weapon.GetCartridgeInfo(mi, damage, type))
57 {
58 bool is_single_or_server = !GetGame().IsMultiplayer() || GetGame().IsServer();
60 {
61 m_dstMagazine = DayZPlayerUtils.SelectStoreCartridge(e.m_player, m_weapon, mi, m_srcMagazine, damage, magazineTypeName);
62 if (!m_dstMagazine)
63 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber - error, cannot prepare mag for catridge, magType=" + magazineTypeName);
64 }
65 }
66 m_eject.m_dstMagazine = m_dstMagazine;
67 }
68 super.OnEntry(e); // @NOTE: super after submachine init (prevent override from submachine start)
69
70 }
proto native CGame GetGame()

References DayZPlayerUtils(), Error(), GetGame(), LogManager::IsWeaponLogEnable(), m_chamber, m_dstMagazine, m_eject, m_srcMagazine, m_srcMagazine, m_weapon, and wpnDebugPrint().

◆ OnEntry() [8/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 12 of file WeaponAttachMagazine.c.

13 {
14 if (e)
15 {
16 if (!m_newSrc.IsValid())
17 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory m_newSrc=invalid, item not in bubble?");
18
19 if (m_newMagazine && m_newSrc && m_newSrc.IsValid())
20 {
22 m_newMagazine.GetInventory().GetCurrentInventoryLocation(curr);
23
24 if (m_newSrc.GetType() == InventoryLocationType.GROUND && curr.GetType() == InventoryLocationType.ATTACHMENT && curr.GetSlot() == InventorySlots.LEFTHAND)
25 {
26 // already in LH
27 }
28 else
29 {
31 lhand.SetAttachment(e.m_player, m_newMagazine, InventorySlots.LEFTHAND);
33 {
34 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory, ok - new magazine removed from inv (inv->LHand)");
35 }
36 else
37 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory, error - cannot new remove mag from inv");
38 }
39 }
40 else
41 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory, error - no magazines configured for replace (m_old=m_new=NULL)");
42 }
43 super.OnEntry(e);
44 }
InventoryLocationType
types of Inventory Location

References Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon, and wpnDebugPrint().

◆ OnEntry() [9/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 163 of file WeaponAttachMagazine.c.

164 {
165 if (e)
166 {
167 Magazine mag = e.m_magazine;
168
170 mag.GetInventory().GetCurrentInventoryLocation(newSrc);
171
172 // move to LH
174 lhand.SetAttachment(e.m_player, mag, InventorySlots.LEFTHAND);
176 {
177 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponAttachMagazine, ok - new magazine removed from inv (inv->LHand)");
178 }
179 else
180 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponAttachMagazine, error - cannot new remove mag from inv");
181
183 il.SetAttachment(m_weapon, mag, InventorySlots.MAGAZINE);
184 m_attach.m_newMagazine = mag;
185 m_attach.m_newDst = il;
186 }
187 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
188 }
ref AttachNewMagazine m_attach

References Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon, and wpnDebugPrint().

◆ OnEntry() [10/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 8 of file WeaponChamberFromAttMag.c.

9 {
10 super.OnEntry(e);
11 if (e)
12 {
13 int mi = m_weapon.GetCurrentMuzzle();
14 m_weapon.SetCharged(true);
15 m_weapon.SetWeaponOpen(false);
17 }
18 }
bool pushToChamberFromAttachedMagazine(Weapon_Base weapon, int muzzleIndex)
Definition weapon_utils.c:1

References m_weapon, and pushToChamberFromAttachedMagazine().

◆ OnEntry() [11/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 31 of file WeaponChamberFromAttMag.c.

32 {
33 super.OnEntry(e);
34 if (e)
35 {
36 int mi = m_weapon.GetCurrentMuzzle();
38 }
39 }
bool pushToChamberFromInnerMagazine(Weapon_Base weapon, int muzzleIndex)

References m_weapon, and pushToChamberFromInnerMagazine().

◆ OnEntry() [12/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 411 of file WeaponChambering.c.

412 {
413 if (e != NULL)
414 {
415 m_srcMagazine = e.m_magazine;
416 if (m_srcMagazine != NULL)
417 {
419 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
420
422
423 // move to LH
425 lhand.SetAttachment(e.m_player, m_srcMagazine, InventorySlots.LEFTHAND);
427 {
428 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from inv (inv->LHand)");
429 }
430 else
431 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot remove ammo pile from inv");
432
433 m_chamber.m_srcMagazine = m_srcMagazine;
434 }
435 else
436 {
437 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering m_srcMagazine = NULL");
438 }
439 }
440 else
441 {
442 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
443 }
444
445 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
446 }

References Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, and wpnDebugPrint().

◆ OnEntry() [13/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 896 of file WeaponChambering.c.

897 {
898 int nextMuzzle;
899 if (FindNextFreeMuzzle(m_weapon.GetCurrentMuzzle(), nextMuzzle))
900 {
902 magnum.SetCylinderRotationAnimationPhase(magnum.GetCylinderRotation(nextMuzzle));
903 m_weapon.SetCurrentMuzzle(nextMuzzle);
904 }
905 else
906 Print("WTF");
907
908 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
909 }
bool FindNextFreeMuzzle(int currentMuzzle, out int nextMuzzle)
proto void Print(void var)
Prints content of variable to console/log.

References m_weapon, and Print().

◆ OnEntry() [14/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 986 of file WeaponChambering.c.

987 {
988 if (e != NULL)
989 {
990
991 m_srcMagazine = e.m_magazine;
992 if (m_srcMagazine != NULL)
993 {
995 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
996
998
999 // move to LH
1001 lhand.SetAttachment(e.m_player, m_srcMagazine, InventorySlots.LEFTHAND);
1003 {
1004 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from inv (inv->LHand)");
1005 }
1006 else
1007 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, error - cannot remove ammo pile from inv");
1008
1009 m_chamber.m_srcMagazine = m_srcMagazine;
1010 }
1011 else
1012 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering m_srcMagazine = NULL");
1013 }
1014 else
1015 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
1016
1017 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
1018 }

References Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, Print(), and wpnDebugPrint().

◆ OnEntry() [15/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 73 of file WeaponChamberingLooped.c.

74 {
75 if (e != NULL)
76 {
77
78 m_srcMagazine = e.m_magazine;
79 if (m_srcMagazine != NULL)
80 {
81 m_weapon.SelectionBulletHide();
83 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
84
86
87 // move to LH
89 lhand.SetAttachment(e.m_player, m_srcMagazine, InventorySlots.LEFTHAND);
91 {
92 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from inv (inv->LHand)");
93 }
94 else
95 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from inv");
96
97 m_chamber.m_srcMagazine = m_srcMagazine;
98 }
99 else
100 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering m_srcMagazine = NULL");
101 }
102 else
103 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
104
105 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
106 }

References Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, Print(), and wpnDebugPrint().

◆ OnEntry() [16/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 333 of file WeaponChamberingLooped.c.

334 {
335 if (e != NULL)
336 {
337 m_srcMagazine = e.m_magazine;
338 if (m_srcMagazine != NULL)
339 {
341 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
342
344
345 // move to LH
347 lhand.SetAttachment(e.m_player, m_srcMagazine, InventorySlots.LEFTHAND);
349 {
350 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from inv (inv->LHand)");
351 }
352 else
353 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from inv");
354
355 m_chamber.m_srcMagazine = m_srcMagazine;
356 }
357 else
358 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast m_srcMagazine = NULL");
359 }
360 else
361 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
362
363 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
364 }

References Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, Print(), and wpnDebugPrint().

◆ OnEntry() [17/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 71 of file WeaponCharging.c.

72 {
73 super.OnEntry(e);
74 m_weapon.SetCharged(true);
75 m_weapon.SetWeaponOpen(false);
76 }

References m_weapon.

◆ OnEntry() [18/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

destination of the cartridge

Definition at line 83 of file WeaponCharging.c.

84 {
85 super.OnEntry(e);
86 if (e)
87 {
88 DayZPlayer p = e.m_player;
89 int mi = m_weapon.GetCurrentMuzzle();
90
92 }
93 }
void ejectBulletAndStoreInMagazine(Weapon_Base weapon, int muzzleIndex, Magazine mag, DayZPlayer p)

References ejectBulletAndStoreInMagazine(), and m_weapon.

◆ OnEntry() [19/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

destination of the cartridge

Definition at line 139 of file WeaponCharging.c.

140 {
141 super.OnEntry(e);
142 if (e)
143 {
144 DayZPlayer p = e.m_player;
145 for (int i = 0; i < m_weapon.GetMuzzleCount(); i++)
146 {
147 m_weapon.CreateRound(i);
149 m_weapon.EffectBulletHide(i);
151 }
152 }
153 }
override void HideBullet(int muzzleIndex)
Definition Magnum.c:320

References ejectBulletAndStoreInMagazine(), and m_weapon.

◆ OnEntry() [20/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 265 of file WeaponCharging.c.

266 {
267 super.OnEntry(e);
268 }

◆ OnEntry() [21/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 337 of file WeaponCharging.c.

338 {
339 super.OnEntry(e);
340 }

◆ OnEntry() [22/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 11 of file WeaponDetachingMag.c.

12 {
13 //if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store, Detaching mag=" + m_magazine.ToString() + "to loc=" + InventoryLocation.DumpToStringNullSafe(m_dst)); }
14 super.OnEntry(e);
15 if (e)
16 {
17 if (!m_magazine || !m_dst)
18 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store, error - no magazine to load from (m_magazine=NULL)");
19 }
20 }

References Error(), m_dst, and m_weapon.

◆ OnEntry() [23/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 134 of file WeaponDetachingMag.c.

135 {
136 if (e != NULL)
137 {
138 WeaponEventDetachMagazine de;
139 if (Class.CastTo(de, e))
140 {
141 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("WeaponDetachingMag type=" + typename.EnumToString(InventoryLocationType, de.m_dst.GetType()));
142 m_magazine = e.m_magazine;
143 m_dst = de.m_dst;
144
145 m_store.m_magazine = m_magazine;
146 m_store.m_dst = m_dst;
147 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("WeaponDetachingMag type=" + typename.EnumToString(InventoryLocationType, m_store.m_dst.GetType()));
148 }
149 }
150 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
151 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
ref WeaponDetachingMag_Store m_store
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), LogManager::IsWeaponLogEnable(), m_dst, m_dst, m_magazine, and wpnDebugPrint().

◆ OnEntry() [24/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 85 of file WeaponEjectBullet.c.

86 {
87 if (e)
88 {
89 if (e.m_magazine)
90 m_dstMagazine = e.m_magazine;
91 m_eject.m_dstMagazine = m_dstMagazine;
92
93 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponEjectBullet m_mag=" + m_dstMagazine.ToString() + ", e.mag=" + e.m_magazine.ToString());
94 }
95
96 super.OnEntry(e); // @NOTE: super after submachine init (prevent override from submachine start)
97
98 }

References LogManager::IsWeaponLogEnable(), m_dstMagazine, m_eject, m_weapon, and wpnDebugPrint().

◆ OnEntry() [25/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 6 of file WeaponEjectCasingAndChamberFromAttMag.c.

7 {
8 super.OnEntry(e);
9 if (e)
10 {
11 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ejected fired out casing");
12 int mi = m_weapon.GetCurrentMuzzle();
13 if (m_weapon.IsChamberFiredOut(mi))
14 m_weapon.EjectCasing(mi);
15 m_weapon.EffectBulletHide(mi);
16 m_weapon.SelectionBulletHide();
17 }
18 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ OnEntry() [26/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 25 of file WeaponEjectCasingAndChamberFromAttMag.c.

26 {
27 super.OnEntry(e);
28 if (e)
29 {
30 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ejected fired out casing multi muzzle");
31 for (int i = 0; i < m_weapon.GetMuzzleCount(); i++)
32 {
33 if (m_weapon.IsChamberFiredOut(i))
34 {
35 m_weapon.EjectCasing(i);
36 m_weapon.EffectBulletHide(i);
38 }
39 }
40 }
41 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ OnEntry() [27/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 59 of file WeaponEjectCasingAndChamberFromAttMag.c.

60 {
61 super.OnEntry(e);
62 if (e)
63 {
65 if (cylinder)
66 {
67 cylinder.HideSelection("bullet");
68 cylinder.HideSelection("bullet_2");
69 cylinder.HideSelection("bullet_3");
70 cylinder.HideSelection("bullet_4");
71 cylinder.HideSelection("bullet_5");
72 cylinder.HideSelection("bullet_6");
73
74 cylinder.HideSelection("bullet_nose");
75 cylinder.HideSelection("bullet_nose_2");
76 cylinder.HideSelection("bullet_nose_3");
77 cylinder.HideSelection("bullet_nose_4");
78 cylinder.HideSelection("bullet_nose_5");
79 cylinder.HideSelection("bullet_nose_6");
80 }
81
82
83 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ejected bullets from all muzzles");
84 for (int i = 0; i < m_weapon.GetMuzzleCount(); i++)
85 {
86 if (m_weapon.IsChamberFiredOut(i))
87 {
88 m_weapon.EjectCasing(i);
89 m_weapon.EffectBulletHide(i);
91 continue;
92 }
93
94 if (!m_weapon.IsChamberEmpty(i))
95 {
96 DayZPlayer p = e.m_player;
97 if (m_dstMagazine && m_dstMagazine.GetAmmoCount() < m_dstMagazine.GetAmmoMax())
98 {
99 m_weapon.CreateRound(i);
101 }
102 else
103 {
104 m_weapon.CreateRound(i);
106 }
107 m_weapon.EffectBulletHide(i);
109 }
110 }
111 m_weapon.SetWeaponOpen(false);
112 m_weapon.SetCharged(true);
113 }
114 //m_weapon.SelectionBulletHide();
115 }

References ejectBulletAndStoreInMagazine(), LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ OnEntry() [28/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 31 of file WeaponFireAndChamberNext.c.

32 {
33 super.OnEntry(e);
34 if (e)
36 }

References m_dtAccumulator.

◆ OnEntry() [29/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 31 of file WeaponFireAndChamberNextFromInnerMag.c.

32 {
33 super.OnEntry(e);
34 if (e)
36 }

References m_dtAccumulator.

◆ OnEntry() [30/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 31 of file WeaponFireLast.c.

32 {
33 super.OnEntry(e);
34 if (e)
36 }

References m_dtAccumulator.

◆ OnEntry() [31/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 35 of file WeaponReChamber.c.

36 {
37 if (e)
38 {
39 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber, mag=" + e.m_magazine.ToString());
40 m_srcMagazine = e.m_magazine;
41 m_loa.m_srcMagazine = m_srcMagazine;
42
43 // prepare magazine for ejected ammo
44 int mi = m_weapon.GetCurrentMuzzle();
45 string magazineTypeName = m_weapon.GetChamberedCartridgeMagazineTypeName(mi);
46 float damage = 0.0;
47 string type;
48 if (m_weapon.GetCartridgeInfo(mi, damage, type))
49 {
50 m_dstMagazine = DayZPlayerUtils.SelectStoreCartridge(e.m_player, m_weapon, mi, m_srcMagazine, damage, magazineTypeName);
51 if (!m_dstMagazine)
52 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber - error, cannot prepare mag for catridge, magType=" + magazineTypeName);
53 }
54
55 e.m_magazine = m_dstMagazine; // @NOTE: override event mag - @TODO
56 }
57 super.OnEntry(e); // @NOTE: super after submachine init (prevent override from submachine start)
58 }
ref WeaponChambering m_loa

References DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), m_dstMagazine, m_srcMagazine, m_srcMagazine, m_weapon, and wpnDebugPrint().

◆ OnEntry() [32/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 16 of file WeaponReplacingMagAndChamberNext.c.

17 {
18 super.OnEntry(e);
19 }

◆ OnEntry() [33/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 126 of file WeaponReplacingMagAndChamberNext.c.

127 {
128 super.OnEntry(e);
129
130 if (e)
131 {
132 if (!m_newMagazine || !m_newDst || !m_newDst.IsValid())
133 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " SwapOldAndNewMagazine, error - m_newMagazine(" + m_newMagazine + ") or destination(" + InventoryLocation.DumpToStringNullSafe(m_newDst) + ") is not set ");
134 else
135 {
136 e.m_player.GetInventory().ClearInventoryReservationEx(m_newMagazine, m_newDst);
137 m_weapon.ShowMagazine();
139 lhand.SetAttachment(e.m_player, m_newMagazine, InventorySlots.LEFTHAND);
140
142 {
143 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " SwapOldAndNewMagazine, ok - new magazine removed from inv (LHand->Att)");
144 }
145 else
146 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " SwapOldAndNewMagazine, error - cannot remove new mag from LHand");
147 }
148 }
149 }
static string DumpToStringNullSafe(InventoryLocation loc)

References InventoryLocation::DumpToStringNullSafe(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon, and wpnDebugPrint().

◆ OnEntry() [34/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 228 of file WeaponReplacingMagAndChamberNext.c.

229 {
230 super.OnEntry(e);
231 if (e)
232 {
233 if (m_newMagazine && m_newDst)
234 {
236 if (m_newMagazine.GetInventory().GetCurrentInventoryLocation(il))
237 {
239 lhand.SetAttachment(e.m_player, m_newMagazine, InventorySlots.LEFTHAND);
241 {
242 m_weapon.ShowMagazine();
243 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " AttachNewMagazine, ok - attached new magazine (LHand->dst)");
244 }
245 else
246 {
247 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " AttachNewMagazine, error - cannot attach new magazine!");
248 }
249 }
250 else
251 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " AttachNewMagazine, error - cannot get curr location");
252 }
253 else
254 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " AttachNewMagazine, error - no magazines configured for replace (m_new=NULL)");
255 }
256 }

References Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon, and wpnDebugPrint().

◆ OnEntry() [35/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 404 of file WeaponReplacingMagAndChamberNext.c.

405 {
406 if (e != NULL)
407 {
408 WeaponEventSwapMagazine se;
409 if (Class.CastTo(se, e))
410 {
411 int mi = m_weapon.GetCurrentMuzzle();
412 m_oldMagazine = m_weapon.GetMagazine(mi);
413 m_newMagazine = se.m_magazine;
414 m_newDst = se.m_dst;
415
416 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponReplacingMagAndChamberNext, m_oldMagazine= " + m_oldMagazine + " m_newMagazine= " + m_newMagazine + " m_oldMagazineDst= " + typename.EnumToString(InventoryLocationType, se.m_dst.GetType()));
417
420
421 if (!m_newMagazine.GetInventory().GetCurrentInventoryLocation(newSrc))
422 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponReplacingMagAndChamberNext cannot get curr inv loc of NEW mag=" + Object.GetDebugName(m_newMagazine));
423 if (!m_oldMagazine.GetInventory().GetCurrentInventoryLocation(oldSrc))
424 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponReplacingMagAndChamberNext cannot get curr inv loc of OLD mag=" + Object.GetDebugName(m_oldMagazine));
425
426 // move to LH
428 lhand.SetAttachment(e.m_player, m_newMagazine, InventorySlots.LEFTHAND);
429
431 {
432 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory, ok - new magazine removed from inv (inv->LHand)");
433 }
434 else
435 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory, error - cannot new remove mag from inv");
436
437 m_detach.m_oldMagazine = m_oldMagazine;
438 m_detach.m_newDst = m_newDst;
439
440 m_swapMags.m_newMagazine = m_newMagazine;
441
442 oldSrc.SetItem(m_newMagazine);
443 m_swapMags.m_newDst = oldSrc;
444 }
445 }
446 super.OnEntry(e);
447 }
ref SwapOldAndNewMagazine m_swapMags

References Class::CastTo(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_oldMagazine, m_weapon, and wpnDebugPrint().

◆ OnEntry() [36/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 15 of file WeaponStartAction.c.

16 {
17 super.OnEntry(e);
18 if (e)
19 {
20 if (e.m_player)
21 {
22 HumanCommandWeapons hcw = e.m_player.GetCommandModifier_Weapons();
23 if (hcw)
24 {
25 HumanCommandAdditives ad = e.m_player.GetCommandModifier_Additives();
26 if (ad)
27 ad.CancelModifier();
28
29 hcw.StartAction(m_action, m_actionType);
30
31 if (hcw.GetRunningAction() == m_action && hcw.GetRunningActionType() == m_actionType)
32 {
33 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("HCW: playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType) + " fini=" + hcw.IsActionFinished());
34 }
35 else
36 Error("HCW: NOT playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType) + " fini=" + hcw.IsActionFinished());
37 }
38 else if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("---: remote playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType));
39 }
40 else
41 {
42 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("---: warning, no player wants to play A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType));
43 }
44 }
45 }
int m_actionType
action to be played
WeaponActions
actions
Definition human.c:796
string WeaponActionTypeToString(int A, int AT)
Definition human.c:923
class HumanCommandWeapons HumanCommandAdditives()
Definition human.c:1086

References Error(), HumanCommandAdditives(), LogManager::IsWeaponLogEnable(), m_action, WeaponActionTypeToString(), and wpnDebugPrint().

◆ OnEntry() [37/39]

void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 103 of file WeaponStateBase.c.

104 {
105 if (HasFSM() && !m_fsm.IsRunning())
106 {
107 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { " + this.Type().ToString() + " Has Sub-FSM! Starting submachine...");
108 m_fsm.Start(e);
109 }
110 else if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { " + this.Type().ToString());
111 }

References HasFSM(), LogManager::IsWeaponLogEnable(), m_fsm, m_weapon, and wpnDebugPrint().

◆ OnEntry() [38/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 77 of file WeaponUnjamming.c.

78 {
79 super.OnEntry(e);
80 if (e)
81 {
82 m_type = string.Empty;
83
84 float dmg;
85 string type;
86
87 m_weapon.SetJammed(false);
88
89 int mi = m_weapon.GetCurrentMuzzle();
90
91 if (m_weapon.IsChamberFiredOut(mi))
92 {
93 m_weapon.EjectCasing(mi);
94 m_weapon.EffectBulletHide(mi);
95 m_weapon.SelectionBulletHide();
96 }
97
98 if (!m_weapon.IsChamberEmpty(mi))
99 {
100 DayZPlayer p = e.m_player;
101
102 m_weapon.CreateRound(mi);
104
105 m_weapon.EffectBulletHide(mi);
106 m_weapon.SelectionBulletHide();
107 }
108 }
109 }
static const string Empty
Definition EnString.c:7

References ejectBulletAndStoreInMagazine(), string::Empty, and m_weapon.

◆ OnEntry() [39/39]

override void WeaponStateBase::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 212 of file WeaponUnjamming.c.

213 {
214 super.OnEntry(e);
215 if (e)
216 {
217 m_dtAccumulator = 0.0;
218 m_jamTime = 5.0; // @TODO: rand
219
220 m_start.m_dtAccumulator = m_dtAccumulator;
221 m_start.m_jamTime = m_jamTime;
222 }
223 }

References m_dtAccumulator, and m_start.

◆ OnExit() [1/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 10 of file BulletHide.c.

11 {
12 super.OnExit(e);
13 }

◆ OnExit() [2/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 10 of file BulletShow.c.

11 {
12 super.OnExit(e);
13 }

◆ OnExit() [3/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 25 of file BulletShow.c.

26 {
27 super.OnExit(e);
28 }

◆ OnExit() [4/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 9 of file MagazineHide.c.

10 {
11 super.OnExit(e);
12 }

◆ OnExit() [5/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 10 of file MagazineShow.c.

11 {
12 super.OnExit(e);
13 }

◆ OnExit() [6/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 68 of file RifleChambering.c.

69 {
70 super.OnExit(e);
72 }

References m_srcMagazine.

◆ OnExit() [7/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 79 of file RifleReChambering.c.

80 {
81 super.OnExit(e);
84 }

References m_srcMagazine.

◆ OnExit() [8/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 54 of file WeaponAttachMagazine.c.

55 {
56 m_weapon.ShowMagazine();
57
59 m_newSrc = NULL;
60 super.OnExit(e);
61 }

References m_weapon.

◆ OnExit() [9/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 19 of file WeaponChamberFromAttMag.c.

20 {
21 super.OnExit(e);
22 }

◆ OnExit() [10/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 40 of file WeaponChamberFromAttMag.c.

41 {
42 super.OnExit(e);
43 }

◆ OnExit() [11/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 52 of file WeaponChamberFromAttMag.c.

53 {
54 int mi = m_weapon.GetCurrentMuzzle();
56
57 super.OnExit(e);
58 }

References m_weapon, and pushToChamberFromAttachedMagazine().

◆ OnExit() [12/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 508 of file WeaponChambering.c.

509 {
510 bool done = false;
511 if (m_srcMagazine)
512 {
513 e.m_player.GetInventory().ClearInventoryReservationEx(m_srcMagazine, m_srcMagazinePrevLocation);
514
516 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
517 if (leftHandIl.IsValid())
518 {
520 {
522 {
524 {
526 {
527 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit");
528 done = true;
529 }
530 }
531 }
532 }
533
534 if (!done)
535 {
537 e.m_player.GetInventory().FindFreeLocationFor(m_srcMagazine, FindInventoryLocationType.CARGO, il);
538
539 if (!il || !il.IsValid())
540 {
541 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
542 {
543 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - no inventory space for ammo pile - dropped to ground - exit");
544 }
545 else
546 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
547
548 }
549 else
550 {
552 {
553 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from left hand (LHand->inv) - exit");
554 }
555 else
556 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot remove ammo pile from wpn - exit");
557 }
558 }
559 }
560 }
561
562 super.OnExit(e);
564 m_chamber.m_srcMagazine = NULL;
566 }

References DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ, and wpnDebugPrint().

◆ OnExit() [13/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 1020 of file WeaponChambering.c.

1021 {
1022 bool done = false;
1023 if (m_srcMagazine)
1024 {
1025 e.m_player.GetInventory().ClearInventoryReservationEx(m_srcMagazine, m_srcMagazinePrevLocation);
1026
1028 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
1029 if (leftHandIl.IsValid())
1030 {
1032 {
1034 {
1036 {
1038 {
1039 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit");
1040 done = true;
1041 }
1042 }
1043 }
1044 }
1045
1046 if (!done)
1047 {
1049 e.m_player.GetInventory().FindFreeLocationFor(m_srcMagazine, FindInventoryLocationType.CARGO, il);
1050
1051 if (!il || !il.IsValid())
1052 {
1053 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
1054 {
1055 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - no inventory space for ammo pile - dropped to ground - exit");
1056 }
1057 else
1058 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
1059
1060 }
1061 else
1062 {
1064 {
1065 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from left hand (LHand->inv) - exit");
1066 }
1067 else
1068 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, error - cannot remove ammo pile from wpn - exit");
1069 }
1070 }
1071 }
1072 }
1073
1074 super.OnExit(e);
1076 m_chamber.m_srcMagazine = NULL;
1078 }

References DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ, and wpnDebugPrint().

◆ OnExit() [14/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 107 of file WeaponChamberingLooped.c.

108 {
109 bool done = false;
110 if (m_srcMagazine)
111 {
112 e.m_player.GetInventory().ClearInventoryReservationEx(m_srcMagazine, m_srcMagazinePrevLocation);
113
115 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
116 if (leftHandIl.IsValid())
117 {
119 {
121 {
123 {
125 {
126 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit");
127 done = true;
128 }
129 }
130 }
131 }
132
133 if (!done)
134 {
136 e.m_player.GetInventory().FindFreeLocationFor(m_srcMagazine, FindInventoryLocationType.CARGO, il);
137
138 if (!il || !il.IsValid())
139 {
140 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
141 {
142 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - no inventory space for ammo pile - dropped to ground - exit");
143 }
144 else
145 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
146
147 }
148 else
149 {
151 {
152 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand (LHand->inv) - exit");
153 }
154 else
155 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from wpn - exit");
156 }
157 }
158 }
159 }
160
161 super.OnExit(e);
163 m_chamber.m_srcMagazine = NULL;
165 }

References DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ, and wpnDebugPrint().

◆ OnExit() [15/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 365 of file WeaponChamberingLooped.c.

366 {
367 bool done = false;
368 if (m_srcMagazine)
369 {
370 e.m_player.GetInventory().ClearInventoryReservationEx(m_srcMagazine, m_srcMagazinePrevLocation);
371
373 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
374 if (leftHandIl.IsValid())
375 {
377 {
379 {
381 {
383 {
384 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit");
385 done = true;
386 }
387 }
388 }
389 }
390
391 if (!done)
392 {
394 e.m_player.GetInventory().FindFreeLocationFor(m_srcMagazine, FindInventoryLocationType.CARGO, il);
395
396 if (!il || !il.IsValid())
397 {
398 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
399 {
400 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - exit");
401 }
402 else
403 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
404
405 }
406 else
407 {
409 {
410 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - exit");
411 }
412 else
413 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - exit");
414 }
415 }
416 }
417 }
418
419 super.OnExit(e);
421 m_chamber.m_srcMagazine = NULL;
423 }

References DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ, and wpnDebugPrint().

◆ OnExit() [16/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 101 of file WeaponCharging.c.

102 {
104 super.OnExit(e);
105 }

◆ OnExit() [17/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 161 of file WeaponCharging.c.

162 {
164 super.OnExit(e);
165 }

◆ OnExit() [18/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 269 of file WeaponCharging.c.

270 {
271 super.OnExit(e);
272 }

◆ OnExit() [19/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 341 of file WeaponCharging.c.

342 {
343 super.OnExit(e);
344 }

◆ OnExit() [20/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 30 of file WeaponDetachingMag.c.

31 {
33 if (m_magazine.GetInventory().GetCurrentInventoryLocation(il))
34 {
36 {
37 m_weapon.HideMagazine();
38 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store, ok - magazine removed from inv (inv->dst)");
39 }
40 else
41 {
42 // @TODO: drop on gnd
43 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store, error - cannot store detached magazine!");
44 }
45 }
46 else
47 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store, error - cannot get curr location");
48
50 m_dst = NULL;
51 super.OnExit(e);
52 }

References Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_dst, m_weapon, and wpnDebugPrint().

◆ OnExit() [21/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 153 of file WeaponDetachingMag.c.

154 {
155 m_dst = NULL;
157 super.OnExit(e);
158 }

References m_dst.

◆ OnExit() [22/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 106 of file WeaponEjectBullet.c.

107 {
109 super.OnExit(e);
110 }

◆ OnExit() [23/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 58 of file WeaponFireAndChamberNext.c.

59 {
60 //m_weapon.ResetBurstCount();
62 super.OnExit(e);
63 }

References m_dtAccumulator.

◆ OnExit() [24/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 55 of file WeaponFireAndChamberNextFromInnerMag.c.

56 {
58 super.OnExit(e);
59 }

References m_dtAccumulator.

◆ OnExit() [25/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 38 of file WeaponFireLast.c.

39 {
41 super.OnExit(e);
42 }

References m_dtAccumulator.

◆ OnExit() [26/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 60 of file WeaponReChamber.c.

61 {
62 super.OnExit(e);
64 m_eje.m_dstMagazine = NULL;
65 m_loa.m_srcMagazine = NULL;
66 }
ref WeaponEjectBullet m_eje
source of the loaded cartridge

◆ OnExit() [27/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 28 of file WeaponReplacingMagAndChamberNext.c.

29 {
30 if (m_oldMagazine)
31 {
33 e.m_player.GetInventory().FindFreeLocationFor(m_oldMagazine, FindInventoryLocationType.CARGO, il);
34
35 if (!m_newDst || !m_newDst.IsValid() || m_newDst.GetType() == InventoryLocationType.GROUND)
36 {
37 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_oldMagazine))
38 {
39 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, ok - no inventory space for old magazine - dropped to ground");
40 }
41 else
42 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine");
43
44 }
45 else
46 {
48 m_oldMagazine.GetInventory().GetCurrentInventoryLocation(oldSrc);
49
51 {
52 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, ok - old magazine removed from wpn (LHand->inv)");
53 }
54 else
55 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, error - cannot remove old mag from wpn");
56 }
57 }
58
59 m_weapon.HideMagazine();
61 m_newDst = null;
62 super.OnExit(e);
63 }

References DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_oldMagazine, m_weapon, and wpnDebugPrint().

◆ OnExit() [28/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 161 of file WeaponReplacingMagAndChamberNext.c.

162 {
164 m_newDst = NULL;
165
166 super.OnExit(e);
167 }

◆ OnExit() [29/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 279 of file WeaponReplacingMagAndChamberNext.c.

280 {
282 m_newDst = NULL;
283 super.OnExit(e);
284 }

◆ OnExit() [30/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 449 of file WeaponReplacingMagAndChamberNext.c.

450 {
451 super.OnExit(e);
452
453 EntityAI leftHandItem = e.m_player.GetInventory().FindAttachment(InventorySlots.LEFTHAND);
455
456 if (mag)
457 {
458 if (m_newMagazine)
459 e.m_player.GetInventory().ClearInventoryReservationEx(m_newMagazine, null);
460 if (m_oldMagazine)
461 e.m_player.GetInventory().ClearInventoryReservationEx(m_oldMagazine, null);
462
464
465 e.m_player.GetInventory().FindFreeLocationFor(mag, FindInventoryLocationType.CARGO, il);
466
467 if (!il.IsValid())
468 {
469 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, mag))
470 {
471 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, ok - no inventory space for old magazine - dropped to ground - exit");
472 }
473 else
474 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine - exit");
475
476 }
477 else
478 {
480 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
481
483 {
484 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, ok - old magazine removed from wpn (LHand->inv) - exit");
485 }
486 else
487 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, error - cannot remove old mag from wpn - exit");
488 }
489 }
490
493 m_newDst = NULL;
494 }

References DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_oldMagazine, m_weapon, and wpnDebugPrint().

◆ OnExit() [31/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 46 of file WeaponStartAction.c.

47 {
48 super.OnExit(e);
49 }

◆ OnExit() [32/34]

void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 142 of file WeaponStateBase.c.

143 {
144 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } " + this.Type().ToString());
145 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ OnExit() [33/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 110 of file WeaponUnjamming.c.

111 {
112 m_type = string.Empty;
113 super.OnExit(e);
114 }

References string::Empty.

◆ OnExit() [34/34]

override void WeaponStateBase::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 225 of file WeaponUnjamming.c.

226 {
227 m_dtAccumulator = 0.0;
228 m_jamTime = 0.0;
229 super.OnExit(e);
230 }

References m_dtAccumulator.

◆ OnStateChanged()

WeaponStateBase::OnStateChanged ( WeaponStateBase src,
WeaponStateBase dst )
inlineprivate

called on current state when state machine has changed its state

Parameters
[in]srcfrom state (previous)
[in]dstto state (current)

Definition at line 176 of file WeaponStateBase.c.

176{ }

◆ OnSubMachineChanged()

WeaponStateBase::OnSubMachineChanged ( WeaponStateBase src,
WeaponStateBase dst )
inlineprivate

called when sub-machine has changed its state

Parameters
[in]srcfrom state (previous)
[in]dstto state (current)

Definition at line 169 of file WeaponStateBase.c.

169{ }

◆ OnUpdate() [1/3]

override void WeaponStateBase::OnUpdate ( float dt)
inlineprivate

Definition at line 38 of file WeaponFireAndChamberNext.c.

39 {
42 Class.CastTo(p, m_weapon.GetHierarchyParent());
43 if (p)
44 {
45 HumanInputController hic = p.GetInputController();
46
47 int muzzleIndex = m_weapon.GetCurrentMuzzle();
48 float reloadTime = m_weapon.GetReloadTime(muzzleIndex);
49
50 if (m_dtAccumulator >= reloadTime && (hic.IsAttackButton() || (m_weapon.GetBurstCount() < m_weapon.GetCurrentModeBurstSize(muzzleIndex))))
51 {
52 if (m_weapon.CanProcessWeaponEvents())
53 m_weapon.ProcessWeaponEvent(new WeaponEventReloadTimeout(p));
54 }
55 }
56 }

References Class::CastTo(), m_dtAccumulator, and m_weapon.

◆ OnUpdate() [2/3]

override void WeaponStateBase::OnUpdate ( float dt)
inlineprivate

Definition at line 38 of file WeaponFireAndChamberNextFromInnerMag.c.

39 {
42 Class.CastTo(p, m_weapon.GetHierarchyParent());
43 if (p)
44 {
45 HumanInputController hic = p.GetInputController();
46
47 int muzzleIndex = m_weapon.GetCurrentMuzzle();
48 float reloadTime = m_weapon.GetReloadTime(muzzleIndex);
49 if (hic.IsAttackButton() && m_dtAccumulator >= reloadTime)
50 if (m_weapon.CanProcessWeaponEvents())
51 m_weapon.ProcessWeaponEvent(new WeaponEventReloadTimeout(p));
52 }
53 }

References Class::CastTo(), m_dtAccumulator, and m_weapon.

◆ OnUpdate() [3/3]

void WeaponStateBase::OnUpdate ( float dt)
inlineprivate

Definition at line 118 of file WeaponStateBase.c.

119 {
120 if (HasFSM() && m_fsm.IsRunning())
121 m_fsm.GetCurrentState().OnUpdate(dt);
122 }

References HasFSM(), and m_fsm.

◆ ProcessEvent()

bool WeaponStateBase::ProcessEvent ( WeaponEventBase e)
inlineprivate

Definition at line 80 of file WeaponStateBase.c.

81 {
82 if (HasFSM())
83 return m_fsm.ProcessEvent(e);
84 return false;
85 }

References HasFSM(), and m_fsm.

◆ RemoveNewMagazineFromInventory()

void WeaponStateBase::RemoveNewMagazineFromInventory ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate

Definition at line 6 of file WeaponAttachMagazine.c.

7 {
10 }

◆ RifleChambering()

void WeaponStateBase::RifleChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 12 of file RifleChambering.c.

13 {
16
17 // setup nested state machine
22 // events
23 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
24 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
25 WeaponEventAnimBulletInChamber __bc_ = new WeaponEventAnimBulletInChamber;
26 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
27
28 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
29 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
30 m_fsm.AddTransition(new WeaponTransition(m_eject, __bs_, m_chamber));
31 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bc_, m_w4t));
32 m_fsm.AddTransition(new WeaponTransition(m_w4t, _fin_, NULL));
33
34 // Safety exits
35 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
36 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, null));
37 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
38
39 m_fsm.SetInitialState(m_start);
40 }
ref WeaponChambering_W4T m_w4t

References m_action, m_chamber, m_eject, m_start, m_weapon, and WeaponEjectCasing().

◆ RifleEjectCasing()

void WeaponStateBase::RifleEjectCasing ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 10 of file RifleEjectCasing.c.

11 {
14
15 // setup nested state machine
18 m_hideB = new BulletHide_W4T(m_weapon, this);
19
20 // events
21 WeaponEventBase __be_ = new WeaponEventAnimBulletEject;
22 WeaponEventBase __bh_ = new WeaponEventAnimBulletHide;
23 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
24
25 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
26
27 // transitions
28 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
29 m_fsm.AddTransition(new WeaponTransition(m_eject, __bh_, m_hideB));
30 m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, NULL));
31
32 // Safety exits
33 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, null));
34 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
35
36 m_fsm.SetInitialState(m_start);
37 }
void WeaponStartAction(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
specific action sub-type

References m_action, m_eject, m_start, m_weapon, WeaponEjectCasing(), and WeaponStartAction().

◆ RifleReChambering()

void WeaponStateBase::RifleReChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 13 of file RifleReChambering.c.

14 {
17
18 // setup nested state machine
23 // events
24 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
25 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
26 WeaponEventAnimBulletInChamber __bc_ = new WeaponEventAnimBulletInChamber;
27 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
28
29 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
30 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
31 m_fsm.AddTransition(new WeaponTransition(m_eject, __bs_, m_chamber));
32 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bc_, m_w4t));
33 m_fsm.AddTransition(new WeaponTransition(m_w4t, _fin_, NULL));
34
35 // Safety exits
36 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
37 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, null));
38 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
39
40 m_fsm.SetInitialState(m_start);
41 }

References m_action, m_chamber, m_eject, m_start, and m_weapon.

◆ SaveCurrentFSMState() [1/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 74 of file RifleChambering.c.

75 {
76 if (!super.SaveCurrentFSMState(ctx))
77 return false;
78
79 if (!ctx.Write(m_srcMagazine))
80 {
81 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RifleChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
82 return false;
83 }
84 return true;
85 }

References Error(), m_srcMagazine, and m_weapon.

◆ SaveCurrentFSMState() [2/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 86 of file RifleReChambering.c.

87 {
88 if (!super.SaveCurrentFSMState(ctx))
89 return false;
90
91 if (!ctx.Write(m_dstMagazine))
92 {
93 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber.SaveCurrentFSMState: cannot save m_dstMagazine for weapon=" + m_weapon);
94 return false;
95 }
96 if (!ctx.Write(m_srcMagazine))
97 {
98 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
99 return false;
100 }
101 return true;
102 }

References Error(), m_srcMagazine, and m_weapon.

◆ SaveCurrentFSMState() [3/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 63 of file WeaponAttachMagazine.c.

64 {
65 if (!super.SaveCurrentFSMState(ctx))
66 return false;
67
68 if (!ctx.Write(m_newMagazine))
69 {
70 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" + m_weapon);
71 return false;
72 }
73
75 {
76 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory.SaveCurrentFSMState: cannot write m_newSrc for weapon=" + m_weapon);
77 return false;
78 }
79 return true;
80 }
bool OptionalLocationWriteToContext(InventoryLocation loc, notnull ParamsWriteContext ctx)

References Error(), m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [4/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

source of the cartridge

Definition at line 27 of file WeaponChambering.c.

28 {
29 if (!super.SaveCurrentFSMState(ctx))
30 return false;
31
32 if (!ctx.Write(m_damage))
33 {
34 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot write m_damage for weapon=" + m_weapon);
35 return false;
36 }
37 if (!ctx.Write(m_type))
38 {
39 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot write m_type for weapon=" + m_weapon);
40 return false;
41 }
42 if (!ctx.Write(m_magazineType))
43 {
44 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot write m_magazineType for weapon=" + m_weapon);
45 return false;
46 }
47 if (!ctx.Write(m_srcMagazine))
48 {
49 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot write m_srcMagazine for weapon=" + m_weapon);
50 return false;
51 }
52 return true;
53 }

References Error(), m_srcMagazine, and m_weapon.

◆ SaveCurrentFSMState() [5/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 568 of file WeaponChambering.c.

569 {
570 if (!super.SaveCurrentFSMState(ctx))
571 return false;
572
573 if (!ctx.Write(m_srcMagazine))
574 {
575 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
576 return false;
577 }
578
580 {
581 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
582 return false;
583 }
584 return true;
585 }

References Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [6/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 1140 of file WeaponChambering.c.

1141 {
1142 if (!super.SaveCurrentFSMState(ctx))
1143 return false;
1144
1145 if (!ctx.Write(m_srcMagazine))
1146 {
1147 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
1148 return false;
1149 }
1150
1152 {
1153 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
1154 return false;
1155 }
1156
1157 return true;
1158 }

References Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [7/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 226 of file WeaponChamberingLooped.c.

227 {
228 if (!super.SaveCurrentFSMState(ctx))
229 return false;
230
231 if (!ctx.Write(m_srcMagazine))
232 {
233 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
234 return false;
235 }
236
238 {
239 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
240 return false;
241 }
242
243 return true;
244 }

References Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [8/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 484 of file WeaponChamberingLooped.c.

485 {
486 if (!super.SaveCurrentFSMState(ctx))
487 return false;
488
489 if (!ctx.Write(m_srcMagazine))
490 {
491 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
492 return false;
493 }
494
496 {
497 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
498 return false;
499 }
500 return true;
501 }

References Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [9/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 107 of file WeaponCharging.c.

108 {
109 if (!super.SaveCurrentFSMState(ctx))
110 return false;
111
112 if (!ctx.Write(m_dstMagazine))
113 {
114 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponEjectBullet_Cartridge.SaveCurrentFSMState: cannot write m_dstMagazine for weapon=" + m_weapon);
115 return false;
116 }
117 return true;
118 }

References Error(), and m_weapon.

◆ SaveCurrentFSMState() [10/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 167 of file WeaponCharging.c.

168 {
169 if (!super.SaveCurrentFSMState(ctx))
170 return false;
171
172 if (!ctx.Write(m_dstMagazine))
173 {
174 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponEjectBullet_Cartridge.SaveCurrentFSMState: cannot write m_dstMagazine for weapon=" + m_weapon);
175 return false;
176 }
177 return true;
178 }

References Error(), and m_weapon.

◆ SaveCurrentFSMState() [11/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 54 of file WeaponDetachingMag.c.

55 {
56 if (!super.SaveCurrentFSMState(ctx))
57 return false;
58
59 if (!ctx.Write(m_magazine))
60 {
61 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store.SaveCurrentFSMState: cannot write m_magazine for weapon=" + m_weapon);
62 return false;
63 }
64
66 {
67 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store.SaveCurrentFSMState: cannot write m_st for weapon=" + m_weapon);
68 return false;
69 }
70 return true;
71 }

References Error(), m_dst, m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [12/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 160 of file WeaponDetachingMag.c.

161 {
162 if (!super.SaveCurrentFSMState(ctx))
163 return false;
164
165 if (!ctx.Write(m_magazine))
166 {
167 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag.SaveCurrentFSMState: cannot write m_magazine for weapon=" + m_weapon);
168 return false;
169 }
170
172 {
173 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag.SaveCurrentFSMState: cannot write m_st for weapon=" + m_weapon);
174 return false;
175 }
176 return true;
177 }

References Error(), m_dst, m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [13/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 112 of file WeaponEjectBullet.c.

113 {
114 if (!super.SaveCurrentFSMState(ctx))
115 return false;
116
117 if (!ctx.Write(m_dstMagazine))
118 {
119 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponEjectBullet.LoadCurrentFSMState: cannot write m_dstMagazine for weapon=" + m_weapon);
120 return false;
121 }
122 return true;
123 }

References Error(), and m_weapon.

◆ SaveCurrentFSMState() [14/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 68 of file WeaponReChamber.c.

69 {
70 if (!super.SaveCurrentFSMState(ctx))
71 return false;
72
73 if (!ctx.Write(m_dstMagazine))
74 {
75 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot save m_dstMagazine for weapon=" + m_weapon);
76 return false;
77 }
78 if (!ctx.Write(m_srcMagazine))
79 {
80 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
81 return false;
82 }
83 return true;
84 }

References Error(), m_srcMagazine, and m_weapon.

◆ SaveCurrentFSMState() [15/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 65 of file WeaponReplacingMagAndChamberNext.c.

66 {
67 if (!super.SaveCurrentFSMState(ctx))
68 return false;
69
70 if (!ctx.Write(m_oldMagazine))
71 {
72 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.SaveCurrentFSMState: cannot write m_oldMagazine for weapon=" + m_weapon);
73 return false;
74 }
75
76
78 {
79 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" + m_weapon);
80 return false;
81 }
82
83 return true;
84 }

References Error(), m_oldMagazine, m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [16/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 169 of file WeaponReplacingMagAndChamberNext.c.

170 {
171 if (!super.SaveCurrentFSMState(ctx))
172 return false;
173
174 if (!ctx.Write(m_newMagazine))
175 {
176 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " SwapOldAndNewMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" + m_weapon);
177 return false;
178 }
179
181 {
182 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " SwapOldAndNewMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" + m_weapon);
183 return false;
184 }
185
186 return true;
187 }

References Error(), m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [17/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 286 of file WeaponReplacingMagAndChamberNext.c.

287 {
288 if (!super.SaveCurrentFSMState(ctx))
289 return false;
290
291 if (!ctx.Write(m_newMagazine))
292 {
293 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " AttachNewMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" + m_weapon);
294 return false;
295 }
296
298 {
299 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " AttachNewMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" + m_weapon);
300 return false;
301 }
302 return true;
303 }

References Error(), m_weapon, and OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [18/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 539 of file WeaponReplacingMagAndChamberNext.c.

540 {
541 if (!super.SaveCurrentFSMState(ctx))
542 return false;
543
544 if (!ctx.Write(m_newMagazine))
545 {
546 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" + m_weapon);
547 return false;
548 }
549
550 if (!ctx.Write(m_oldMagazine))
551 {
552 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.SaveCurrentFSMState: cannot write m_oldMagazine for weapon=" + m_weapon);
553 return false;
554 }
555
556 if (!m_newDst.WriteToContext(ctx))
557 {
558 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" + m_weapon);
559 return false;
560 }
561
562 return true;
563 }

References Error(), m_oldMagazine, and m_weapon.

◆ SaveCurrentFSMState() [19/20]

bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 34 of file WeaponStateBase.c.

35 {
36 if (HasFSM())
37 {
38 if (IsIdle())
39 {
40 if (LogManager.IsWeaponLogEnable()) wpnDebugSpam("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponStateBase::SaveCurrentFSMState - idle state, skipping other substates");
41 return m_fsm.SaveCurrentFSMState(ctx);
42 }
43 else
44 {
45 // if parent state is !idle (unstable) then save whole machine
46 if (LogManager.IsWeaponLogEnable()) wpnDebugSpam("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponStateBase::SaveCurrentFSMState - NOT idle state, saving full submachine state");
47 return m_fsm.SaveCurrentUnstableFSMState(ctx);
48 }
49 return false;
50 }
51 return true;
52 }

References HasFSM(), IsIdle(), LogManager::IsWeaponLogEnable(), m_fsm, m_weapon, and wpnDebugSpam().

◆ SaveCurrentFSMState() [20/20]

override bool WeaponStateBase::SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

Definition at line 116 of file WeaponUnjamming.c.

117 {
118 if (!super.SaveCurrentFSMState(ctx))
119 return false;
120
121 if (!ctx.Write(m_damage))
122 {
123 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponUnjamming_Cartridge.SaveCurrentFSMState: cannot write m_damage for weapon=" + m_weapon);
124 return false;
125 }
126 if (!ctx.Write(m_type))
127 {
128 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponUnjamming_Cartridge.SaveCurrentFSMState: cannot write m_type for weapon=" + m_weapon);
129 return false;
130 }
131 return true;
132 }

References Error(), and m_weapon.

◆ SetInternalStateID()

void WeaponStateBase::SetInternalStateID ( int i)
inlineprivate

Definition at line 31 of file WeaponStateBase.c.

31{ m_InternalID = i; }

References m_InternalID.

◆ SetParentState()

WeaponStateBase::SetParentState ( WeaponStateBase parent)
inlineprivate

allows construction of hierarchical state machine

Definition at line 22 of file WeaponStateBase.c.

22{ m_parentState = parent; }

References m_parentState.

◆ WeaponAttachMagazine()

void WeaponStateBase::WeaponAttachMagazine ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 125 of file WeaponAttachMagazine.c.

126 {
129
130 // setup nested state machine
135 m_onCK = new WeaponCharging_CK(m_weapon, this);
136
137 // events: MS, MA, BE, CK
138 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
139 WeaponEventBase __ms_ = new WeaponEventAnimMagazineShow;
140 WeaponEventBase __so_ = new WeaponEventAnimSliderOpen;
141 WeaponEventBase __ma_ = new WeaponEventAnimMagazineAttached;
142 WeaponEventBase __ck_ = new WeaponEventAnimCocked;
143
144 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
145
146 m_fsm.AddTransition(new WeaponTransition(m_start, __ms_, m_attach));
147 m_fsm.AddTransition(new WeaponTransition(m_start, __so_, m_eject));
148 m_fsm.AddTransition(new WeaponTransition(m_eject, __ms_, m_attach));
149 m_fsm.AddTransition(new WeaponTransition(m_attach, __ck_, m_chamber, NULL, new GuardAnd(new WeaponGuardCurrentChamberEmpty(m_weapon), new WeaponGuardHasAmmo(m_weapon)))); // when opened, there is no __be_ event
150 m_fsm.AddTransition(new WeaponTransition(m_attach, __ck_, m_onCK, NULL, new GuardAnd(new WeaponGuardCurrentChamberEmpty(m_weapon), new GuardNot(new WeaponGuardHasAmmo(m_weapon)))));
151 m_fsm.AddTransition(new WeaponTransition(m_attach, _fin_, NULL));
152 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, NULL));
153 m_fsm.AddTransition(new WeaponTransition(m_onCK, _fin_, NULL));
154
155 // Safety exits
156 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, null));
157 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
158
159
160 m_fsm.SetInitialState(m_start);
161 }
void WeaponGuardHasAmmo(Weapon_Base w=NULL)
Definition Guards.c:99
void AttachNewMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
ref WeaponCharging_CK m_onCK

References AttachNewMagazine(), m_action, m_chamber, m_eject, m_start, m_weapon, WeaponEjectCasing(), WeaponGuardHasAmmo(), and WeaponStartAction().

◆ WeaponChamberFromAttMag()

void WeaponStateBase::WeaponChamberFromAttMag ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
int action = -1,
int actionType = -1 )
inlineprivate

Definition at line 5 of file WeaponChamberFromAttMag.c.

6 { }

◆ WeaponChamberFromAttMagOnExit()

void WeaponStateBase::WeaponChamberFromAttMagOnExit ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
int action = -1,
int actionType = -1 )
inlineprivate

Definition at line 49 of file WeaponChamberFromAttMag.c.

50 { }

◆ WeaponChamberFromInnerMag()

void WeaponStateBase::WeaponChamberFromInnerMag ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
int action = -1,
int actionType = -1 )
inlineprivate

Definition at line 28 of file WeaponChamberFromAttMag.c.

29 { }

◆ WeaponChambering()

void WeaponStateBase::WeaponChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 375 of file WeaponChambering.c.

376 {
379
380 // setup nested state machine
385 m_onCK = new WeaponCharging_CK(m_weapon, this);
386 // events
387 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
388 WeaponEventAnimBulletInChamber __bc_ = new WeaponEventAnimBulletInChamber;
389 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
390 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
391 WeaponEventAnimCocked __ck_ = new WeaponEventAnimCocked;
392
393 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
394 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
395 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_onCK));
396 m_fsm.AddTransition(new WeaponTransition(m_start, __bs_, m_chamber));
397 m_fsm.AddTransition(new WeaponTransition(m_onCK, __be_, m_eject));
398 m_fsm.AddTransition(new WeaponTransition(m_onCK, __bs_, m_chamber));
399 m_fsm.AddTransition(new WeaponTransition(m_eject, __bs_, m_chamber));
400 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bc_, m_w4t));
401 m_fsm.AddTransition(new WeaponTransition(m_w4t, _fin_, null));
402
403 // Safety exits
404 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
405 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, null));
406 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
407
408 m_fsm.SetInitialState(m_start);
409 }

References m_action, m_chamber, m_eject, m_start, m_weapon, and WeaponEjectCasing().

Referenced by WeaponRechamber().

◆ WeaponCharging()

void WeaponStateBase::WeaponCharging ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 15 of file WeaponCharging.c.

16 {
19
20 // setup nested state machine
24 m_ejectChamber = new WeaponEjectAndChamberFromAttMag(m_weapon, this);
26
27 // events
28 WeaponEventBase __be_ = new WeaponEventAnimBulletEject;
29 WeaponEventBase __bh_ = new WeaponEventAnimBulletHide;
30 WeaponEventBase __ck_ = new WeaponEventAnimCocked;
31 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
32
33 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
34 // transitions
36 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
37 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, NULL));
38
39 //m_fsm.AddTransition(new WeaponTransition( m_start, __ck_, m_eject, NULL, new GuardNot(new WeaponGuardCurrentChamberEmpty(m_weapon))));
40 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_chamber, NULL, new WeaponGuardHasAmmo(m_weapon))); // some anims do not send BE event
41 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_onCK)); // some anims do not send BE event
42
43 m_fsm.AddTransition(new WeaponTransition(m_ejectChamber, __ck_, m_onCK));
44 m_fsm.AddTransition(new WeaponTransition(m_ejectChamber, _fin_, NULL));
45 m_fsm.AddTransition(new WeaponTransition(m_eject, __ck_, m_onCK));
46 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, NULL));
47
48 m_fsm.AddTransition(new WeaponTransition(m_onCK, _fin_, NULL));
49
50 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, NULL));
51
52 m_fsm.SetInitialState(m_start);
53 }
ref WeaponEjectAndChamberFromAttMag m_ejectChamber
void WeaponEjectAllMuzzles(Weapon_Base w=NULL, WeaponStateBase parent=NULL)

References m_action, m_chamber, m_eject, m_start, m_weapon, and WeaponGuardHasAmmo().

◆ WeaponChargingInnerMag()

void WeaponStateBase::WeaponChargingInnerMag ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 216 of file WeaponCharging.c.

217 {
220
221 // setup nested state machine
225 m_hideB = new BulletHide_W4T(m_weapon, this);
226 m_onCK = new WeaponCharging_CK(m_weapon, this);
228
229 // events
230 WeaponEventBase __be_ = new WeaponEventAnimBulletEject;
231 WeaponEventBase __bh_ = new WeaponEventAnimBulletHide;
232 WeaponEventBase __ck_ = new WeaponEventAnimCocked;
233 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
234
235 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
236 // transitions
237 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_onBEFireOut, NULL, new WeaponGuardCurrentChamberFiredOut(m_weapon)));
238 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_onBE, NULL, new GuardNot(new WeaponGuardCurrentChamberEmpty(m_weapon))));
239 m_fsm.AddTransition(new WeaponTransition(m_onBE, __bh_, m_hideB));
240 m_fsm.AddTransition(new WeaponTransition(m_onBEFireOut, __bh_, m_hideB));
241
242 //TODO after inner magazine rework this events must load new bullet
243
244 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_onBEFireOut, NULL, new GuardAnd(new GuardNot(new WeaponGuardCurrentChamberEmpty(m_weapon)), new WeaponGuardCurrentChamberFiredOut(m_weapon))));
245 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_onBE, NULL, new GuardNot(new WeaponGuardCurrentChamberEmpty(m_weapon))));
246 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_chamber, NULL, new WeaponGuardHasAmmoInnerMagazine(m_weapon))); // some anims do not send BE event
247 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_onCK)); // some anims do not send BE event
248 m_fsm.AddTransition(new WeaponTransition(m_onBE, __ck_, m_chamber, NULL, new WeaponGuardHasAmmoInnerMagazine(m_weapon)));
249 m_fsm.AddTransition(new WeaponTransition(m_onBE, __ck_, m_onCK));
250 m_fsm.AddTransition(new WeaponTransition(m_onBEFireOut, __ck_, m_chamber, NULL, new WeaponGuardHasAmmoInnerMagazine(m_weapon)));
251 m_fsm.AddTransition(new WeaponTransition(m_onBEFireOut, __ck_, m_onCK));
252 m_fsm.AddTransition(new WeaponTransition(m_hideB, __ck_, m_chamber, NULL, new WeaponGuardHasAmmoInnerMagazine(m_weapon)));
253 m_fsm.AddTransition(new WeaponTransition(m_hideB, __ck_, m_onCK));
254
255 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, NULL));
256 m_fsm.AddTransition(new WeaponTransition(m_onBEFireOut, _fin_, NULL));
257 m_fsm.AddTransition(new WeaponTransition(m_onBE, _fin_, NULL));
258 m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, NULL));
259 m_fsm.AddTransition(new WeaponTransition(m_onCK, _fin_, NULL));
260 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, NULL));
261
262 m_fsm.SetInitialState(m_start);
263 }
ref WeaponEjectBullet_Cartridge_W4T m_onBE
ref WeaponEjectCasing_W4T m_onBEFireOut

References m_action, m_chamber, m_start, and m_weapon.

◆ WeaponChargingMultiple()

void WeaponStateBase::WeaponChargingMultiple ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 291 of file WeaponCharging.c.

292 {
295
296 // setup nested state machine
300 m_hideB = new BulletHide_W4T(m_weapon, this);
301 m_onCK = new WeaponCharging_CK(m_weapon, this);
303
304 // events
305 WeaponEventBase __be_ = new WeaponEventAnimBulletEject;
306 WeaponEventBase __bh_ = new WeaponEventAnimBulletHide;
307 WeaponEventBase __ck_ = new WeaponEventAnimCocked;
308 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
309
310 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
311 // transitions
312 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_onBEFireOut, NULL, new WeaponGuardCurrentChamberFiredOut(m_weapon)));
313 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_onBE, NULL, new GuardNot(new WeaponGuardCurrentChamberEmpty(m_weapon))));
314 m_fsm.AddTransition(new WeaponTransition(m_onBE, __bh_, m_hideB));
315 m_fsm.AddTransition(new WeaponTransition(m_onBEFireOut, __bh_, m_hideB));
316
317 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_onBE, NULL, new GuardNot(new WeaponGuardCurrentChamberEmpty(m_weapon))));
318 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_chamber, NULL, new WeaponGuardHasAmmo(m_weapon))); // some anims do not send BE event
319 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_onCK)); // some anims do not send BE event
321 m_fsm.AddTransition(new WeaponTransition(m_onBE, __ck_, m_onCK));
323 m_fsm.AddTransition(new WeaponTransition(m_onBEFireOut, __ck_, m_onCK));
325 m_fsm.AddTransition(new WeaponTransition(m_hideB, __ck_, m_onCK));
326
327 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, NULL));
328 m_fsm.AddTransition(new WeaponTransition(m_onBEFireOut, _fin_, NULL));
329 m_fsm.AddTransition(new WeaponTransition(m_onBE, _fin_, NULL));
330 m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, NULL));
331 m_fsm.AddTransition(new WeaponTransition(m_onCK, _fin_, NULL));
332 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, NULL));
333
334 m_fsm.SetInitialState(m_start);
335 }

References m_action, m_chamber, m_start, m_weapon, and WeaponGuardHasAmmo().

◆ WeaponChargingStretch()

void WeaponStateBase::WeaponChargingStretch ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 358 of file WeaponCharging.c.

359 {
362
363 // setup nested state machine
365 m_onCK = new WeaponCharging_CK(m_weapon, this);
366
367 // events
368 WeaponEventBase __ck_ = new WeaponEventAnimCocked;
369 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
370
371 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
372 // transitions
373 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, NULL));
374 m_fsm.AddTransition(new WeaponTransition(m_start, __ck_, m_onCK)); // some anims do not send BE event
375 m_fsm.AddTransition(new WeaponTransition(m_onCK, _fin_, NULL));
376
377 m_fsm.SetInitialState(m_start);
378 }

References m_action, m_start, and m_weapon.

◆ WeaponDetachingMag()

void WeaponStateBase::WeaponDetachingMag ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 108 of file WeaponDetachingMag.c.

109 {
112
113 // setup nested state machine
116 m_hideM = new MagazineHide_W4T(m_weapon, this);
117 // events
118 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
119 WeaponEventBase __md_ = new WeaponEventAnimMagazineDetached;
120 WeaponEventBase __mh_ = new WeaponEventAnimMagazineHide;
121
122 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
123 m_fsm.AddTransition(new WeaponTransition(m_start, __md_, m_store));
124 m_fsm.AddTransition(new WeaponTransition(m_store, __mh_, m_hideM));
125 m_fsm.AddTransition(new WeaponTransition(m_hideM, _fin_, NULL));
126
127 // Safety exits
128 m_fsm.AddTransition(new WeaponTransition(m_store, _fin_, null));
129 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
130
131 m_fsm.SetInitialState(m_start);
132 }
ref MagazineHide_W4T m_hideM

References m_action, m_start, and m_weapon.

◆ WeaponEjectAllMuzzles()

void WeaponStateBase::WeaponEjectAllMuzzles ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate

Definition at line 57 of file WeaponEjectCasingAndChamberFromAttMag.c.

57{ }

Referenced by WeaponMagnumChambering().

◆ WeaponEjectBullet()

void WeaponStateBase::WeaponEjectBullet ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 50 of file WeaponEjectBullet.c.

51 {
54
55 // setup nested state machine
57 m_eject = new WeaponEjectBullet_Cartridge_W4T(m_weapon, this); // @TODO: workaround for missing BH event (_W4T)
58 m_hideB = new BulletHide_W4T(m_weapon, this);
60
61 // events
62 WeaponEventBase __be_ = new WeaponEventAnimBulletEject;
63 WeaponEventBase __bh_ = new WeaponEventAnimBulletHide;
64 WeaponEventBase __ck_ = new WeaponEventAnimCocked;
65 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
66
67 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
68 // transitions
69 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
70 m_fsm.AddTransition(new WeaponTransition(m_eject, __bh_, m_hideB));
71
74
75 m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, NULL));
76 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, NULL)); // @TODO: workaround for missing BH event
77 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, NULL));
78
79 // Safety exits
80 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
81
82 m_fsm.SetInitialState(m_start);
83 }

References m_action, m_chamber, m_eject, m_start, m_weapon, and WeaponGuardHasAmmo().

Referenced by WeaponRechamber().

◆ WeaponEjectCasing()

void WeaponStateBase::WeaponEjectCasing ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate

◆ WeaponEjectCasingMultiMuzzle()

void WeaponStateBase::WeaponEjectCasingMultiMuzzle ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate

Definition at line 23 of file WeaponEjectCasingAndChamberFromAttMag.c.

23{ }

Referenced by ChamberMultiBullet().

◆ WeaponFireAndChamberNext()

void WeaponStateBase::WeaponFireAndChamberNext ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 9 of file WeaponFireAndChamberNext.c.

10 {
13
14 // setup nested state machine
16
17 // events
18 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
19 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
20 WeaponEventReloadTimeout __to_ = new WeaponEventReloadTimeout;
21
22 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
23
24 // transitions
25 m_fsm.AddTransition(new WeaponTransition(m_fire, _fin_, NULL));
26 m_fsm.AddTransition(new WeaponTransition(m_fire, __to_, NULL));
27
28 m_fsm.SetInitialState(m_fire);
29 }

References m_action, and m_weapon.

◆ WeaponFireAndChamberNextFromInnerMag()

void WeaponStateBase::WeaponFireAndChamberNextFromInnerMag ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 9 of file WeaponFireAndChamberNextFromInnerMag.c.

10 {
13
14 // setup nested state machine
16
17 // events
18 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
19 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
20 WeaponEventReloadTimeout __to_ = new WeaponEventReloadTimeout;
21
22 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
23
24 // transitions
25 m_fsm.AddTransition(new WeaponTransition(m_fire, _fin_, NULL));
26 m_fsm.AddTransition(new WeaponTransition(m_fire, __to_, NULL));
27
28 m_fsm.SetInitialState(m_fire);
29 }

References m_action, and m_weapon.

◆ WeaponFireLast()

void WeaponStateBase::WeaponFireLast ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 10 of file WeaponFireLast.c.

11 {
14
15 // setup nested state machine
17
18 // events
19 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
20 WeaponEventReloadTimeout __to_ = new WeaponEventReloadTimeout;
21
22 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
23
24 // transitions
25 m_fsm.AddTransition(new WeaponTransition(m_fire, _fin_, NULL));
26 m_fsm.AddTransition(new WeaponTransition(m_fire, __to_, NULL));
27
28 m_fsm.SetInitialState(m_fire);
29 }

References m_action, and m_weapon.

◆ WeaponMagnumChambering()

void WeaponStateBase::WeaponMagnumChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int startActionType = -1,
int endActionType = -1 )
inlineprivate

Definition at line 933 of file WeaponChambering.c.

934 {
938
939 // setup nested state machine
945 m_hideB = new BulletHide_W4T(m_weapon, this);
946 m_endLoop = new LoopedChambering_EndLoop(m_weapon, this, m_action, m_endActionType); // @NOTE: termination playing action - dummy?
947 // events
948 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
949 WeaponEventContinuousLoadBulletStart __lS_ = new WeaponEventContinuousLoadBulletStart;
950 WeaponEventContinuousLoadBulletEnd __lE_ = new WeaponEventContinuousLoadBulletEnd;
951 WeaponEventCylinderRotate __cr_ = new WeaponEventCylinderRotate;
952 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
953 WeaponEventAnimBulletHide __bh_ = new WeaponEventAnimBulletHide;
954 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
955 WeaponEventAnimBulletInMagazine __bM_ = new WeaponEventAnimBulletInMagazine;
956 WeaponEventAnimBulletShow2 _bs2_ = new WeaponEventAnimBulletShow2;
957
958 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
959 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
960 m_fsm.AddTransition(new WeaponTransition(m_start, __cr_, m_rotate));
961
962 m_fsm.AddTransition(new WeaponTransition(m_eject, __cr_, m_rotate));
963 m_fsm.AddTransition(new WeaponTransition(m_rotate, __be_, m_eject));
964
965 m_fsm.AddTransition(new WeaponTransition(m_eject, __bs_, m_chamber));
966 m_fsm.AddTransition(new WeaponTransition(m_rotate, __bs_, m_chamber));
967
968 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_w4sb2, null, new GuardAnd(new GuardAnd(new WeaponGuardHasAmmoInLoopedState(m_chamber), new WeaponGuardChamberMultiHasRoomBulltet(m_weapon)), new WeaponGuardWeaponManagerWantContinue())));
969 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_endLoop));
970 //m_fsm.AddTransition(new WeaponTransition(m_rotate, __bh_, m_chamber));
971 //m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __bh_, m_hideB));
972 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __cr_, m_rotate));
973
974 m_fsm.AddTransition(new WeaponTransition(m_endLoop, _fin_, null));
975
976 // Safety exits
977 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, _fin_, null));
978 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
979 m_fsm.AddTransition(new WeaponTransition(m_rotate, _fin_, null));
980 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, null));
981 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
982
983 m_fsm.SetInitialState(m_start);
984 }
ref WeaponCylinderRotate m_rotate

References m_action, m_chamber, m_eject, m_endActionType, m_endLoop, m_start, m_startActionType, m_w4sb2, m_weapon, and WeaponEjectAllMuzzles().

◆ WeaponRechamber()

void WeaponStateBase::WeaponRechamber ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
int actionEject = -1,
int actionTypeEject = -1,
int actionLoad = -1,
int actionTypeLoad = -1 )
inlineprivate

Definition at line 15 of file WeaponReChamber.c.

16 {
21
22 // setup nested state machine
25 // events
26 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
27
28 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
29 m_fsm.AddTransition(new WeaponTransition(m_eje, _fin_, m_loa));
30 m_fsm.AddTransition(new WeaponTransition(m_loa, _fin_, NULL));
31
32 m_fsm.SetInitialState(m_eje);
33 }
void WeaponEjectBullet(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
void WeaponChambering(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)

References m_weapon, WeaponChambering(), and WeaponEjectBullet().

◆ WeaponReplacingMagAndChamberNext()

void WeaponStateBase::WeaponReplacingMagAndChamberNext ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 355 of file WeaponReplacingMagAndChamberNext.c.

356 {
360
361 // setup nested state machine
369 m_onCK = new WeaponCharging_CK(m_weapon, this);
370
371 // events
372 WeaponEventBase __so_ = new WeaponEventAnimSliderOpen;
373 WeaponEventBase __md_ = new WeaponEventAnimMagazineDetached;
374 WeaponEventBase __mh_ = new WeaponEventAnimMagazineHide;
375 WeaponEventBase __ms_ = new WeaponEventAnimMagazineShow;
376 WeaponEventBase __ma_ = new WeaponEventAnimMagazineAttached;
377 WeaponEventBase __ck_ = new WeaponEventAnimCocked;
378 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
379
380 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
381 m_fsm.AddTransition(new WeaponTransition(m_start, __md_, m_detach));
382 m_fsm.AddTransition(new WeaponTransition(m_start, __so_, m_eject));
383 m_fsm.AddTransition(new WeaponTransition(m_eject, __md_, m_detach));
384 m_fsm.AddTransition(new WeaponTransition(m_detach, __mh_, m_hideOld));
385 m_fsm.AddTransition(new WeaponTransition(m_hideOld, __ms_, m_swapMags));
386 m_fsm.AddTransition(new WeaponTransition(m_swapMags, __ma_, m_attach));
387 m_fsm.AddTransition(new WeaponTransition(m_attach, __ck_, m_chamber, NULL, new GuardAnd(new WeaponGuardCurrentChamberEmpty(m_weapon), new WeaponGuardHasAmmo(m_weapon))));
388 m_fsm.AddTransition(new WeaponTransition(m_attach, __ck_, m_onCK));
389
390 m_fsm.AddTransition(new WeaponTransition(m_attach, _fin_, NULL));
391 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, NULL));
392 m_fsm.AddTransition(new WeaponTransition(m_onCK, _fin_, NULL));
393
394 // Safety exits
395 m_fsm.AddTransition(new WeaponTransition(m_swapMags, _fin_, null));
396 m_fsm.AddTransition(new WeaponTransition(m_hideOld, _fin_, null));
397 m_fsm.AddTransition(new WeaponTransition(m_detach, _fin_, null));
398 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, null));
399 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
400
401 m_fsm.SetInitialState(m_start);
402 }
hides old magazine, but keep it in LH
old magazine to inventory, new to left hand
void DetachOldMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL)

References m_action, m_chamber, m_eject, m_start, m_weapon, and WeaponGuardHasAmmo().

◆ WeaponStartAction()

void WeaponStateBase::WeaponStartAction ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

specific action sub-type

Definition at line 9 of file WeaponStartAction.c.

10 {
13 }

References m_action.

Referenced by RifleEjectCasing(), and WeaponAttachMagazine().

◆ WeaponUnjamming()

void WeaponStateBase::WeaponUnjamming ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 180 of file WeaponUnjamming.c.

181 {
184
185 // setup nested state machine
186 m_start = new WeaponUnjamming_Start(m_weapon, this, m_action, m_actionType);
190
191 // events
192 WeaponEventBase _uto_ = new WeaponEventUnjammingTimeout;
193 WeaponEventBase _fto_ = new WeaponEventUnjammingFailedTimeout;
194 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
195 WeaponEventBase __uj_ = new WeaponEventAnimUnjammed;
196
197 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
198 // transitions
199 m_fsm.AddTransition(new WeaponTransition(m_start, _uto_, m_eject));
200 m_fsm.AddTransition(new WeaponTransition(m_start, _fto_, m_w4t));
202 m_fsm.AddTransition(new WeaponTransition(m_eject, _fin_, NULL));
203 m_fsm.AddTransition(new WeaponTransition(m_w4t, _fin_, NULL));
204 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, NULL));
205
206 // Safety exits
207 m_fsm.AddTransition(new WeaponTransition(m_start, _fin_, null));
208
209 m_fsm.SetInitialState(m_start);
210 }

References m_action, m_chamber, m_eject, m_start, m_weapon, and WeaponGuardHasAmmo().

Member Data Documentation

◆ m_action

WeaponActions WeaponStateBase::m_action
private

Definition at line 3 of file RifleChambering.c.

◆ m_actionEject

int WeaponStateBase::m_actionEject
private

Definition at line 5 of file WeaponReChamber.c.

◆ m_actionLoad

int WeaponStateBase::m_actionLoad
private

Definition at line 7 of file WeaponReChamber.c.

◆ m_actionType

int WeaponStateBase::m_actionType
private

action to be played

Definition at line 4 of file RifleChambering.c.

◆ m_actionTypeEject

int WeaponStateBase::m_actionTypeEject
private

Definition at line 6 of file WeaponReChamber.c.

◆ m_actionTypeLoad

int WeaponStateBase::m_actionTypeLoad
private

Definition at line 8 of file WeaponReChamber.c.

◆ m_attach [1/2]

ref AttachNewMagazine WeaponStateBase::m_attach
private

Definition at line 120 of file WeaponAttachMagazine.c.

◆ m_attach [2/2]

ref AttachNewMagazine_W4T WeaponStateBase::m_attach
private

Definition at line 345 of file WeaponReplacingMagAndChamberNext.c.

◆ m_chamber [1/4]

ref WeaponChamberFromAttMag_W4T WeaponStateBase::m_chamber
private

Definition at line 9 of file RifleChambering.c.

◆ m_chamber [2/4]

ref WeaponChamberFromAttMag_W4T WeaponStateBase::m_chamber
private

Definition at line 121 of file WeaponAttachMagazine.c.

◆ m_chamber [3/4]

ref WeaponChambering_Base WeaponStateBase::m_chamber
private

Definition at line 928 of file WeaponChambering.c.

◆ m_chamber [4/4]

ref WeaponChamberFromInnerMag_W4T WeaponStateBase::m_chamber
private

Definition at line 214 of file WeaponCharging.c.

◆ m_chamberFromInnerMag

ref WeaponChamberFromInnerMag_W4T WeaponStateBase::m_chamberFromInnerMag
private

Definition at line 280 of file WeaponChamberingLooped.c.

◆ m_damage

float WeaponStateBase::m_damage
private

Definition at line 22 of file WeaponChambering.c.

◆ m_detach

ref DetachOldMagazine WeaponStateBase::m_detach
private

Definition at line 342 of file WeaponReplacingMagAndChamberNext.c.

◆ m_dst

ref InventoryLocation WeaponStateBase::m_dst
private

magazine that will be detached

detached magazine

Definition at line 9 of file WeaponDetachingMag.c.

Referenced by OnEntry().

◆ m_dstMagazine

Magazine WeaponStateBase::m_dstMagazine
private

Definition at line 5 of file RifleReChambering.c.

Referenced by OnEntry().

◆ m_dtAccumulator

float WeaponStateBase::m_dtAccumulator
private

Definition at line 6 of file WeaponFireAndChamberNext.c.

◆ m_eje

ref WeaponEjectBullet WeaponStateBase::m_eje
private

source of the loaded cartridge

Definition at line 12 of file WeaponReChamber.c.

◆ m_eject [1/5]

ref WeaponEjectCasing WeaponStateBase::m_eject
private

Definition at line 8 of file RifleChambering.c.

◆ m_eject [2/5]

ref WeaponEjectBullet_Cartridge WeaponStateBase::m_eject
private

Definition at line 9 of file RifleReChambering.c.

◆ m_eject [3/5]

ref WeaponEjectAllMuzzles WeaponStateBase::m_eject
private

Definition at line 926 of file WeaponChambering.c.

◆ m_eject [4/5]

ref WeaponEjectBullet_Cartridge_W4T WeaponStateBase::m_eject
private

Definition at line 46 of file WeaponEjectBullet.c.

◆ m_eject [5/5]

ref WeaponUnjamming_Cartridge_W4T WeaponStateBase::m_eject
private

Definition at line 176 of file WeaponUnjamming.c.

◆ m_ejectChamber

ref WeaponEjectAndChamberFromAttMag WeaponStateBase::m_ejectChamber
private

Definition at line 12 of file WeaponCharging.c.

◆ m_endActionType

int WeaponStateBase::m_endActionType
private

Definition at line 921 of file WeaponChambering.c.

◆ m_endLoop

ref WeaponStartAction WeaponStateBase::m_endLoop
private

Definition at line 930 of file WeaponChambering.c.

◆ m_fire [1/2]

ref WeaponFire WeaponStateBase::m_fire
private

Definition at line 7 of file WeaponFireAndChamberNext.c.

◆ m_fire [2/2]

ref WeaponFireWithEject WeaponStateBase::m_fire
private

Definition at line 8 of file WeaponFireLast.c.

◆ m_fsm

ref WeaponFSM WeaponStateBase::m_fsm
private

hierarchical parent state of this state (or null)

Definition at line 14 of file WeaponStateBase.c.

Referenced by AddTransition(), GetFSM(), HasFSM(), IsWaitingForActionFinish(), LoadCurrentFSMState(), OnAbort(), OnEntry(), OnUpdate(), ProcessEvent(), and SaveCurrentFSMState().

◆ m_hideB

ref BulletHide_W4T WeaponStateBase::m_hideB
private

Definition at line 8 of file RifleEjectCasing.c.

◆ m_hideM

ref MagazineHide_W4T WeaponStateBase::m_hideM
private

Definition at line 106 of file WeaponDetachingMag.c.

◆ m_hideOld

ref OldMagazineHide WeaponStateBase::m_hideOld
private

Definition at line 343 of file WeaponReplacingMagAndChamberNext.c.

◆ m_InternalID

int WeaponStateBase::m_InternalID = -1
private

nested state machine (or null)

Definition at line 15 of file WeaponStateBase.c.

Referenced by GetInternalStateID(), and SetInternalStateID().

◆ m_jamTime

float WeaponStateBase::m_jamTime
private

Definition at line 173 of file WeaponUnjamming.c.

◆ m_loa

ref WeaponChambering WeaponStateBase::m_loa
private

Definition at line 13 of file WeaponReChamber.c.

◆ m_magazine

Magazine WeaponStateBase::m_magazine
private

Definition at line 8 of file WeaponDetachingMag.c.

Referenced by OnEntry().

◆ m_magazineType

string WeaponStateBase::m_magazineType
private

Definition at line 24 of file WeaponChambering.c.

◆ m_newDst

ref InventoryLocation WeaponStateBase::m_newDst
private

magazine that will be detached

magazine that will be attached

new magazine from inventory that will be attached

magazine that will be dropped on abort

Definition at line 8 of file WeaponReplacingMagAndChamberNext.c.

◆ m_newMagazine

Magazine WeaponStateBase::m_newMagazine
private

magazine that will be detached

Definition at line 3 of file WeaponAttachMagazine.c.

◆ m_newSrc

ref InventoryLocation WeaponStateBase::m_newSrc
private

magazine that will be removed from inventory

Definition at line 4 of file WeaponAttachMagazine.c.

◆ m_oldMagazine

Magazine WeaponStateBase::m_oldMagazine
private

Definition at line 7 of file WeaponReplacingMagAndChamberNext.c.

◆ m_onBE

ref WeaponEjectBullet_Cartridge_W4T WeaponStateBase::m_onBE
private

Definition at line 210 of file WeaponCharging.c.

◆ m_onBEFireOut

ref WeaponEjectCasing_W4T WeaponStateBase::m_onBEFireOut
private

Definition at line 211 of file WeaponCharging.c.

◆ m_onCK

ref WeaponCharging_CK WeaponStateBase::m_onCK
private

Definition at line 122 of file WeaponAttachMagazine.c.

◆ m_parentState

WeaponStateBase WeaponStateBase::m_parentState
private

weapon that this state relates to

Definition at line 13 of file WeaponStateBase.c.

Referenced by GetParentState(), SetParentState(), and WeaponStateBase().

◆ m_rotate

ref WeaponCylinderRotate WeaponStateBase::m_rotate
private

Definition at line 927 of file WeaponChambering.c.

◆ m_srcMagazine

Magazine WeaponStateBase::m_srcMagazine
private

destination of the ejected cartridge

Definition at line 5 of file RifleChambering.c.

Referenced by OnEntry().

◆ m_srcMagazinePrevLocation

ref InventoryLocation WeaponStateBase::m_srcMagazinePrevLocation
private

source of the cartridge

Definition at line 367 of file WeaponChambering.c.

◆ m_start [1/5]

ref WeaponStartAction WeaponStateBase::m_start
private

source of the cartridge

detached magazine destination

source of the loaded cartridge

Definition at line 7 of file RifleChambering.c.

◆ m_start [2/5]

ref WeaponStartAction WeaponStateBase::m_start
private

Definition at line 6 of file RifleEjectCasing.c.

◆ m_start [3/5]

ref WeaponCharging_Start WeaponStateBase::m_start
private

Definition at line 9 of file WeaponCharging.c.

◆ m_start [4/5]

ref WeaponEjectBullet_Start WeaponStateBase::m_start
private

destination of the cartridge

Definition at line 45 of file WeaponEjectBullet.c.

◆ m_start [5/5]

ref WeaponUnjamming_Start WeaponStateBase::m_start
private

Definition at line 175 of file WeaponUnjamming.c.

◆ m_startActionType

int WeaponStateBase::m_startActionType
private

Definition at line 920 of file WeaponChambering.c.

◆ m_store

ref WeaponDetachingMag_Store WeaponStateBase::m_store
private

Definition at line 105 of file WeaponDetachingMag.c.

◆ m_swapMags

ref SwapOldAndNewMagazine WeaponStateBase::m_swapMags
private

Definition at line 344 of file WeaponReplacingMagAndChamberNext.c.

◆ m_type

string WeaponStateBase::m_type
private

Definition at line 23 of file WeaponChambering.c.

◆ m_w4sb2

ref LoopedChambering_Wait4ShowBullet2 WeaponStateBase::m_w4sb2
private

Definition at line 929 of file WeaponChambering.c.

◆ m_w4t [1/2]

ref WeaponChambering_W4T WeaponStateBase::m_w4t
private

Definition at line 10 of file RifleChambering.c.

◆ m_w4t [2/2]

ref WeaponUnjamming_W4T WeaponStateBase::m_w4t
private

Definition at line 177 of file WeaponUnjamming.c.

◆ m_weapon

Weapon_Base WeaponStateBase::m_weapon
private

The documentation for this class was generated from the following files: