Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
WeaponManager Class Reference

Protected Member Functions

void WeaponManager (PlayerBase player)
bool AttachMagazine (Magazine mag, ActionBase control_action=NULL)
bool CanAttachMagazine (Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
bool CanDetachMagazine (Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
bool CanEjectBullet (Weapon_Base wpn, bool reservationCheck=true)
bool CanEjectBulletVerified ()
bool CanFire (Weapon_Base wpn)
bool CanLoadBullet (Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
bool CanLoadMultipleBullet (Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
bool CanSwapMagazine (Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
bool CanUnjam (Weapon_Base wpn, bool reservationCheck=true)
bool DetachMagazine (InventoryLocation invLoc, ActionBase control_action=NULL)
bool EjectBullet (ActionBase control_action=NULL)
bool EjectBulletVerified (ActionBase control_action=NULL)
void Fire (Weapon_Base wpn)
bool InventoryReservation (Magazine mag, InventoryLocation invLoc)
bool LoadBullet (Magazine mag, ActionBase control_action=NULL)
bool LoadMultiBullet (Magazine mag, ActionBase control_action=NULL)
void LoadMultiBulletStop ()
void SetEjectBulletTryTimestamp ()
bool SetNextMuzzleMode ()
bool SwapMagazine (Magazine mag, ActionBase control_action=NULL)
bool SwapMagazineEx (Magazine mag, InventoryLocation invLoc, ActionBase control_action=NULL)
bool Unjam (ActionBase control_action=NULL)

Protected Attributes

const int FORCE_EJECT_BULLET_TIMEOUT = 2000
int m_AnimationRefreshCooldown
bool m_canEnd
ActionBase m_ControlAction
int m_ForceEjectBulletTimestamp
bool m_InIronSight
bool m_InOptic
bool m_InProgress
bool m_IsEventSended
bool m_justStart
int m_LastAcknowledgmentID
MagazineStorage m_MagazineInHand
ref array< Magazine > m_MagazinePilesInInventory
ref array< MagazineStorage > m_MagazineStorageInInventory
float m_NewJamChance
ref InventoryLocation m_PendingInventoryLocation
Magazine m_PendingTargetMagazine
int m_PendingWeaponAction
int m_PendingWeaponActionAcknowledgmentID
PlayerBase m_player
Magazine m_PreparedMagazine
bool m_readyToStart
ref array< Magazine > m_SuitableMagazines
ref InventoryLocation m_TargetInventoryLocation
bool m_WaitToSyncJamChance
bool m_WantContinue
Weapon_Base m_WeaponInHand

Private Member Functions

int CompareMagazinesSuitability (Magazine mag1, Magazine mag2)
void DelayedRefreshAnimationState (int delay)
string GetCurrentModeName ()
Magazine GetNextPreparedMagazine (out int startIdx)
Magazine GetPreparedMagazine ()
bool IsRunning ()
bool OnInputUserDataProcess (int userDataType, ParamsReadContext ctx)
void OnLiftWeapon ()
void OnMagazineAttach (Magazine mag)
void OnMagazineDetach (Magazine mag)
void OnMagazineInventoryEnter (Magazine mag)
void OnMagazineInventoryExit (Magazine mag)
void OnSyncJuncture (int pJunctureID, ParamsReadContext pCtx)
void OnWeaponActionEnd ()
bool PrepareInventoryLocationForMagazineSwap (notnull Weapon_Base wpn, notnull Magazine new_mag, out InventoryLocation new_il)
void Refresh ()
void RefreshAnimationState ()
void SetRunning (bool value)
void SetSutableMagazines ()
void SortMagazineAfterLoad ()
bool StartAction (int action, Magazine mag, InventoryLocation il, ActionBase control_action=NULL)
void StartPendingAction ()
void Synchronize ()
void Update (float deltaT)
bool WantContinue ()

Private Attributes

const float MAX_DROP_MAGAZINE_DISTANCE_SQ = 4

Detailed Description

Definition at line 1 of file weaponmanager.c.

Constructor & Destructor Documentation

◆ WeaponManager()

Member Function Documentation

◆ AttachMagazine()

bool AttachMagazine ( Magazine mag,
ActionBase control_action = NULL )
inlineprotected

Definition at line 398 of file weaponmanager.c.

References AT_WPN_ATTACH_MAGAZINE, and StartAction().

◆ CanAttachMagazine()

bool CanAttachMagazine ( Weapon_Base wpn,
Magazine mag,
bool reservationCheck = true )
inlineprotected

Definition at line 91 of file weaponmanager.c.

References Class::CastTo(), InventoryLocation::GetParent(), and m_player.

Referenced by ManBase::GetMagazineToReload().

◆ CanDetachMagazine()

bool CanDetachMagazine ( Weapon_Base wpn,
Magazine mag,
bool reservationCheck = true )
inlineprotected

Definition at line 180 of file weaponmanager.c.

References m_player.

◆ CanEjectBullet()

bool CanEjectBullet ( Weapon_Base wpn,
bool reservationCheck = true )
inlineprotected

Definition at line 310 of file weaponmanager.c.

References Weapon_Base::CanEjectBullet(), and m_player.

◆ CanEjectBulletVerified()

bool CanEjectBulletVerified ( )
inlineprotected

◆ CanFire()

bool CanFire ( Weapon_Base wpn)
inlineprotected

Definition at line 79 of file weaponmanager.c.

References m_player.

◆ CanLoadBullet()

bool CanLoadBullet ( Weapon_Base wpn,
Magazine mag,
bool reservationCheck = true )
inlineprotected

Definition at line 200 of file weaponmanager.c.

References Weapon_Base::CanChamberBullet(), and m_player.

Referenced by ManBase::GetMagazineToReload().

◆ CanLoadMultipleBullet()

bool CanLoadMultipleBullet ( Weapon_Base wpn,
Magazine mag,
bool reservationCheck = true )
inlineprotected

Definition at line 231 of file weaponmanager.c.

References Weapon_Base::CanChamberBullet(), and m_player.

◆ CanSwapMagazine()

bool CanSwapMagazine ( Weapon_Base wpn,
Magazine mag,
bool reservationCheck = true )
inlineprotected

◆ CanUnjam()

bool CanUnjam ( Weapon_Base wpn,
bool reservationCheck = true )
inlineprotected

Definition at line 286 of file weaponmanager.c.

References m_player.

◆ CompareMagazinesSuitability()

int CompareMagazinesSuitability ( Magazine mag1,
Magazine mag2 )
inlineprivate

Definition at line 1202 of file weaponmanager.c.

Referenced by OnMagazineInventoryEnter().

◆ DelayedRefreshAnimationState()

void DelayedRefreshAnimationState ( int delay)
inlineprivate

◆ DetachMagazine()

bool DetachMagazine ( InventoryLocation invLoc,
ActionBase control_action = NULL )
inlineprotected

Definition at line 403 of file weaponmanager.c.

References AT_WPN_DETACH_MAGAZINE, and StartAction().

◆ EjectBullet()

bool EjectBullet ( ActionBase control_action = NULL)
inlineprotected

Definition at line 443 of file weaponmanager.c.

References AT_WPN_EJECT_BULLET, and StartAction().

◆ EjectBulletVerified()

bool EjectBulletVerified ( ActionBase control_action = NULL)
inlineprotected

◆ Fire()

void Fire ( Weapon_Base wpn)
inlineprotected

Definition at line 485 of file weaponmanager.c.

References m_player.

◆ GetCurrentModeName()

string GetCurrentModeName ( )
inlineprivate

Definition at line 1335 of file weaponmanager.c.

References m_WeaponInHand.

◆ GetNextPreparedMagazine()

Magazine GetNextPreparedMagazine ( out int startIdx)
inlineprivate

Definition at line 1101 of file weaponmanager.c.

References m_SuitableMagazines.

Referenced by FirearmActionLoadMultiBulletQuick::Start().

◆ GetPreparedMagazine()

Magazine GetPreparedMagazine ( )
inlineprivate

Definition at line 1078 of file weaponmanager.c.

References m_SuitableMagazines.

◆ InventoryReservation()

◆ IsRunning()

bool IsRunning ( )
inlineprivate

Definition at line 874 of file weaponmanager.c.

References m_InProgress.

◆ LoadBullet()

bool LoadBullet ( Magazine mag,
ActionBase control_action = NULL )
inlineprotected

Definition at line 423 of file weaponmanager.c.

References AT_WPN_LOAD_BULLET, and StartAction().

◆ LoadMultiBullet()

bool LoadMultiBullet ( Magazine mag,
ActionBase control_action = NULL )
inlineprotected

Definition at line 428 of file weaponmanager.c.

References AT_WPN_LOAD_MULTI_BULLETS_START, and StartAction().

◆ LoadMultiBulletStop()

void LoadMultiBulletStop ( )
inlineprotected

Definition at line 433 of file weaponmanager.c.

References m_InProgress, and m_WantContinue.

◆ OnInputUserDataProcess()

◆ OnLiftWeapon()

void OnLiftWeapon ( )
inlineprivate

Definition at line 1329 of file weaponmanager.c.

References m_WeaponInHand.

◆ OnMagazineAttach()

void OnMagazineAttach ( Magazine mag)
inlineprivate

Definition at line 1192 of file weaponmanager.c.

References OnMagazineInventoryExit().

◆ OnMagazineDetach()

void OnMagazineDetach ( Magazine mag)
inlineprivate

Definition at line 1197 of file weaponmanager.c.

References OnMagazineInventoryEnter().

◆ OnMagazineInventoryEnter()

void OnMagazineInventoryEnter ( Magazine mag)
inlineprivate

◆ OnMagazineInventoryExit()

void OnMagazineInventoryExit ( Magazine mag)
inlineprivate

◆ OnSyncJuncture()

◆ OnWeaponActionEnd()

◆ PrepareInventoryLocationForMagazineSwap()

bool PrepareInventoryLocationForMagazineSwap ( notnull Weapon_Base wpn,
notnull Magazine new_mag,
out InventoryLocation new_il )
inlineprivate

◆ Refresh()

void Refresh ( )
inlineprivate

Definition at line 884 of file weaponmanager.c.

References OnWeaponActionEnd().

◆ RefreshAnimationState()

void RefreshAnimationState ( )
inlineprivate

◆ SetEjectBulletTryTimestamp()

void SetEjectBulletTryTimestamp ( )
inlineprotected

Definition at line 333 of file weaponmanager.c.

References g_Game, and m_ForceEjectBulletTimestamp.

◆ SetNextMuzzleMode()

bool SetNextMuzzleMode ( )
inlineprotected

Definition at line 480 of file weaponmanager.c.

References AT_WPN_SET_NEXT_MUZZLE_MODE, and StartAction().

◆ SetRunning()

void SetRunning ( bool value)
inlineprivate

Definition at line 879 of file weaponmanager.c.

References m_InProgress.

◆ SetSutableMagazines()

◆ SortMagazineAfterLoad()

void SortMagazineAfterLoad ( )
inlineprivate

◆ StartAction()

◆ StartPendingAction()

◆ SwapMagazine()

bool SwapMagazine ( Magazine mag,
ActionBase control_action = NULL )
inlineprotected

◆ SwapMagazineEx()

bool SwapMagazineEx ( Magazine mag,
InventoryLocation invLoc,
ActionBase control_action = NULL )
inlineprotected

Definition at line 418 of file weaponmanager.c.

References AT_WPN_SWAP_MAGAZINE, and StartAction().

◆ Synchronize()

◆ Unjam()

bool Unjam ( ActionBase control_action = NULL)
inlineprotected

Definition at line 438 of file weaponmanager.c.

References AT_WPN_UNJAM, and StartAction().

◆ Update()

◆ WantContinue()

bool WantContinue ( )
inlineprivate

Definition at line 1073 of file weaponmanager.c.

References m_WantContinue.

Field Documentation

◆ FORCE_EJECT_BULLET_TIMEOUT

const int FORCE_EJECT_BULLET_TIMEOUT = 2000
protected

Definition at line 28 of file weaponmanager.c.

Referenced by CanEjectBulletVerified().

◆ m_AnimationRefreshCooldown

int m_AnimationRefreshCooldown
protected

Definition at line 43 of file weaponmanager.c.

Referenced by WeaponManager(), DelayedRefreshAnimationState(), and Update().

◆ m_canEnd

bool m_canEnd
protected

Definition at line 15 of file weaponmanager.c.

Referenced by WeaponManager(), StartPendingAction(), and Update().

◆ m_ControlAction

ActionBase m_ControlAction
protected

Definition at line 25 of file weaponmanager.c.

Referenced by WeaponManager(), OnWeaponActionEnd(), and StartAction().

◆ m_ForceEjectBulletTimestamp

int m_ForceEjectBulletTimestamp
protected

◆ m_InIronSight

bool m_InIronSight
protected

Definition at line 20 of file weaponmanager.c.

Referenced by Update().

◆ m_InOptic

bool m_InOptic
protected

Definition at line 21 of file weaponmanager.c.

Referenced by Update().

◆ m_InProgress

◆ m_IsEventSended

bool m_IsEventSended
protected

◆ m_justStart

bool m_justStart
protected

Definition at line 16 of file weaponmanager.c.

Referenced by Update().

◆ m_LastAcknowledgmentID

int m_LastAcknowledgmentID
protected

Definition at line 7 of file weaponmanager.c.

Referenced by WeaponManager(), and Synchronize().

◆ m_MagazineInHand

MagazineStorage m_MagazineInHand
protected

Definition at line 24 of file weaponmanager.c.

Referenced by WeaponManager(), SetSutableMagazines(), and Update().

◆ m_MagazinePilesInInventory

ref array<Magazine> m_MagazinePilesInInventory
protected

◆ m_MagazineStorageInInventory

ref array<MagazineStorage> m_MagazineStorageInInventory
protected

◆ m_NewJamChance

float m_NewJamChance
protected

Definition at line 39 of file weaponmanager.c.

Referenced by WeaponManager(), OnSyncJuncture(), and Update().

◆ m_PendingInventoryLocation

◆ m_PendingTargetMagazine

Magazine m_PendingTargetMagazine
protected

◆ m_PendingWeaponAction

int m_PendingWeaponAction
protected

◆ m_PendingWeaponActionAcknowledgmentID

int m_PendingWeaponActionAcknowledgmentID
protected

◆ m_player

◆ m_PreparedMagazine

Magazine m_PreparedMagazine
protected

Definition at line 36 of file weaponmanager.c.

Referenced by WeaponManager(), and SetSutableMagazines().

◆ m_readyToStart

bool m_readyToStart
protected

Definition at line 22 of file weaponmanager.c.

Referenced by WeaponManager(), OnSyncJuncture(), OnWeaponActionEnd(), StartAction(), and Update().

◆ m_SuitableMagazines

ref array<Magazine> m_SuitableMagazines
protected

◆ m_TargetInventoryLocation

ref InventoryLocation m_TargetInventoryLocation
protected

Definition at line 11 of file weaponmanager.c.

Referenced by InventoryReservation(), OnSyncJuncture(), and OnWeaponActionEnd().

◆ m_WaitToSyncJamChance

bool m_WaitToSyncJamChance
protected

Definition at line 40 of file weaponmanager.c.

Referenced by WeaponManager(), and Update().

◆ m_WantContinue

bool m_WantContinue
protected

◆ m_WeaponInHand

◆ MAX_DROP_MAGAZINE_DISTANCE_SQ

const float MAX_DROP_MAGAZINE_DISTANCE_SQ = 4
private

Definition at line 3 of file weaponmanager.c.

Referenced by WeaponStateBase::OnAbort(), and WeaponStateBase::OnExit().


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