9 Magazine m_dstMagazine;
12 ref WeaponEjectBullet m_eje;
13 ref WeaponChambering m_loa;
15 void WeaponRechamber (
Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
int actionEject = -1,
int actionTypeEject = -1,
int actionLoad = -1,
int actionTypeLoad = -1)
17 m_actionEject = actionEject;
18 m_actionTypeEject = actionTypeEject;
19 m_actionLoad = actionLoad;
20 m_actionTypeLoad = actionTypeLoad;
23 m_eje =
new WeaponEjectBullet(
m_weapon,
this, m_actionEject, m_actionTypeEject);
24 m_loa =
new WeaponChambering(
m_weapon,
this, m_actionLoad, m_actionTypeLoad);
32 m_fsm.SetInitialState(m_eje);
44 int mi =
m_weapon.GetCurrentMuzzle();
45 string magazineTypeName =
m_weapon.GetChamberedCartridgeMagazineTypeName(mi);
48 if (
m_weapon.GetCartridgeInfo(mi, damage, type))
50 m_dstMagazine = DayZPlayerUtils.SelectStoreCartridge(e.m_player,
m_weapon, mi,
m_srcMagazine, damage, magazineTypeName);
53 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponRechamber - error, cannot prepare mag for catridge, magType=" + magazineTypeName);
57 e.m_magazine = m_dstMagazine;
66 m_eje.m_dstMagazine = NULL;
67 m_loa.m_srcMagazine = NULL;
72 if (!super.SaveCurrentFSMState(ctx))
75 if (!ctx.Write(m_dstMagazine))
77 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponChambering.SaveCurrentFSMState: cannot save m_dstMagazine for weapon=" +
m_weapon);
82 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" +
m_weapon);
90 if (!super.LoadCurrentFSMState(ctx, version))
93 if (!ctx.Read(m_dstMagazine))
95 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponChambering.LoadCurrentFSMState: cannot read m_dstMagazine for weapon=" +
m_weapon);
100 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" +
m_weapon);
void wpnDebugPrint(string s)
Serialization general interface. Serializer API works with:
signalize mechanism manipulation
weapon finite state machine
represent weapon state base
void Error(string err)
Messagebox with error message.
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
HandStateEquipped OnEntry
enum FSMTransition WeaponTransition
class WeaponChambering_Chamber_OnEntry extends WeaponChambering_Base OnExit
override bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
override bool SaveCurrentFSMState(ParamsWriteContext ctx)