![]() |
Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
|
Go to the source code of this file.
Enumerations | |
| enum | MuzzleState { U = -1 , E = 0 , F = 1 , L = 2 } |
Functions | |
| int | GetCurrentStateID () |
| override bool | IsIdle () |
| override void | OnEntry (WeaponEventBase e) |
| override void | OnExit (WeaponEventBase e) |
| override void | OnUpdate (float dt) |
| void | SyncAnimState () |
| void | WeaponStableState (Weapon_Base w=NULL, WeaponStateBase parent=NULL, int anim_state=-1) |
Weapon state properties | |
Properties defining the state in several properties for other systems Override these to set them up Several systems depends on this: WeaponFSM.RandomizeFSMState, which picks out a suitable FSM state when attaching magazine through CE WeaponFSM.ValidateAndRepair, which will attempt to identify a desync and repair the FSM state if so @WARNING So it is important to set these up correctly to prevent any desync of weapon FSM and actual wepon state | |
| bool | HasBullet () |
| Whether there is a bullet in the chamber @NOTE: This should only be false when it is empty So this is true when there is a bullet in the chamber Regardless of the bullet being loaded, firedout or jammed. | |
| bool | HasMagazine () |
| Whether there is a magazine attached. | |
| void | InitMuzzleArray () |
| Override with the filling of m_muzzleHasBullet. | |
| bool | IsDischarged () |
| Whether the gun is discharged. | |
| bool | IsJammed () |
| Whether the gun is jammed. | |
| bool | IsRepairEnabled () |
| Whether WeaponFSM.ValidateAndRepair should be applied on this state @NOTE: This property was implemented at the same time as ValARep To have it disabled by default In case there are modders who created their own state But potentially did not set up their properties correctly As having ValARep run on an improper setup would result in horrible VME spam and desync @WARNING: When enabling repair, it is imperative that all properties are set up correctly. | |
| bool | IsSingleState () |
| Special one for when the weapon only has one singular state (like Magnum). | |
| bool | IsWeaponOpen () |
| Whether the gun is open. | |
Weapon state properties helpers | |
Several helpers for better access of certain properties | |
| MuzzleState | GetMuzzleState (int idx) |
| Get chamber state of the muzzle at index. | |
| int | GetMuzzleStateCount () |
| bool | IsChamberFiredOut (int idx) |
| bool | IsChamberFull (int idx) |
| bool | IsChamberValid (int idx) |
| void | ValidateMuzzleArray () |
| Safety check and error message in case not set up correctly. | |
Variables | |
| enum MuzzleState | m_animState |
| ref array< MuzzleState > | m_muzzleHasBullet = new array<MuzzleState>() |
| enum MuzzleState |
| Enumerator | |
|---|---|
| U | UNKNOWN. |
| E | EMPTY. |
| F | FIRED. |
| L | LOADED. |
Definition at line 14 of file weaponstablestate.c.
| int GetCurrentStateID | ( | ) |
Definition at line 97 of file weaponstablestate.c.
| MuzzleState GetMuzzleState | ( | int | idx | ) |
Get chamber state of the muzzle at index.
Definition at line 154 of file weaponstablestate.c.
References m_muzzleHasBullet.
| int GetMuzzleStateCount | ( | ) |
Definition at line 155 of file weaponstablestate.c.
References m_muzzleHasBullet.
| bool HasBullet | ( | ) |
Whether there is a bullet in the chamber @NOTE: This should only be false when it is empty So this is true when there is a bullet in the chamber Regardless of the bullet being loaded, firedout or jammed.
Definition at line 126 of file weaponstablestate.c.
| bool HasMagazine | ( | ) |
Whether there is a magazine attached.
Definition at line 129 of file weaponstablestate.c.
| void InitMuzzleArray | ( | ) |
Override with the filling of m_muzzleHasBullet.
Definition at line 141 of file weaponstablestate.c.
References m_muzzleHasBullet.
Definition at line 157 of file weaponstablestate.c.
References m_muzzleHasBullet.
Referenced by DoubleBarrel_Base::CanChamberBullet(), Weapon::CanChamberBullet(), Weapon_Base::CanChamberBullet(), Weapon::CanFire(), Weapon::GetMuzzleStates(), and Weapon_Base::ShowBullet().
Definition at line 158 of file weaponstablestate.c.
References m_muzzleHasBullet.
Referenced by Weapon::CanChamberBullet(), Weapon_Base::CanEjectBullet(), Weapon::ForceSyncSelectionState(), Weapon::GetMuzzleStates(), and InventoryItemSuper::IsChamberFullEx().
Definition at line 156 of file weaponstablestate.c.
References m_muzzleHasBullet.
| bool IsDischarged | ( | ) |
Whether the gun is discharged.
Definition at line 135 of file weaponstablestate.c.
| override bool IsIdle | ( | ) |
Definition at line 95 of file weaponstablestate.c.
Referenced by Weapon::CanRemoveFromHands(), and ManBase::OnQuickBarSingleUse().
| bool IsJammed | ( | ) |
Whether the gun is jammed.
Definition at line 132 of file weaponstablestate.c.
| bool IsRepairEnabled | ( | ) |
Whether WeaponFSM.ValidateAndRepair should be applied on this state @NOTE: This property was implemented at the same time as ValARep To have it disabled by default In case there are modders who created their own state But potentially did not set up their properties correctly As having ValARep run on an improper setup would result in horrible VME spam and desync @WARNING: When enabling repair, it is imperative that all properties are set up correctly.
Definition at line 119 of file weaponstablestate.c.
| bool IsSingleState | ( | ) |
Special one for when the weapon only has one singular state (like Magnum).
Definition at line 144 of file weaponstablestate.c.
Referenced by ValidateMuzzleArray().
| bool IsWeaponOpen | ( | ) |
Whether the gun is open.
Definition at line 138 of file weaponstablestate.c.
Referenced by OnEntry().
| override void OnEntry | ( | WeaponEventBase | e | ) |
Definition at line 72 of file weaponstablestate.c.
References WeaponStableState::IsDischarged(), WeaponStableState::IsJammed(), IsWeaponOpen(), m_weapon, WeaponStableState::OnEntry(), and SyncAnimState().
| override void OnExit | ( | WeaponEventBase | e | ) |
Definition at line 89 of file weaponstablestate.c.
References m_weapon.
| override void OnUpdate | ( | float | dt | ) |
Definition at line 84 of file weaponstablestate.c.
References SyncAnimState().
| void SyncAnimState | ( | ) |
Definition at line 39 of file weaponstablestate.c.
References Class::CastTo(), fsmDebugSpam(), LogManager::IsWeaponLogEnable(), m_animState, m_weapon, HumanCommandWeapons::SetInitState(), and HumanCommandWeapons::StaticSetInitState().
Referenced by HandStateBase::OnEntry(), OnEntry(), HandStateBase::OnUpdate(), and OnUpdate().
| void ValidateMuzzleArray | ( | ) |
Safety check and error message in case not set up correctly.
Definition at line 163 of file weaponstablestate.c.
References ErrorEx, IsSingleState(), and m_muzzleHasBullet.
Referenced by WeaponStableState().
| void WeaponStableState | ( | Weapon_Base | w = NULL, |
| WeaponStateBase | parent = NULL, | ||
| int | anim_state = -1 ) |
Definition at line 32 of file weaponstablestate.c.
References WeaponStableState::InitMuzzleArray(), m_animState, and ValidateMuzzleArray().
Referenced by Weapon_Base::InitStateMachine().
| enum MuzzleState m_animState |
Referenced by SyncAnimState(), and WeaponStableState().
| ref array<MuzzleState> m_muzzleHasBullet = new array<MuzzleState>() |
Definition at line 30 of file weaponstablestate.c.
Referenced by GetMuzzleState(), GetMuzzleStateCount(), InitMuzzleArray(), WeaponStableState::InitMuzzleArray(), IsChamberFiredOut(), IsChamberFull(), IsChamberValid(), and ValidateMuzzleArray().