DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс WeaponStateBase

represent weapon state base Подробнее...

Закрытые члены

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)
 

Закрытые данные

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
 

Подробное описание

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.

Конструктор(ы)

◆ WeaponStateBase()

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

internal state id used for load/restore

17{ m_weapon = w; m_parentState = parent; }
Definition EntityAI.c:95
Weapon_Base m_weapon
Definition WeaponStateBase.c:12
WeaponStateBase m_parentState
weapon that this state relates to
Definition WeaponStateBase.c:13

Перекрестные ссылки m_parentState и m_weapon.

Методы

◆ AddTransition()

AddTransition ( WeaponTransition t)
inlineprivate

adds transition into m_fsm transition table

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 }
Definition ObjectTyped.c:2
bool HasFSM()
Definition WeaponStateBase.c:28
ref WeaponFSM m_fsm
hierarchical parent state of this state (or null)
Definition WeaponStateBase.c:14
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки Error(), HasFSM(), m_fsm и m_weapon.

◆ AttachNewMagazine()

void AttachNewMagazine ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate
220 {
222 m_newDst = NULL;
223 }
ref InventoryLocation m_newDst
magazine that will be detached
Definition WeaponReplacingMagAndChamberNext.c:8
Magazine m_newMagazine
magazine that will be detached
Definition WeaponAttachMagazine.c:3

Используется в WeaponAttachMagazine().

◆ DetachOldMagazine()

void DetachOldMagazine ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate
11 {
13 m_newDst = NULL;
14 }
Magazine m_oldMagazine
Definition WeaponReplacingMagAndChamberNext.c:7

Перекрестные ссылки m_oldMagazine.

◆ FindNextFreeMuzzle()

