81 if (
m_player.GetHumanInventory().GetEntityInHands() !=
wpn)
97 if (
m_player.GetHumanInventory().GetEntityInHands() !=
wpn)
100 if (
wpn.IsDamageDestroyed())
115 mag.GetInventory().GetCurrentInventoryLocation(
invLoc);
138 if (
m_player.GetHumanInventory().GetEntityInHands() !=
wpn)
141 if (
mag.IsDamageDestroyed() ||
wpn.IsDamageDestroyed())
157 mag.GetInventory().GetCurrentInventoryLocation(
invLoc);
186 if (
m_player.GetHumanInventory().GetEntityInHands() !=
wpn)
189 if (
mag.GetHierarchyParent() !=
wpn)
206 if (
m_player.GetHumanInventory().GetEntityInHands() !=
wpn)
209 if (
mag.IsDamageDestroyed() ||
wpn.IsDamageDestroyed())
221 for (
int i = 0;
i <
wpn.GetMuzzleCount();
i++)
223 if (
wpn.CanChamberBullet(
i,
mag))
235 if (
m_player.GetHumanInventory().GetEntityInHands() !=
wpn)
238 if (
wpn.IsDamageDestroyed())
259 if (
m_player.GetHumanInventory().GetEntityInHands() !=
wpn)
268 if (!
wpn.CanEjectBullet())
414 int mi =
wpn.GetCurrentMuzzle();
415 if (
wpn.IsChamberFiredOut(
mi) ||
wpn.IsJammed() ||
wpn.IsChamberEmpty(
mi))
417 wpn.ProcessWeaponEvent(
new WeaponEventTrigger(
m_player));
422 wpn.ProcessWeaponEvent(
new WeaponEventTriggerToJam(
m_player));
424 wpn.ProcessWeaponEvent(
new WeaponEventTrigger(
m_player));
569 mi =
wpn.GetCurrentMuzzle();
596 if (!
il.ReadFromContext(
ctx))
602 if (!
wpn.GetMagazine(
mi))
615 if (!
il.ReadFromContext(
ctx))
714 if (!
GetGame().IsMultiplayer())
761 m_player.GetDayZPlayerInventory().PostWeaponEvent(
new WeaponEventContinuousLoadBulletEnd(
m_player));
776 m_player.GetDayZPlayerInventory().PostWeaponEvent(
new WeaponEventSetNextMuzzleMode(
m_player,
NULL));
832 if (!
GetGame().IsMultiplayer())
961 hcw.SetInitState(
state.m_animState);
1012 MagazineStorage
sMag = MagazineStorage.Cast(
mag);
1061 MagazineStorage
sMag = MagazineStorage.Cast(
mag);
1084 return mag1.GetAmmoCount() -
mag2.GetAmmoCount();
const int AT_WPN_DETACH_MAGAZINE
const int AT_WPN_LOAD_MULTI_BULLETS_END
const int AT_WPN_ATTACH_MAGAZINE
const int AT_WPN_LOAD_BULLET
const int AT_WPN_SWAP_MAGAZINE
const int AT_WPN_LOAD_MULTI_BULLETS_START
const int AT_WPN_EJECT_BULLET
const int AT_WPN_SET_NEXT_MUZZLE_MODE
Super root of all classes in Enforce script.
static void SendWeaponJamChance(DayZPlayer pPlayer, float jamChance)
static const int SJ_WEAPON_ACTION_ACK_REJECT
static const int SJ_WEAPON_ACTION_ACK_ACCEPT
static const int SJ_WEAPON_SET_JAMMING_CHANCE
static void SendWeaponActionAcknowledgment(DayZPlayer pPlayer, int AckID, bool accept)
script counterpart to engine's class Inventory
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
const int c_InventoryReservationTimeoutMS
reservations
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
provides access to slot configuration
Serialization general interface. Serializer API works with:
override float GetChanceToJam()
bool EjectBulletVerified(ActionBase control_action=NULL)
string GetCurrentModeName()
void SetSutableMagazines()
bool CanUnjam(Weapon_Base wpn, bool reservationCheck=true)
void DelayedRefreshAnimationState(int delay)
bool CanEjectBulletVerified()
bool CanLoadBullet(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
bool CanAttachMagazine(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
ActionBase m_ControlAction
int m_PendingWeaponActionAcknowledgmentID
ref array< Magazine > m_MagazinePilesInInventory
bool AttachMagazine(Magazine mag, ActionBase control_action=NULL)
int m_ForceEjectBulletTimestamp
bool LoadBullet(Magazine mag, ActionBase control_action=NULL)
bool CanEjectBullet(Weapon_Base wpn, bool reservationCheck=true)
bool LoadMultiBullet(Magazine mag, ActionBase control_action=NULL)
bool PrepareInventoryLocationForMagazineSwap(notnull Weapon_Base wpn, notnull Magazine new_mag, out InventoryLocation new_il)
Magazine m_PendingTargetMagazine
bool DetachMagazine(InventoryLocation invLoc, ActionBase control_action=NULL)
void LoadMultiBulletStop()
int m_LastAcknowledgmentID
void SortMagazineAfterLoad()
bool m_WaitToSyncJamChance
ref array< Magazine > m_SuitableMagazines
void RefreshAnimationState()
bool CanSwapMagazine(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
Magazine GetNextPreparedMagazine(out int startIdx)
Weapon_Base m_WeaponInHand
bool SwapMagazine(Magazine mag, ActionBase control_action=NULL)
const float MAX_DROP_MAGAZINE_DISTANCE_SQ
void Update(float deltaT)
const int FORCE_EJECT_BULLET_TIMEOUT
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
ref array< MagazineStorage > m_MagazineStorageInInventory
bool CanFire(Weapon_Base wpn)
bool CanDetachMagazine(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
void SetEjectBulletTryTimestamp()
Magazine m_PreparedMagazine
int CompareMagazinesSuitability(Magazine mag1, Magazine mag2)
bool Unjam(ActionBase control_action=NULL)
void SetRunning(bool value)
void WeaponManager(PlayerBase player)
ref InventoryLocation m_PendingInventoryLocation
bool SwapMagazineEx(Magazine mag, InventoryLocation invLoc, ActionBase control_action=NULL)
void Fire(Weapon_Base wpn)
ref InventoryLocation m_TargetInventoryLocation
bool EjectBullet(ActionBase control_action=NULL)
int m_PendingWeaponAction
bool StartAction(int action, Magazine mag, InventoryLocation il, ActionBase control_action=NULL)
MagazineStorage m_MagazineInHand
Magazine GetPreparedMagazine()
void OnMagazineDetach(Magazine mag)
int m_AnimationRefreshCooldown
void OnMagazineAttach(Magazine mag)
void OnMagazineInventoryExit(Magazine mag)
void OnMagazineInventoryEnter(Magazine mag)
void StartPendingAction()
bool InventoryReservation(Magazine mag, InventoryLocation invLoc)
represents weapon's stable state (i.e. the basic states that the weapon will spend the most time in)
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float AbsFloat(float f)
Returns absolute value.