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

script counterpart to engine's class Weapon Подробнее...

Защищенные члены

float GetWeightSpecialized (bool forceRecalc=false)
 
void AssembleGun ()
 override on weapons with some assembly required
 
bool CanProcessAction (int action, int actionType)
 
bool HasActionAbility (int action, int actionType)
 query if weapon supports action and actionType
 
int GetAbilityCount ()
 
AbilityRecord GetAbility (int index)
 
bool CanProcessWeaponEvents ()
 
WeaponStateBase GetCurrentState ()
 returns currently active state
 
bool IsWaitingForActionFinish ()
 returns true if state machine started playing action/actionType and waits for finish
 
bool IsIdle ()
 
bool ProcessWeaponEvent (WeaponEventBase e)
 weapon's fsm handling of events @NOTE: warning: ProcessWeaponEvent can be called only within DayZPlayer::HandleWeapons (or CommandHandler)
 
bool ProcessWeaponAbortEvent (WeaponEventBase e)
 
bool CanChamberBullet (int muzzleIndex, Magazine mag)
 
void SetWeaponAnimState (int state)
 
void ResetWeaponAnimState ()
 
int GetWeaponAnimState ()
 
void EEFired (int muzzleType, int mode, string ammoType)
 
bool JamCheck (int muzzleIndex)
 
void ShowBullet (int muzzleIndex)
 
void HideBullet (int muzzleIndex)
 
bool IsJammed ()
 
bool CanEjectBullet ()
 
void SetJammed (bool value)
 
float GetSyncChanceToJam ()
 
float GetChanceToJam ()
 
void SyncSelectionState (bool has_bullet, bool has_mag)
 
void ForceSyncSelectionState ()
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
void SaveCurrentFSMState (ParamsWriteContext ctx)
 
bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
 
override void AfterStoreLoad ()
 
override void OnStoreSave (ParamsWriteContext ctx)
 
int GetInternalStateID ()
 
int GetCurrentStableStateID ()
 tries to return identifier of current stable state (or nearest stable state if unstable state is currently running)
 
void RandomizeFSMState ()
 With the parameters given, selects a random suitable state for the FSM of the weapon @WARNING: Weapon_Base.Synchronize call might be needed, if this method is called while clients are connected.
 
array< MuzzleStateGetMuzzleStates ()
 Helper method for RandomizeFSMState.
 

Защищенные данные

const float DEFAULT_DAMAGE_ON_SHOT = 0.05
 
ref array< ref AbilityRecordm_abilities = new array<ref AbilityRecord>
 
ref WeaponFSM m_fsm
 weapon abilities
 
bool m_isJammed = false
 weapon state machine
 
bool m_LiftWeapon = false
 
bool m_BayonetAttached
 
bool m_ButtstockAttached
 
bool m_Charged = false
 
bool m_WeaponOpen = false
 
bool m_WasIronSight
 
int m_BurstCount
 
int m_BayonetAttachmentIdx
 
int m_ButtstockAttachmentIdx
 
int m_weaponAnimState = -1
 
int m_magazineSimpleSelectionIndex = -1
 animation state the weapon is in, -1 == uninitialized
 
int m_weaponHideBarrelIdx = -1
 
float m_DmgPerShot = 0
 
float m_WeaponLength
 
float m_WeaponLiftCheckVerticalOffset
 
float m_ShoulderDistance
 
vector m_LastLiftPosition
 
int m_LastLiftHit
 
ref array< intm_bulletSelectionIndex = new array<int>
 
ref array< floatm_DOFProperties
 
ref array< floatm_ChanceToJam = new array<float>
 
float m_ChanceToJamSync = 0
 
ref PropertyModifiers m_PropertyModifierObject
 
PhxInteractionLayers hit_mask = PhxInteractionLayers.CHARACTER | PhxInteractionLayers.BUILDING | PhxInteractionLayers.DOOR | PhxInteractionLayers.VEHICLE | PhxInteractionLayers.ROADWAY | PhxInteractionLayers.TERRAIN | PhxInteractionLayers.ITEM_SMALL | PhxInteractionLayers.ITEM_LARGE | PhxInteractionLayers.FENCE | PhxInteractionLayers.AI
 
ref Timer m_DelayedValidationTimer
 

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

void Weapon_Base ()
 
void InitStateMachine ()
 
override void EEInit ()
 
void SetInitialState (WeaponStableState initState)
 
bool IsCharged ()
 
void SetCharged (bool value)
 
bool IsWeaponOpen ()
 
void SetWeaponOpen (bool value)
 
override int GetSlotsCountCorrect ()
 Returns number of slots for attachments corrected for weapons.
 

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

const int SAMF_DEFAULT = WeaponWithAmmoFlags.CHAMBER | WeaponWithAmmoFlags.MAX_CAPACITY_MAG
 Full highest capacity magazine + chambered round.
 