bool FindNextFreeMuzzle ( int currentMuzzle,
out int nextMuzzle )
inlineprivate
892 {
894 int nMuzzles = m_weapon.GetMuzzleCount();
895
896 for (int i = 0; i < nMuzzles; ++i)
897 {
898 --nextMuzzle;
900 if (m_weapon.IsChamberEmpty(nextMuzzle))
901 return true;
902 }
903
904 return false;
905 }
Definition EnMath.c:7
static proto int WrapInt(int i, int min, int max)
Returns wrap number to specified interval [min, max[.

Перекрестные ссылки m_weapon и Math::WrapInt().

◆ GetFSM()

WeaponFSM GetFSM ( )
inlineprivate
29{ return m_fsm; }

Перекрестные ссылки m_fsm.

◆ GetInternalStateID()

int GetInternalStateID ( )
inlineprivate
32{ return m_InternalID; }
int m_InternalID
nested state machine (or null)
Definition WeaponStateBase.c:15

Перекрестные ссылки m_InternalID.

◆ GetParentState()

GetParentState ( )
inlineprivate
Возвращает
state that owns this sub-state (or null if plain state)
26{ return m_parentState; }

Перекрестные ссылки m_parentState.

◆ HasFSM()

bool HasFSM ( )
inlineprivate
28{ return m_fsm != NULL; }

Перекрестные ссылки m_fsm.

Используется в AddTransition(), IsWaitingForActionFinish(), LoadCurrentFSMState(), OnAbort(), OnEntry(), OnUpdate(), ProcessEvent() и SaveCurrentFSMState().

◆ IsBoltOpen()

IsBoltOpen ( )
inlineprivate
Возвращает
true if weapon bolt is open
163{ return false; }

◆ IsIdle()

IsIdle ( )
inlineprivate

idle state does not expect any animation events

Возвращает
true if this state is idle
158{ return false; }

Используется в LoadCurrentFSMState() и SaveCurrentFSMState().

◆ IsWaitingForActionFinish() [1/9]

IsWaitingForActionFinish ( )
inlineprivate

waiting for active animation action/actionType finish

Возвращает
true if this state or active substate is waiting for finish signal
370{ return true; }

◆ IsWaitingForActionFinish() [2/9]

override bool IsWaitingForActionFinish ( )
inlineprivate
9{ return false; }

◆ IsWaitingForActionFinish() [3/9]

override bool IsWaitingForActionFinish ( )
inlineprivate
70{ return true; }

◆ IsWaitingForActionFinish() [4/9]

override bool IsWaitingForActionFinish ( )
inlineprivate
46 {
47 return false;
48 }

◆ IsWaitingForActionFinish() [5/9]

override bool IsWaitingForActionFinish ( )
inlineprivate
120 {
121 return false;
122 }

◆ IsWaitingForActionFinish() [6/9]

override bool IsWaitingForActionFinish ( )
inlineprivate
226 {
227 return true;
228 }

◆ IsWaitingForActionFinish() [7/9]

override bool IsWaitingForActionFinish ( )
inlineprivate
328{ return true; }

◆ IsWaitingForActionFinish() [8/9]

bool IsWaitingForActionFinish ( )
inlineprivate
152{ return HasFSM() && m_fsm.IsRunning() && m_fsm.GetCurrentState().IsWaitingForActionFinish(); }

Перекрестные ссылки HasFSM() и m_fsm.

◆ IsWaitingForActionFinish() [9/9]

override bool IsWaitingForActionFinish ( )
inlineprivate
161{ return true; }

◆ LoadCurrentFSMState() [1/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
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
Definition RifleChambering.c:5

Перекрестные ссылки Error(), m_srcMagazine и m_weapon.

◆ LoadCurrentFSMState() [2/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
107 {
108 if (!super.LoadCurrentFSMState(ctx, version))
109 return false;
110
111 if (!ctx.Read(m_dstMagazine))
112 {
113 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber.LoadCurrentFSMState: cannot read m_dstMagazine for weapon=" + m_weapon);
114 return false;
115 }
116 if (!ctx.Read(m_srcMagazine))
117 {
118 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
119 return false;
120 }
121 return true;
122 }
Magazine m_dstMagazine
Definition RifleReChambering.c:5

Перекрестные ссылки Error(), m_srcMagazine и m_weapon.

◆ LoadCurrentFSMState() [3/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
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)
Definition InventoryLocation.c:662
ref InventoryLocation m_newSrc
magazine that will be removed from inventory
Definition WeaponAttachMagazine.c:4

Перекрестные ссылки Error(), m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [4/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
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 }
string m_magazineType
Definition WeaponChambering.c:24
float m_damage
Definition WeaponChambering.c:22
string m_type
Definition WeaponChambering.c:23

Перекрестные ссылки Error(), m_srcMagazine и m_weapon.

◆ LoadCurrentFSMState() [5/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
599 {
600 if (!super.LoadCurrentFSMState(ctx, version))
601 return false;
602
603 if (!ctx.Read(m_srcMagazine))
604 {
605 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
606 return false;
607 }
608
610 {
611 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
612 return false;
613 }
614 return true;
615 }
ref InventoryLocation m_srcMagazinePrevLocation
source of the cartridge
Definition WeaponChambering.c:378

Перекрестные ссылки Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [6/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
1178 {
1179 if (!super.LoadCurrentFSMState(ctx, version))
1180 return false;
1181
1182 if (!ctx.Read(m_srcMagazine))
1183 {
1184 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
1185 return false;
1186 }
1187
1189 {
1190 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
1191 return false;
1192 }
1193 return true;
1194 }

Перекрестные ссылки Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [7/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
251 {
252 if (!super.LoadCurrentFSMState(ctx, version))
253 return false;
254
255 if (!ctx.Read(m_srcMagazine))
256 {
257 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
258 return false;
259 }
260
262 {
263 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
264 return false;
265 }
266 return true;
267 }

Перекрестные ссылки Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [8/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
512 {
513 if (!super.LoadCurrentFSMState(ctx, version))
514 return false;
515
516 if (!ctx.Read(m_srcMagazine))
517 {
518 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
519 return false;
520 }
521
523 {
524 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
525 return false;
526 }
527 return true;
528 }

Перекрестные ссылки Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [9/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
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 }

Перекрестные ссылки Error() и m_weapon.

◆ LoadCurrentFSMState() [10/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
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 }

Перекрестные ссылки Error() и m_weapon.

◆ LoadCurrentFSMState() [11/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
78 {
79 if (!super.LoadCurrentFSMState(ctx, version))
80 return false;
81
82 if (!ctx.Read(m_magazine))
83 {
84 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store.LoadCurrentFSMState: cannot read m_magazine for weapon=" + m_weapon);
85 return false;
86 }
88 {
89 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store.LoadCurrentFSMState: cannot read m_dst for weapon=" + m_weapon);
90 return false;
91 }
92 return true;
93 }
Magazine m_magazine
Definition WeaponDetachingMag.c:8
ref InventoryLocation m_dst
magazine that will be detached
Definition WeaponDetachingMag.c:9

Перекрестные ссылки Error(), m_dst, m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [12/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
184 {
185 if (!super.LoadCurrentFSMState(ctx, version))
186 return false;
187
188 if (!ctx.Read(m_magazine))
189 {
190 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag.LoadCurrentFSMState: cannot read m_magazine for weapon=" + m_weapon);
191 return false;
192 }
194 {
195 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag.LoadCurrentFSMState: cannot read m_dst for weapon=" + m_weapon);
196 return false;
197 }
198 return true;
199 }

Перекрестные ссылки Error(), m_dst, m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [13/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
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 }

Перекрестные ссылки Error() и m_weapon.

◆ LoadCurrentFSMState() [14/20]

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

Перекрестные ссылки Error(), m_srcMagazine и m_weapon.

◆ LoadCurrentFSMState() [15/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
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 }

Перекрестные ссылки Error(), m_oldMagazine, m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [16/20]

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

Перекрестные ссылки Error(), m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [17/20]

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

Перекрестные ссылки Error(), m_weapon и OptionalLocationReadFromContext().

◆ LoadCurrentFSMState() [18/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
572 {
573 if (!super.LoadCurrentFSMState(ctx, version))
574 return false;
575
576 if (!ctx.Read(m_newMagazine))
577 {
578 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" + m_weapon);
579 return false;
580 }
581 if (!ctx.Read(m_oldMagazine))
582 {
583 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.LoadCurrentFSMState: cannot read m_oldMagazine for weapon=" + m_weapon);
584 return false;
585 }
587
588 if (!m_newDst.ReadFromContext(ctx))
589 {
590 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" + m_weapon);
591 return false;
592 }
593
594 return true;
595 }
InventoryLocation.
Definition InventoryLocation.c:29

Перекрестные ссылки Error(), m_oldMagazine и m_weapon.

◆ LoadCurrentFSMState() [19/20]

bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
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
Definition Debug.c:600
static bool IsWeaponLogEnable()
Definition Debug.c:724
bool IsIdle()
idle state does not expect any animation events
Definition WeaponStateBase.c:158

Перекрестные ссылки Error(), HasFSM(), IsIdle(), LogManager::IsWeaponLogEnable(), m_fsm, m_weapon и wpnDebugSpam().

◆ LoadCurrentFSMState() [20/20]

override bool LoadCurrentFSMState ( ParamsReadContext ctx,
int version )
inlineprivate
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 }

Перекрестные ссылки Error() и m_weapon.

◆ LoopedChambering()

void LoopedChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int startActionType = -1,
int endActionType = -1 )
inlineprivate
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 WeaponEjectCasing m_eject
Definition RifleChambering.c:8
ref LoopedChambering_Wait4ShowBullet2 m_w4sb2
Definition WeaponChambering.c:942
int m_startActionType
Definition WeaponChambering.c:933
ref WeaponStateBase m_start
source of the cartridge
Definition RifleChambering.c:7
int m_endActionType
Definition WeaponChambering.c:934
void WeaponEjectCasing(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
Definition WeaponEjectCasingAndChamberFromAttMag.c:4
ref BulletHide_W4T m_hideB
Definition RifleEjectCasing.c:8
ref WeaponStartAction m_endLoop
Definition WeaponChambering.c:943
WeaponActions m_action
Definition RifleChambering.c:3
ref WeaponChambering_Cartridge m_chamber
Definition RifleChambering.c:9

Перекрестные ссылки m_action, m_chamber, m_eject, m_endActionType, m_endLoop, m_start, m_startActionType, m_w4sb2, m_weapon и WeaponEjectCasing().

◆ LoopedChamberingEjectLast()

void LoopedChamberingEjectLast ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int startActionType = -1,
int endActionType = -1 )
inlineprivate
287 {
291
292 // setup nested state machine
297 m_hideB = new BulletHide_W4T(m_weapon, this);
299 m_endLoop = new LoopedChambering_EndLoop(m_weapon, this, m_action, m_endActionType); // @NOTE: termination playing action - dummy?
300 // events
301 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
302 WeaponEventContinuousLoadBulletStart __lS_ = new WeaponEventContinuousLoadBulletStart;
303 WeaponEventContinuousLoadBulletEnd __lE_ = new WeaponEventContinuousLoadBulletEnd;
304 WeaponEventAnimCocked __wc_ = new WeaponEventAnimCocked;
305 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
306 WeaponEventAnimBulletHide __bh_ = new WeaponEventAnimBulletHide;
307 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
308 WeaponEventAnimBulletInMagazine __bM_ = new WeaponEventAnimBulletInMagazine;
309 WeaponEventAnimBulletShow2 _bs2_ = new WeaponEventAnimBulletShow2;
310
311 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
312 m_fsm.AddTransition(new WeaponTransition(m_start , __bs_, m_chamber));
313
314
315 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())));
316 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_endLoop));
317 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __bh_, m_hideB));
318 m_fsm.AddTransition(new WeaponTransition(m_hideB, __bs_, m_chamber));
319
320 m_fsm.AddTransition(new WeaponTransition(m_endLoop, _fin_, NULL));
321
322 m_fsm.AddTransition(new WeaponTransition(m_hideB, __be_, m_eject));
323 m_fsm.AddTransition(new WeaponTransition(m_endLoop, __be_, m_eject));
326
327 // Safety exits
328 m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, null));
329 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, _fin_, null));
330 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
331 m_fsm.AddTransition(new WeaponTransition(m_eject , _fin_, null));
332 m_fsm.AddTransition(new WeaponTransition(m_start , _fin_, null));
333
334 m_fsm.SetInitialState(m_start);
335 }
ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag
Definition WeaponChamberingLooped.c:284

Перекрестные ссылки m_action, m_chamber, m_eject, m_endActionType, m_endLoop, m_start, m_startActionType, m_w4sb2, m_weapon и WeaponEjectCasing().