const int SAMF_RNG = WeaponWithAmmoFlags.CHAMBER_RNG | WeaponWithAmmoFlags.QUANTITY_RNG
 Random bullet quantity + maybe chambered round.
 
const float VALIDATE_DELAY = 5.0
 Validation on client side delay to have time properly synchronize attachments needed for check.
 
float m_coolDownTime = 0
 

Weapon With Ammo

Helpers for spawning ammo/magazine in weapon For the flags, either a combination of WeaponWithAmmoFlags can be used Or one of the preset 'const int' with 'SAMF_' prefix (SAMF_DEFAULT, SAMF_RNG)

bool SpawnAmmo (string magazineType="", int flags=WeaponWithAmmoFlags.CHAMBER)
 General method trying to attch magazine, fill inner magazine and fill chamber.
 
Magazine SpawnAttachedMagazine (string magazineType="", int flags=WeaponWithAmmoFlags.CHAMBER)
 Try to spawn and attach a magazine.
 
bool FillInnerMagazine (string ammoType="", int flags=WeaponWithAmmoFlags.CHAMBER)
 Try to fill the inner magazine.
 
bool FillChamber (string ammoType="", int flags=WeaponWithAmmoFlags.CHAMBER)
 Try to fill the chamber.
 
override int GetSlotsCountCorrect ()
 Returns number of slots for attachments corrected for weapons.
 
PropertyModifiers GetPropertyModifierObject ()
 
void OnFire (int muzzle_index)
 
void OnFireModeChange (int fireMode)
 
void DelayedValidateAndRepair ()
 
void ValidateAndRepair ()
 
override void OnInventoryEnter (Man player)
 
override void OnInventoryExit (Man player)
 
override void EEItemAttached (EntityAI item, string slot_name)
 
override void EEItemDetached (EntityAI item, string slot_name)
 
override void EEItemLocationChanged (notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override bool CanReleaseAttachment (EntityAI attachment)
 
override bool CanRemoveFromHands (EntityAI parent)
 
bool IsRemoteWeapon ()
 
void SyncEventToRemote (WeaponEventBase e)
 
RecoilBase SpawnRecoilObject ()
 
int GetWeaponSpecificCommand (int weaponAction, int subCommand)
 
bool CanFire ()
 
bool CanEnterIronsights ()
 
bool InitDOFProperties (out array< float > temp_array)
 Initializes DOF properties for weapon's ironsight/optics cameras.
 
bool InitReliability (out array< float > reliability_array)
 
bool InitWeaponLength ()
 gets weapon length from config for weaponlift raycast
 
bool InitWeaponLiftCheckVerticalOffset ()
 gets weapon vertical offset from config for weaponlift raycast
 
bool InitShoulderDistance ()
 gets approximate weapon distance from shoulder from config
 
ref array< floatGetWeaponDOF ()
 
bool GetWasIronSight ()
 
void SetWasIronSight (bool state)
 
bool LiftWeaponCheck (PlayerBase player)
 
bool LiftWeaponRaycastResultCheck (notnull RaycastRVResult res)
 Return whether provided material triggers weapon lift (true) or not (false).
 
float GetEffectiveAttachmentLength ()
 Returns effective length of attachments that influence total weapon length.
 
void SetSyncJammingChance (float jamming_chance)
 
bool EjectCartridge (int muzzleIndex, out float ammoDamage, out string ammoTypeName)
 unload bullet from chamber or internal magazine
 
bool CopyWeaponStateFrom (notnull Weapon_Base src)
 
override void SetBayonetAttached (bool pState, int slot_idx=-1)
 attachment helpers (firearm melee)
 
override bool HasBayonetAttached ()
 
override int GetBayonetAttachmentIdx ()
 
override void SetButtstockAttached (bool pState, int slot_idx=-1)
 
override bool HasButtstockAttached ()
 
override int GetButtstockAttachmentIdx ()
 
void HideWeaponBarrel (bool state)
 
void ShowMagazine ()
 
void HideMagazine ()
 
override EntityAI ProcessMeleeItemDamage (int mode=0)
 
bool IsShowingChamberedBullet ()
 
int GetBurstCount ()
 
void ResetBurstCount ()
 
override void SetActions ()
 
override bool CanBeUsedForSuicide ()
 
override void OnDebugSpawn ()
 
bool AddJunctureToAttachedMagazine (PlayerBase player, int timeoutMS)
 
void ClearJunctureToAttachedMagazine (PlayerBase player)
 
void SetNextWeaponMode (int muzzleIndex)
 
void SetCoolDown (float coolDownTime)
 
void UpdateCoolDown (float dt)
 
bool IsCoolDown ()
 
static Weapon_Base CreateWeaponWithAmmo (string weaponType, string magazineType="", int flags=WeaponWithAmmoFlags.CHAMBER)
 Create weapon with ammo.
 

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

script counterpart to engine's class Weapon

См. определение в файле InventoryItem.c строка 48