◆ OnAbort() [1/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
63 {
64 super.OnAbort(e);
66 }

Перекрестные ссылки m_srcMagazine.

◆ OnAbort() [2/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
75 {
76 super.OnAbort(e);
79 }

Перекрестные ссылки m_srcMagazine.

◆ OnAbort() [3/18]

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

◆ OnAbort() [4/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
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
Definition DayZPlayerUtils.c:465
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17
Definition Building.c:6
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
Definition InventorySlots.c:6

Перекрестные ссылки DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon и wpnDebugPrint().

◆ OnAbort() [5/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
460 {
461 bool done = false;
462 if (m_srcMagazine)
463 {
464 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
465
467 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
468 if (leftHandIl.IsValid())
469 {
471 {
473 {
475 {
477 {
478 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
479 done = true;
480 }
481 }
482 }
483 }
484
485 if( !done)
486 {
488 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
489
490 if(!il || !il.IsValid())
491 {
492 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
493 {
494 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - no inventory space for ammo pile - dropped to ground - abort"); }
495 }
496 else
497 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
498
499 }
500 else
501 {
503 {
504 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
505 }
506 else
507 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot remove ammo pile from wpn - abort");
508 }
509 }
510 }
511 }
512
513 super.OnAbort(e);
515 m_chamber.m_srcMagazine = NULL;
517 }
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...
Definition WeaponManager.c:2
const float MAX_DROP_MAGAZINE_DISTANCE_SQ
Definition WeaponManager.c:3
Definition EnConvert.c:106
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ и wpnDebugPrint().

◆ OnAbort() [6/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
1098 {
1099 bool done = false;
1100 if (m_srcMagazine)
1101 {
1102 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
1103
1105 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
1106 if (leftHandIl.IsValid())
1107 {
1109 {
1111 {
1113 {
1115 {
1116 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
1117 done = true;
1118 }
1119 }
1120 }
1121 }
1122
1123 if ( !done)
1124 {
1126 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
1127
1128 if (!il || !il.IsValid())
1129 {
1130 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
1131 {
1132 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - no inventory space for ammo pile - dropped to ground - abort"); }
1133 }
1134 else
1135 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
1136
1137 }
1138 else
1139 {
1141 {
1142 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
1143 }
1144 else
1145 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from wpn - abort");
1146 }
1147 }
1148 }
1149 }
1150
1151 super.OnAbort(e);
1153 m_chamber.m_srcMagazine = NULL;
1155 }

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ и wpnDebugPrint().

◆ OnAbort() [7/18]

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

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ и wpnDebugPrint().

◆ OnAbort() [8/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
433 {
434 bool done = false;
435 if (m_srcMagazine)
436 {
437 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
438
440 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
441 if (leftHandIl.IsValid())
442 {
444 {
446 {
448 {
450 {
451 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
452 done = true;
453 }
454 }
455 }
456 }
457
458 if (!done)
459 {
461 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
462
463 if (!il || !il.IsValid())
464 {
465 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
466 {
467 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - abort"); }
468 }
469 else
470 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
471
472 }
473 else
474 {
476 {
477 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
478 }
479 else
480 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - abort");
481 }
482 }
483 }
484 }
485
486 super.OnAbort(e);
488 m_chamber.m_srcMagazine = NULL;
490 }

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ и wpnDebugPrint().

◆ OnAbort() [9/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
96 {
98 super.OnAbort(e);
99 }

◆ OnAbort() [10/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
156 {
158 super.OnAbort(e);
159 }

◆ OnAbort() [11/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
25 {
27 m_dst = NULL;
28
29 super.OnAbort(e);
30 }

Перекрестные ссылки m_dst.

◆ OnAbort() [12/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
101 {
103 super.OnAbort(e);
104 }

◆ OnAbort() [13/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
68 {
69 m_weapon.ResetBurstCount();
70 super.OnAbort(e);
71 }

Перекрестные ссылки m_weapon.

◆ OnAbort() [14/18]

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

Перекрестные ссылки m_oldMagazine.

◆ OnAbort() [15/18]

override void OnAbort ( WeaponEventBase e)
inlineprivate
154 {
155 //m_weapon.HideMagazine();
156
158 m_newDst = NULL;
159
160 super.OnAbort(e);
161 }

◆ OnAbort() [16/18]

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

Перекрестные ссылки DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), m_weapon и wpnDebugPrint().

◆ OnAbort() [17/18]

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

Перекрестные ссылки DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_oldMagazine, m_weapon и wpnDebugPrint().

◆ OnAbort() [18/18]

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

Перекрестные ссылки HasFSM(), LogManager::IsWeaponLogEnable(), m_fsm, m_weapon и wpnDebugPrint().

◆ OnEntry() [1/39]

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

Перекрестные ссылки m_weapon.

◆ OnEntry() [2/39]

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

Перекрестные ссылки m_weapon.

◆ OnEntry() [3/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
19 {
20 super.OnEntry(e);
21 if(e)
23 }

Перекрестные ссылки m_weapon.

◆ OnEntry() [4/39]

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

◆ OnEntry() [5/39]

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

Перекрестные ссылки m_weapon.

◆ OnEntry() [6/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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 }

Перекрестные ссылки LogManager::IsWeaponLogEnable(), m_chamber, m_srcMagazine, m_srcMagazine, m_weapon и wpnDebugPrint().

◆ OnEntry() [7/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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 {
64 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber - error, cannot prepare mag for catridge, magType=" + magazineTypeName);
65 }
66 }
67 }
68 m_eject.m_dstMagazine = m_dstMagazine;
69 }
70 super.OnEntry(e); // @NOTE: super after submachine init (prevent override from submachine start)
71
72 }
proto native CGame GetGame()

Перекрестные ссылки DayZPlayerUtils(), Error(), GetGame(), LogManager::IsWeaponLogEnable(), m_chamber, m_dstMagazine, m_eject, m_srcMagazine, m_srcMagazine, m_weapon и wpnDebugPrint().

◆ OnEntry() [8/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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
Definition InventoryLocation.c:4

Перекрестные ссылки Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon и wpnDebugPrint().

◆ OnEntry() [9/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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
Definition WeaponAttachMagazine.c:120

Перекрестные ссылки Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon и wpnDebugPrint().

◆ OnEntry() [10/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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

Перекрестные ссылки m_weapon и pushToChamberFromAttachedMagazine().

◆ OnEntry() [11/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
32 {
33 super.OnEntry(e);
34 if (e)
35 {
36 int mi = m_weapon.GetCurrentMuzzle();
38 }
39 }
bool pushToChamberFromInnerMagazine(Weapon_Base weapon, int muzzleIndex)
Definition weapon_utils.c:33

Перекрестные ссылки m_weapon и pushToChamberFromInnerMagazine().

◆ OnEntry() [12/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
423 {
424 if (e != NULL)
425 {
426 m_srcMagazine = e.m_magazine;
427 if (m_srcMagazine != NULL)
428 {
430 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
431
433
434 // move to LH
436 lhand.SetAttachment(e.m_player, m_srcMagazine, InventorySlots.LEFTHAND);
438 {
439 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from inv (inv->LHand)"); }
440 }
441 else
442 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot remove ammo pile from inv");
443
444 m_chamber.m_srcMagazine = m_srcMagazine;
445 }
446 else
447 {
448 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering m_srcMagazine = NULL"); }
449 }
450 }
451 else
452 {
453 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString()); }
454 }
455
456 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
457 }

Перекрестные ссылки Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon и wpnDebugPrint().

◆ OnEntry() [13/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
908 {
909 int nextMuzzle;
910 if (FindNextFreeMuzzle(m_weapon.GetCurrentMuzzle(), nextMuzzle))
911 {
913 magnum.SetCylinderRotationAnimationPhase(magnum.GetCylinderRotation(nextMuzzle));
914 m_weapon.SetCurrentMuzzle(nextMuzzle);
915 }
916 else
917 {
918 Print("WTF");
919 }
920
921 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
922 }
Definition Magnum.c:363
bool FindNextFreeMuzzle(int currentMuzzle, out int nextMuzzle)
Definition WeaponChambering.c:891
proto void Print(void var)
Prints content of variable to console/log.

Перекрестные ссылки m_weapon и Print().

◆ OnEntry() [14/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
1000 {
1001 if (e != NULL)
1002 {
1003
1004 m_srcMagazine = e.m_magazine;
1005 if (m_srcMagazine != NULL)
1006 {
1008 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
1009
1011
1012 // move to LH
1014 lhand.SetAttachment(e.m_player, m_srcMagazine, InventorySlots.LEFTHAND);
1016 {
1017 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from inv (inv->LHand)"); }
1018 }
1019 else
1020 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, error - cannot remove ammo pile from inv");
1021
1022 m_chamber.m_srcMagazine = m_srcMagazine;
1023 }
1024 else
1025 {
1026 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering m_srcMagazine = NULL");
1027 }
1028 }
1029 else
1030 {
1031 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
1032 }
1033
1034 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
1035 }

Перекрестные ссылки Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, Print() и wpnDebugPrint().

◆ OnEntry() [15/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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 {
101 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering m_srcMagazine = NULL");
102 }
103 }
104 else
105 {
106 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
107 }
108
109 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
110 }

Перекрестные ссылки Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, Print() и wpnDebugPrint().

◆ OnEntry() [16/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
338 {
339 if (e != NULL)
340 {
341 m_srcMagazine = e.m_magazine;
342 if (m_srcMagazine != NULL)
343 {
345 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
346
348
349 // move to LH
351 lhand.SetAttachment(e.m_player, m_srcMagazine, InventorySlots.LEFTHAND);
353 {
354 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from inv (inv->LHand)"); }
355 }
356 else
357 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from inv");
358
359 m_chamber.m_srcMagazine = m_srcMagazine;
360 }
361 else
362 {
363 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast m_srcMagazine = NULL");
364 }
365 }
366 else
367 {
368 Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
369 }
370
371 super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
372 }

Перекрестные ссылки Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, Print() и wpnDebugPrint().

◆ OnEntry() [17/39]

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

Перекрестные ссылки m_weapon.

◆ OnEntry() [18/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate

destination of the cartridge

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

Перекрестные ссылки ejectBulletAndStoreInMagazine() и m_weapon.

◆ OnEntry() [19/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate

destination of the cartridge

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:329

Перекрестные ссылки ejectBulletAndStoreInMagazine() и m_weapon.

◆ OnEntry() [20/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
266 {
267 super.OnEntry(e);
268 }

◆ OnEntry() [21/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
338 {
339 super.OnEntry(e);
340 }

◆ OnEntry() [22/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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 {
19 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store, error - no magazine to load from (m_magazine=NULL)");
20 }
21 }
22 }

Перекрестные ссылки Error(), m_dst и m_weapon.

◆ OnEntry() [23/39]

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

Перекрестные ссылки Class::CastTo(), LogManager::IsWeaponLogEnable(), m_dst, m_dst, m_magazine и wpnDebugPrint().

◆ OnEntry() [24/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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 }

Перекрестные ссылки LogManager::IsWeaponLogEnable(), m_dstMagazine, m_eject, m_weapon и wpnDebugPrint().

◆ OnEntry() [25/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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 {
15 m_weapon.EjectCasing(mi);
16 }
17 m_weapon.EffectBulletHide(mi);
18 m_weapon.SelectionBulletHide();
19 }
20 }

Перекрестные ссылки LogManager::IsWeaponLogEnable(), m_weapon и wpnDebugPrint().

◆ OnEntry() [26/39]

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

Перекрестные ссылки LogManager::IsWeaponLogEnable(), m_weapon и wpnDebugPrint().

◆ OnEntry() [27/39]

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

Перекрестные ссылки ejectBulletAndStoreInMagazine(), LogManager::IsWeaponLogEnable(), m_weapon и wpnDebugPrint().

◆ OnEntry() [28/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
32 {
33 super.OnEntry(e);
34 if (e)
36 }
float m_dtAccumulator
Definition WeaponFireAndChamberNext.c:6

Перекрестные ссылки m_dtAccumulator.

◆ OnEntry() [29/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
32 {
33 super.OnEntry(e);
34 if (e)
36 }

Перекрестные ссылки m_dtAccumulator.

◆ OnEntry() [30/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
32 {
33 super.OnEntry(e);
34 if (e)
36 }

Перекрестные ссылки m_dtAccumulator.

◆ OnEntry() [31/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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 {
53 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponRechamber - error, cannot prepare mag for catridge, magType=" + magazineTypeName);
54 }
55 }
56
57 e.m_magazine = m_dstMagazine; // @NOTE: override event mag - @TODO
58 }
59 super.OnEntry(e); // @NOTE: super after submachine init (prevent override from submachine start)
60 }
ref WeaponChambering m_loa
Definition WeaponReChamber.c:13

Перекрестные ссылки DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), m_dstMagazine, m_srcMagazine, m_srcMagazine, m_weapon и wpnDebugPrint().

◆ OnEntry() [32/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
17 {
18 super.OnEntry(e);
19 }

◆ OnEntry() [33/39]

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

Перекрестные ссылки InventoryLocation::DumpToStringNullSafe(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon и wpnDebugPrint().

◆ OnEntry() [34/39]

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

Перекрестные ссылки Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_weapon и wpnDebugPrint().

◆ OnEntry() [35/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
407 {
408 if (e != NULL)
409 {
410 WeaponEventSwapMagazine se;
411 if (Class.CastTo(se, e))
412 {
413 int mi = m_weapon.GetCurrentMuzzle();
414 m_oldMagazine = m_weapon.GetMagazine(mi);
415 m_newMagazine = se.m_magazine;
416 m_newDst = se.m_dst;
417
418 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())); }
419
422
423 if (!m_newMagazine.GetInventory().GetCurrentInventoryLocation(newSrc))
424 {
425 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponReplacingMagAndChamberNext cannot get curr inv loc of NEW mag=" + Object.GetDebugName(m_newMagazine));
426 }
427 if (!m_oldMagazine.GetInventory().GetCurrentInventoryLocation(oldSrc))
428 {
429 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponReplacingMagAndChamberNext cannot get curr inv loc of OLD mag=" + Object.GetDebugName(m_oldMagazine));
430 }
431
432 // move to LH
434 lhand.SetAttachment(e.m_player, m_newMagazine, InventorySlots.LEFTHAND);
435
437 {
438 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory, ok - new magazine removed from inv (inv->LHand)"); }
439 }
440 else
441 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " RemoveNewMagazineFromInventory, error - cannot new remove mag from inv");
442
443 m_detach.m_oldMagazine = m_oldMagazine;
444 m_detach.m_newDst = m_newDst;
445
446 m_swapMags.m_newMagazine = m_newMagazine;
447
448 oldSrc.SetItem(m_newMagazine);
449 m_swapMags.m_newDst = oldSrc;
450 }
451 }
452 super.OnEntry(e);
453 }
ref DetachOldMagazine m_detach
Definition WeaponReplacingMagAndChamberNext.c:344
ref SwapOldAndNewMagazine m_swapMags
Definition WeaponReplacingMagAndChamberNext.c:346

Перекрестные ссылки Class::CastTo(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_oldMagazine, m_weapon и wpnDebugPrint().

◆ OnEntry() [36/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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
39 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("---: remote playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType)); }
40 }
41 else
42 {
43 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("---: warning, no player wants to play A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType)); }
44 }
45 }
46 }
Definition human.c:994
int m_actionType
action to be played
Definition RifleChambering.c:4
WeaponActions
actions
Definition human.c:816
string WeaponActionTypeToString(int A, int AT)
Definition human.c:943
class HumanCommandWeapons HumanCommandAdditives()
Definition human.c:1112

Перекрестные ссылки Error(), HumanCommandAdditives(), LogManager::IsWeaponLogEnable(), m_action, WeaponActionTypeToString() и wpnDebugPrint().

◆ OnEntry() [37/39]

void OnEntry ( WeaponEventBase e)
inlineprivate
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
111 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { " + this.Type().ToString()); }
112 }

Перекрестные ссылки HasFSM(), LogManager::IsWeaponLogEnable(), m_fsm, m_weapon и wpnDebugPrint().

◆ OnEntry() [38/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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

Перекрестные ссылки ejectBulletAndStoreInMagazine(), string::Empty и m_weapon.

◆ OnEntry() [39/39]

override void OnEntry ( WeaponEventBase e)
inlineprivate
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 }
float m_jamTime
Definition WeaponUnjamming.c:173

Перекрестные ссылки m_dtAccumulator и m_start.

◆ OnExit() [1/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
11 {
12 super.OnExit(e);
13 }

◆ OnExit() [2/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
11 {
12 super.OnExit(e);
13 }

◆ OnExit() [3/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
26 {
27 super.OnExit(e);
28 }

◆ OnExit() [4/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
10 {
11 super.OnExit(e);
12 }

◆ OnExit() [5/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
11 {
12 super.OnExit(e);
13 }

◆ OnExit() [6/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
69 {
70 super.OnExit(e);
72 }

Перекрестные ссылки m_srcMagazine.

◆ OnExit() [7/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
82 {
83 super.OnExit(e);
86 }

Перекрестные ссылки m_srcMagazine.

◆ OnExit() [8/34]

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

Перекрестные ссылки m_weapon.

◆ OnExit() [9/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
20 {
21 super.OnExit(e);
22 }

◆ OnExit() [10/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
41 {
42 super.OnExit(e);
43 }

◆ OnExit() [11/34]

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

Перекрестные ссылки m_weapon и pushToChamberFromAttachedMagazine().

◆ OnExit() [12/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
520 {
521 bool done = false;
522 if (m_srcMagazine)
523 {
524 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
525
527 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
528 if (leftHandIl.IsValid())
529 {
531 {
533 {
535 {
537 {
538 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
539 done = true;
540 }
541 }
542 }
543 }
544
545 if( !done)
546 {
548 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
549
550 if(!il || !il.IsValid())
551 {
552 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
553 {
554 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - no inventory space for ammo pile - dropped to ground - exit"); }
555 }
556 else
557 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
558
559 }
560 else
561 {
563 {
564 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, ok - ammo pile removed from left hand (LHand->inv) - exit"); }
565 }
566 else
567 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering, error - cannot remove ammo pile from wpn - exit");
568 }
569 }
570 }
571 }
572
573 super.OnExit(e);
575 m_chamber.m_srcMagazine = NULL;
577 }

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ и wpnDebugPrint().

◆ OnExit() [13/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
1038 {
1039 bool done = false;
1040 if (m_srcMagazine)
1041 {
1042 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
1043
1045 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
1046 if (leftHandIl.IsValid())
1047 {
1049 {
1051 {
1053 {
1055 {
1056 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
1057 done = true;
1058 }
1059 }
1060 }
1061 }
1062
1063 if ( !done)
1064 {
1066 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
1067
1068 if (!il || !il.IsValid())
1069 {
1070 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
1071 {
1072 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - no inventory space for ammo pile - dropped to ground - exit"); }
1073 }
1074 else
1075 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
1076
1077 }
1078 else
1079 {
1081 {
1082 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, ok - ammo pile removed from left hand (LHand->inv) - exit"); }
1083 }
1084 else
1085 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering, error - cannot remove ammo pile from wpn - exit");
1086 }
1087 }
1088 }
1089 }
1090
1091 super.OnExit(e);
1093 m_chamber.m_srcMagazine = NULL;
1095 }

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ и wpnDebugPrint().

◆ OnExit() [14/34]

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

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ и wpnDebugPrint().

◆ OnExit() [15/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
374 {
375 bool done = false;
376 if (m_srcMagazine)
377 {
378 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
379
381 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
382 if (leftHandIl.IsValid())
383 {
385 {
387 {
389 {
391 {
392 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
393 done = true;
394 }
395 }
396 }
397 }
398
399 if (!done)
400 {
402 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
403
404 if (!il || !il.IsValid())
405 {
406 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
407 {
408 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - exit"); }
409 }
410 else
411 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
412
413 }
414 else
415 {
417 {
418 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - exit"); }
419 }
420 else
421 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - exit");
422 }
423 }
424 }
425 }
426
427 super.OnExit(e);
429 m_chamber.m_srcMagazine = NULL;
431 }

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ и wpnDebugPrint().

◆ OnExit() [16/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
102 {
104 super.OnExit(e);
105 }

◆ OnExit() [17/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
162 {
164 super.OnExit(e);
165 }

◆ OnExit() [18/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
270 {
271 super.OnExit(e);
272 }

◆ OnExit() [19/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
342 {
343 super.OnExit(e);
344 }

◆ OnExit() [20/34]

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

Перекрестные ссылки Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_dst, m_weapon и wpnDebugPrint().

◆ OnExit() [21/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
158 {
159 m_dst = NULL;
161 super.OnExit(e);
162 }

Перекрестные ссылки m_dst.

◆ OnExit() [22/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
107 {
109 super.OnExit(e);
110 }

◆ OnExit() [23/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
61 {
62 //m_weapon.ResetBurstCount();
64 super.OnExit(e);
65 }

Перекрестные ссылки m_dtAccumulator.

◆ OnExit() [24/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
56 {
58 super.OnExit(e);
59 }

Перекрестные ссылки m_dtAccumulator.

◆ OnExit() [25/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
39 {
41 super.OnExit(e);
42 }

Перекрестные ссылки m_dtAccumulator.

◆ OnExit() [26/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
63 {
64 super.OnExit(e);
66 m_eje.m_dstMagazine = NULL;
67 m_loa.m_srcMagazine = NULL;
68 }
ref WeaponEjectBullet m_eje
source of the loaded cartridge
Definition WeaponReChamber.c:12

◆ OnExit() [27/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
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 }

Перекрестные ссылки DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_oldMagazine, m_weapon и wpnDebugPrint().

◆ OnExit() [28/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
164 {
166 m_newDst = NULL;
167
168 super.OnExit(e);
169 }

◆ OnExit() [29/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
282 {
284 m_newDst = NULL;
285 super.OnExit(e);
286 }

◆ OnExit() [30/34]

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

Перекрестные ссылки DayZPlayerUtils(), Error(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_oldMagazine, m_weapon и wpnDebugPrint().

◆ OnExit() [31/34]

override void OnExit ( WeaponEventBase e)
inlineprivate
48 {
49 super.OnExit(e);
50 }

◆ OnExit() [32/34]

void OnExit ( WeaponEventBase e)
inlineprivate
144 {
145 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } " + this.Type().ToString()); }
146 }

Перекрестные ссылки LogManager::IsWeaponLogEnable(), m_weapon и wpnDebugPrint().

◆ OnExit() [33/34]

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

Перекрестные ссылки string::Empty.

◆ OnExit() [34/34]

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

Перекрестные ссылки m_dtAccumulator.

◆ OnStateChanged()

OnStateChanged ( WeaponStateBase src,
WeaponStateBase dst )
inlineprivate

called on current state when state machine has changed its state

Аргументы
[in]srcfrom state (previous)
[in]dstto state (current)
177{ }

◆ OnSubMachineChanged()

OnSubMachineChanged ( WeaponStateBase src,
WeaponStateBase dst )
inlineprivate

called when sub-machine has changed its state

Аргументы
[in]srcfrom state (previous)
[in]dstto state (current)
170{ }

◆ OnUpdate() [1/3]

override void OnUpdate ( float dt)
inlineprivate
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 {
54 m_weapon.ProcessWeaponEvent(new WeaponEventReloadTimeout(p));
55 }
56 }
57 }
58 }
Definition ManBase.c:2
Definition human.c:18

Перекрестные ссылки Class::CastTo(), m_dtAccumulator и m_weapon.

◆ OnUpdate() [2/3]

override void OnUpdate ( float dt)
inlineprivate
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 }

Перекрестные ссылки Class::CastTo(), m_dtAccumulator и m_weapon.

◆ OnUpdate() [3/3]

void OnUpdate ( float dt)
inlineprivate
120 {
121 if (HasFSM() && m_fsm.IsRunning())
122 m_fsm.GetCurrentState().OnUpdate(dt);
123 }

Перекрестные ссылки HasFSM() и m_fsm.

◆ ProcessEvent()

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

Перекрестные ссылки HasFSM() и m_fsm.

◆ RemoveNewMagazineFromInventory()

◆ RifleChambering()

void RifleChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }
Definition WeaponChambering.c:165
ref WeaponChambering_W4T m_w4t
Definition RifleChambering.c:10

Перекрестные ссылки m_action, m_chamber, m_eject, m_start, m_weapon и WeaponEjectCasing().

◆ RifleEjectCasing()

void RifleEjectCasing ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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
Definition WeaponStartAction.c:9

Перекрестные ссылки m_action, m_eject, m_start, m_weapon, WeaponEjectCasing() и WeaponStartAction().

◆ RifleReChambering()

void RifleReChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }

Перекрестные ссылки m_action, m_chamber, m_eject, m_start и m_weapon.

◆ SaveCurrentFSMState() [1/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
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 }

Перекрестные ссылки Error(), m_srcMagazine и m_weapon.

◆ SaveCurrentFSMState() [2/20]

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

Перекрестные ссылки Error(), m_srcMagazine и m_weapon.

◆ SaveCurrentFSMState() [3/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
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)
Definition InventoryLocation.c:640

Перекрестные ссылки Error(), m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [4/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate

source of the cartridge

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 }

Перекрестные ссылки Error(), m_srcMagazine и m_weapon.

◆ SaveCurrentFSMState() [5/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
580 {
581 if (!super.SaveCurrentFSMState(ctx))
582 return false;
583
584 if (!ctx.Write(m_srcMagazine))
585 {
586 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
587 return false;
588 }
589
591 {
592 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponChambering.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
593 return false;
594 }
595 return true;
596 }

Перекрестные ссылки Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [6/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
1158 {
1159 if (!super.SaveCurrentFSMState(ctx))
1160 return false;
1161
1162 if (!ctx.Write(m_srcMagazine))
1163 {
1164 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
1165 return false;
1166 }
1167
1169 {
1170 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponMagnumChambering.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
1171 return false;
1172 }
1173
1174 return true;
1175 }

Перекрестные ссылки Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [7/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
231 {
232 if (!super.SaveCurrentFSMState(ctx))
233 return false;
234
235 if (!ctx.Write(m_srcMagazine))
236 {
237 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
238 return false;
239 }
240
242 {
243 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
244 return false;
245 }
246
247 return true;
248 }

Перекрестные ссылки Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [8/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
493 {
494 if (!super.SaveCurrentFSMState(ctx))
495 return false;
496
497 if (!ctx.Write(m_srcMagazine))
498 {
499 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
500 return false;
501 }
502
504 {
505 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
506 return false;
507 }
508 return true;
509 }

Перекрестные ссылки Error(), m_srcMagazine, m_srcMagazinePrevLocation, m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [9/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
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 }

Перекрестные ссылки Error() и m_weapon.

◆ SaveCurrentFSMState() [10/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
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 }

Перекрестные ссылки Error() и m_weapon.

◆ SaveCurrentFSMState() [11/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
59 {
60 if (!super.SaveCurrentFSMState(ctx))
61 return false;
62
63 if (!ctx.Write(m_magazine))
64 {
65 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store.SaveCurrentFSMState: cannot write m_magazine for weapon=" + m_weapon);
66 return false;
67 }
68
70 {
71 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag_Store.SaveCurrentFSMState: cannot write m_st for weapon=" + m_weapon);
72 return false;
73 }
74 return true;
75 }

Перекрестные ссылки Error(), m_dst, m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [12/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
165 {
166 if (!super.SaveCurrentFSMState(ctx))
167 return false;
168
169 if (!ctx.Write(m_magazine))
170 {
171 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag.SaveCurrentFSMState: cannot write m_magazine for weapon=" + m_weapon);
172 return false;
173 }
174
176 {
177 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponDetachingMag.SaveCurrentFSMState: cannot write m_st for weapon=" + m_weapon);
178 return false;
179 }
180 return true;
181 }

Перекрестные ссылки Error(), m_dst, m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [13/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
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 }

Перекрестные ссылки Error() и m_weapon.

◆ SaveCurrentFSMState() [14/20]

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

Перекрестные ссылки Error(), m_srcMagazine и m_weapon.

◆ SaveCurrentFSMState() [15/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
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 }

Перекрестные ссылки Error(), m_oldMagazine, m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [16/20]

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

Перекрестные ссылки Error(), m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [17/20]

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

Перекрестные ссылки Error(), m_weapon и OptionalLocationWriteToContext().

◆ SaveCurrentFSMState() [18/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
546 {
547 if (!super.SaveCurrentFSMState(ctx))
548 return false;
549
550 if (!ctx.Write(m_newMagazine))
551 {
552 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" + m_weapon);
553 return false;
554 }
555
556 if (!ctx.Write(m_oldMagazine))
557 {
558 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.SaveCurrentFSMState: cannot write m_oldMagazine for weapon=" + m_weapon);
559 return false;
560 }
561
562 if (!m_newDst.WriteToContext(ctx))
563 {
564 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" + m_weapon);
565 return false;
566 }
567
568 return true;
569 }

Перекрестные ссылки Error(), m_oldMagazine и m_weapon.

◆ SaveCurrentFSMState() [19/20]

bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
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 }

Перекрестные ссылки HasFSM(), IsIdle(), LogManager::IsWeaponLogEnable(), m_fsm, m_weapon и wpnDebugSpam().

◆ SaveCurrentFSMState() [20/20]

override bool SaveCurrentFSMState ( ParamsWriteContext ctx)
inlineprivate
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 }

Перекрестные ссылки Error() и m_weapon.

◆ SetInternalStateID()

void SetInternalStateID ( int i)
inlineprivate
31{ m_InternalID = i; }

Перекрестные ссылки m_InternalID.

◆ SetParentState()

SetParentState ( WeaponStateBase parent)
inlineprivate

allows construction of hierarchical state machine

22{ m_parentState = parent; }

Перекрестные ссылки m_parentState.

◆ WeaponAttachMagazine()

void WeaponAttachMagazine ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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
ref WeaponCharging_CK m_onCK
Definition WeaponAttachMagazine.c:122
void AttachNewMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
Definition WeaponReplacingMagAndChamberNext.c:219

Перекрестные ссылки AttachNewMagazine(), m_action, m_chamber, m_eject, m_start, m_weapon, WeaponEjectCasing(), WeaponGuardHasAmmo() и WeaponStartAction().

◆ WeaponChamberFromAttMag()

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

◆ WeaponChamberFromAttMagOnExit()

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

◆ WeaponChamberFromInnerMag()

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

◆ WeaponChambering()

void WeaponChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
387 {
390
391 // setup nested state machine
396 m_onCK = new WeaponCharging_CK(m_weapon, this);
397 // events
398 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
399 WeaponEventAnimBulletInChamber __bc_ = new WeaponEventAnimBulletInChamber;
400 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
401 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
402 WeaponEventAnimCocked __ck_ = new WeaponEventAnimCocked;
403
404 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
405 m_fsm.AddTransition(new WeaponTransition(m_start , __be_, m_eject));
406 m_fsm.AddTransition(new WeaponTransition(m_start , __ck_, m_onCK));
407 m_fsm.AddTransition(new WeaponTransition(m_start , __bs_, m_chamber));
408 m_fsm.AddTransition(new WeaponTransition(m_onCK , __be_, m_eject));
409 m_fsm.AddTransition(new WeaponTransition(m_onCK , __bs_, m_chamber));
410 m_fsm.AddTransition(new WeaponTransition(m_eject , __bs_, m_chamber));
411 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bc_, m_w4t));
412 m_fsm.AddTransition(new WeaponTransition(m_w4t , _fin_, null));
413
414 // Safety exits
415 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
416 m_fsm.AddTransition(new WeaponTransition(m_eject , _fin_, null));
417 m_fsm.AddTransition(new WeaponTransition(m_start , _fin_, null));
418
419 m_fsm.SetInitialState(m_start);
420 }

Перекрестные ссылки m_action, m_chamber, m_eject, m_start, m_weapon и WeaponEjectCasing().

Используется в WeaponRechamber().

◆ WeaponCharging()

void WeaponCharging ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }
void WeaponEjectAllMuzzles(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
Definition WeaponEjectCasingAndChamberFromAttMag.c:59
ref WeaponEjectAndChamberFromAttMag m_ejectChamber
Definition WeaponCharging.c:12

Перекрестные ссылки m_action, m_chamber, m_eject, m_start, m_weapon и WeaponGuardHasAmmo().

◆ WeaponChargingInnerMag()

void WeaponChargingInnerMag ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 WeaponEjectCasing_W4T m_onBEFireOut
Definition WeaponCharging.c:211
ref WeaponEjectBullet_Cartridge_W4T m_onBE
Definition WeaponCharging.c:210

Перекрестные ссылки m_action, m_chamber, m_start и m_weapon.

◆ WeaponChargingMultiple()

void WeaponChargingMultiple ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }

Перекрестные ссылки m_action, m_chamber, m_start, m_weapon и WeaponGuardHasAmmo().

◆ WeaponChargingStretch()

void WeaponChargingStretch ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }

Перекрестные ссылки m_action, m_start и m_weapon.

◆ WeaponDetachingMag()

void WeaponDetachingMag ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
113 {
116
117 // setup nested state machine
120 m_hideM = new MagazineHide_W4T(m_weapon, this);
121 // events
122 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
123 WeaponEventBase __md_ = new WeaponEventAnimMagazineDetached;
124 WeaponEventBase __mh_ = new WeaponEventAnimMagazineHide;
125
126 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
127 m_fsm.AddTransition(new WeaponTransition(m_start, __md_, m_store));
128 m_fsm.AddTransition(new WeaponTransition(m_store, __mh_, m_hideM));
129 m_fsm.AddTransition(new WeaponTransition(m_hideM, _fin_, NULL));
130
131 // Safety exits
132 m_fsm.AddTransition(new WeaponTransition(m_store , _fin_, null));
133 m_fsm.AddTransition(new WeaponTransition(m_start , _fin_, null));
134
135 m_fsm.SetInitialState(m_start);
136 }
ref MagazineHide_W4T m_hideM
Definition WeaponDetachingMag.c:110

Перекрестные ссылки m_action, m_start и m_weapon.

◆ WeaponEjectAllMuzzles()

void WeaponEjectAllMuzzles ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL )
inlineprivate
59{ }

Используется в WeaponMagnumChambering().

◆ WeaponEjectBullet()

void WeaponEjectBullet ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }

Перекрестные ссылки m_action, m_chamber, m_eject, m_start, m_weapon и WeaponGuardHasAmmo().

Используется в WeaponRechamber().

◆ WeaponEjectCasing()

◆ WeaponEjectCasingMultiMuzzle()

25{ }

Используется в ChamberMultiBullet().

◆ WeaponFireAndChamberNext()

void WeaponFireAndChamberNext ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }
ref WeaponFire m_fire
Definition WeaponFireAndChamberNext.c:7

Перекрестные ссылки m_action и m_weapon.

◆ WeaponFireAndChamberNextFromInnerMag()

void WeaponFireAndChamberNextFromInnerMag ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }

Перекрестные ссылки m_action и m_weapon.

◆ WeaponFireLast()

void WeaponFireLast ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }

Перекрестные ссылки m_action и m_weapon.

◆ WeaponMagnumChambering()

void WeaponMagnumChambering ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int startActionType = -1,
int endActionType = -1 )
inlineprivate
947 {
951
952 // setup nested state machine
958 m_hideB = new BulletHide_W4T(m_weapon, this);
959 m_endLoop = new LoopedChambering_EndLoop(m_weapon, this, m_action, m_endActionType); // @NOTE: termination playing action - dummy?
960 // events
961 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
962 WeaponEventContinuousLoadBulletStart __lS_ = new WeaponEventContinuousLoadBulletStart;
963 WeaponEventContinuousLoadBulletEnd __lE_ = new WeaponEventContinuousLoadBulletEnd;
964 WeaponEventCylinderRotate __cr_ = new WeaponEventCylinderRotate;
965 WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
966 WeaponEventAnimBulletHide __bh_ = new WeaponEventAnimBulletHide;
967 WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
968 WeaponEventAnimBulletInMagazine __bM_ = new WeaponEventAnimBulletInMagazine;
969 WeaponEventAnimBulletShow2 _bs2_ = new WeaponEventAnimBulletShow2;
970
971 m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
972 m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
973 m_fsm.AddTransition(new WeaponTransition(m_start, __cr_, m_rotate));
974
975 m_fsm.AddTransition(new WeaponTransition(m_eject, __cr_, m_rotate));
976 m_fsm.AddTransition(new WeaponTransition(m_rotate, __be_, m_eject));
977
978 m_fsm.AddTransition(new WeaponTransition(m_eject, __bs_, m_chamber));
979 m_fsm.AddTransition(new WeaponTransition(m_rotate, __bs_, m_chamber));
980
981 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())));
982 m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_endLoop));
983 //m_fsm.AddTransition(new WeaponTransition(m_rotate, __bh_, m_chamber));
984 //m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __bh_, m_hideB));
985 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __cr_, m_rotate));
986
987 m_fsm.AddTransition(new WeaponTransition(m_endLoop, _fin_, null));
988
989 // Safety exits
990 m_fsm.AddTransition(new WeaponTransition(m_w4sb2, _fin_, null));
991 m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
992 m_fsm.AddTransition(new WeaponTransition(m_rotate, _fin_, null));
993 m_fsm.AddTransition(new WeaponTransition(m_eject , _fin_, null));
994 m_fsm.AddTransition(new WeaponTransition(m_start , _fin_, null));
995
996 m_fsm.SetInitialState(m_start);
997 }
ref WeaponCylinderRotate m_rotate
Definition WeaponChambering.c:940

Перекрестные ссылки m_action, m_chamber, m_eject, m_endActionType, m_endLoop, m_start, m_startActionType, m_w4sb2, m_weapon и WeaponEjectAllMuzzles().

◆ WeaponRechamber()

void WeaponRechamber ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
int actionEject = -1,
int actionTypeEject = -1,
int actionLoad = -1,
int actionTypeLoad = -1 )
inlineprivate
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 }
int m_actionEject
Definition WeaponReChamber.c:5
int m_actionLoad
Definition WeaponReChamber.c:7
void WeaponEjectBullet(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
Definition WeaponEjectBullet.c:50
int m_actionTypeEject
Definition WeaponReChamber.c:6
void WeaponChambering(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
Definition WeaponChambering.c:386
int m_actionTypeLoad
Definition WeaponReChamber.c:8

Перекрестные ссылки m_weapon, WeaponChambering() и WeaponEjectBullet().

◆ WeaponReplacingMagAndChamberNext()

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

Перекрестные ссылки m_action, m_chamber, m_eject, m_start, m_weapon и WeaponGuardHasAmmo().

◆ WeaponStartAction()

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

specific action sub-type

10 {
13 }

Перекрестные ссылки m_action.

Используется в RifleEjectCasing() и WeaponAttachMagazine().

◆ WeaponUnjamming()

void WeaponUnjamming ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate
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 }

Перекрестные ссылки m_action, m_chamber, m_eject, m_start, m_weapon и WeaponGuardHasAmmo().

Поля

◆ m_action

WeaponActions m_action
private

◆ m_actionEject

int m_actionEject
private

◆ m_actionLoad

int m_actionLoad
private

◆ m_actionType

int m_actionType
private

action to be played

◆ m_actionTypeEject

int m_actionTypeEject
private

◆ m_actionTypeLoad

int m_actionTypeLoad
private

◆ m_attach [1/2]

ref AttachNewMagazine m_attach
private

◆ m_attach [2/2]

ref AttachNewMagazine_W4T m_attach
private

◆ m_chamber [1/4]

ref WeaponChamberFromAttMag_W4T m_chamber
private

◆ m_chamber [2/4]

ref WeaponChamberFromAttMag_W4T m_chamber
private

◆ m_chamber [3/4]

ref WeaponChambering_Base m_chamber
private

◆ m_chamber [4/4]

◆ m_chamberFromInnerMag

ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag
private

◆ m_damage

float m_damage
private

◆ m_detach

ref DetachOldMagazine m_detach
private

◆ m_dst

ref InventoryLocation m_dst
private

magazine that will be detached

detached magazine

Используется в OnEntry().

◆ m_dstMagazine

Magazine m_dstMagazine
private

Используется в OnEntry().

◆ m_dtAccumulator

float m_dtAccumulator
private

◆ m_eje

ref WeaponEjectBullet m_eje
private

source of the loaded cartridge

◆ m_eject [1/5]

ref WeaponEjectCasing m_eject
private

◆ m_eject [2/5]

◆ m_eject [3/5]

ref WeaponEjectAllMuzzles m_eject
private

◆ m_eject [4/5]

◆ m_eject [5/5]

◆ m_ejectChamber

ref WeaponEjectAndChamberFromAttMag m_ejectChamber
private

◆ m_endActionType

int m_endActionType
private

◆ m_endLoop

ref WeaponStartAction m_endLoop
private

◆ m_fire [1/2]

ref WeaponFire m_fire
private

◆ m_fire [2/2]

ref WeaponFireWithEject m_fire
private

◆ m_fsm

ref WeaponFSM m_fsm
private

hierarchical parent state of this state (or null)

Используется в AddTransition(), GetFSM(), HasFSM(), IsWaitingForActionFinish(), LoadCurrentFSMState(), OnAbort(), OnEntry(), OnUpdate(), ProcessEvent() и SaveCurrentFSMState().

◆ m_hideB

ref BulletHide_W4T m_hideB
private

◆ m_hideM

ref MagazineHide_W4T m_hideM
private

◆ m_hideOld

ref OldMagazineHide m_hideOld
private

◆ m_InternalID

int m_InternalID = -1
private

nested state machine (or null)

Используется в GetInternalStateID() и SetInternalStateID().

◆ m_jamTime

float m_jamTime
private

◆ m_loa

ref WeaponChambering m_loa
private

◆ m_magazine

Magazine m_magazine
private

Используется в OnEntry().

◆ m_magazineType

string m_magazineType
private

◆ m_newDst

ref InventoryLocation 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

◆ m_newMagazine

Magazine m_newMagazine
private

magazine that will be detached

◆ m_newSrc

ref InventoryLocation m_newSrc
private

magazine that will be removed from inventory

◆ m_oldMagazine

Magazine m_oldMagazine
private

◆ m_onBE

◆ m_onBEFireOut

ref WeaponEjectCasing_W4T m_onBEFireOut
private

◆ m_onCK

ref WeaponCharging_CK m_onCK
private

◆ m_parentState

WeaponStateBase m_parentState
private

weapon that this state relates to

Используется в GetParentState(), SetParentState() и WeaponStateBase().

◆ m_rotate

ref WeaponCylinderRotate m_rotate
private

◆ m_srcMagazine

Magazine m_srcMagazine
private

destination of the ejected cartridge

Используется в OnEntry().

◆ m_srcMagazinePrevLocation

ref InventoryLocation m_srcMagazinePrevLocation
private

source of the cartridge

◆ m_start [1/5]

ref WeaponStartAction m_start
private

source of the cartridge

detached magazine destination

source of the loaded cartridge

◆ m_start [2/5]

ref WeaponStartAction m_start
private

◆ m_start [3/5]

ref WeaponCharging_Start m_start
private

◆ m_start [4/5]

ref WeaponEjectBullet_Start m_start
private

destination of the cartridge

◆ m_start [5/5]

ref WeaponUnjamming_Start m_start
private

◆ m_startActionType

int m_startActionType
private

◆ m_store

ref WeaponDetachingMag_Store m_store
private

◆ m_swapMags

ref SwapOldAndNewMagazine m_swapMags
private

◆ m_type

string m_type
private

◆ m_w4sb2

◆ m_w4t [1/2]

ref WeaponChambering_W4T m_w4t
private

◆ m_w4t [2/2]

ref WeaponUnjamming_W4T m_w4t
private

◆ m_weapon


Объявления и описания членов классов находятся в файлах: