Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
weapon.c
Go to the documentation of this file.
1
4class Weapon extends InventoryItemSuper
5{
6 override bool IsWeapon() { return true; }
7
11 proto native void Synchronize();
12
16 proto native int GetMuzzleCount();
17
23 //proto native int GetMuzzleIndexFromMagazineSlot (int magazineSlotId);
24
30 proto native int GetSlotFromMuzzleIndex(int muzzleIndex);
31
35 proto native int GetCurrentMuzzle();
36
41 proto native void SetCurrentMuzzle(int muzzleIndex);
42
43 proto native int GetMuzzleModeCount(int muzzleIndex);
44 proto native void SetMuzzleMode(int muzzleIndex, int modeIndex);
45 proto native void SetNextMuzzleMode(int muzzleIndex);
46 proto native int GetCurrentModeBurstSize(int muzzleIndex);
47 proto native bool GetCurrentModeAutoFire(int muzzleIndex);
48 proto native int GetCurrentMode(int muzzleIndex);
49 proto native void SetCurrentMode(int muzzleIndex, int mode);
50
51 proto native owned string GetCurrentModeName(int muzzleIndex);
52
57 proto native bool CanFire(int muzzleIndex);
58 proto native bool Fire(int muzzleIndex, vector pos, vector dir, vector speed);
59 proto native bool DryFire(int muzzleIndex);
60 proto native bool DryDryFire(int muzzleIndex);
64 proto native bool EjectCasing(int muzzleIndex);
68 proto native bool CreateRound(int muzzleIndex);
69
74 proto native bool IsChamberEmpty(int muzzleIndex);
79 proto native bool IsChamberFiredOut(int muzzleIndex);
84 proto native bool IsChamberJammed(int muzzleIndex);
90 proto native bool IsChamberEjectable(int muzzleIndex);
91
96 proto native bool IsChamberFull(int muzzleIndex);
97 bool IsChamberFullEx(int muzzleIndex)
98 {
99 return IsChamberFull(muzzleIndex);
100 }
101
106 proto native bool HasInternalMagazine(int muzzleIndex);
107
111 proto native int GetInternalMagazineCartridgeCount(int muzzleIndex);
112
116 proto native int GetInternalMagazineMaxCartridgeCount(int muzzleIndex);
117
122 bool IsInternalMagazineFull(int muzzleIndex) { return GetInternalMagazineMaxCartridgeCount(muzzleIndex) == GetInternalMagazineCartridgeCount(muzzleIndex); }
123
127 proto native int GetTotalCartridgeCount(int muzzleIndex);
128
132 proto native int GetTotalMaxCartridgeCount(int muzzleIndex);
133
137 //proto native int GetChamberAmmoTypeCount(int muzzleIndex);
138
143 proto native owned string GetRandomChamberableAmmoTypeName(int muzzleIndex);
144
145
150 proto native owned string GetChamberAmmoTypeName(int muzzleIndex);
151
159 proto bool GetCartridgeInfo(int muzzleIndex, out float ammoDamage, out string ammoTypeName);
160
169 proto bool GetInternalMagazineCartridgeInfo(int muzzleIndex, int cartridgeIndex, out float ammoDamage, out string ammoTypeName);
170
174 proto bool PopCartridgeFromChamber(int muzzleIndex, out float ammoDamage, out string ammoTypeName);
175
179 proto native bool PushCartridgeToChamber(int muzzleIndex, float ammoDamage, string ammoTypeName);
180
187 proto native void EffectBulletShow(int muzzleIndex, float dmg, string type);
188
193 proto native void EffectBulletHide(int muzzleIndex);
194
195
199 proto native void SetGroundAnimFrameIndex(int groundAnimFrameIndex);
200
204 proto bool PopCartridgeFromInternalMagazine(int muzzleIndex, out float ammoDamage, out string ammoTypeName);
208 proto native bool PushCartridgeToInternalMagazine(int muzzleIndex, float ammoDamage, string ammoTypeName);
209
216 proto native bool CanAttachMagazine(int muzzleIndex, Magazine mag);
217
226 proto native bool TestAttachMagazine(int muzzleIndex, Magazine mag, bool do_occupancy_test, bool do_script_check);
227
234 proto native bool AttachMagazine(int muzzleIndex, Magazine mag);
235
240 proto native Magazine GetMagazine(int muzzleIndex);
241
247 proto native float GetReloadTime(int muzzleIndex);
248
255 proto native bool CanChamberFromMag(int muzzleIndex, Magazine mag);
256
262 proto native owned string GetChamberedCartridgeMagazineTypeName(int muzzleIndex);
263
268 proto native owned string GetRandomMagazineTypeName(int muzzleIndex);
269
274 proto native owned string GetMaxMagazineTypeName(int muzzleIndex);
275
280 proto native int GetMagazineTypeCount(int muzzleIndex);
281
286 proto native bool EnterOptics();
291 proto native bool IsInOptics();
296 proto native bool ExitOptics();
297
302 proto native float GetZoom();
308 proto native bool SetZoom(float percent);
313 proto native bool ZoomIn();
318 proto native bool ZoomOut();
319
324 proto native int GetStepZoom();
330 proto native bool SetStepZoom(int step);
335 proto native bool StepZoomIn();
340 proto native bool StepZoomOut();
341
346 proto native int GetStepZeroing(int muzzleIndex = 0);
352 proto native bool SetStepZeroing(int muzzleIndex, int step);
358 proto native bool StepZeroingUp(int muzzleIndex = 0);
364 proto native bool StepZeroingDown(int muzzleIndex = 0);
369 proto native float GetCurrentZeroing(int muzzleIndex = 0);
374 proto native float GetZeroingClamp(int muzzleIndex = 0);
380 proto native bool FlashlightOn();
381
387 proto native bool FlashlightOff();
388
394 proto native bool IsFlashlightOn();
395
399 proto native UnderSlugLauncher GetAttachedLauncher();
408
413 proto native void GetCameraPoint(int muzzleIndex, out vector pos, out vector dir);
414
419 proto native float GetZoomInit(int muzzleIndex);
420
425 proto native float GetZoomMin(int muzzleIndex);
426
431 proto native float GetZoomMax(int muzzleIndex);
432
437 proto native float GetZeroingDistanceZoomMin(int muzzleIndex);
438
443 proto native float GetZeroingDistanceZoomMax(int muzzleIndex);
444
445 proto native void SelectionBulletShow();
446 proto native void SelectionBulletHide();
447 proto native void SelectionMagazineShow();
448 proto native void SelectionMagazineHide();
449
451 {
452 for (int i = 0; i < GetMuzzleCount(); i++)
453 {
454 StepZeroingUp(i);
455 }
456 }
457
459 {
460 for (int i = 0; i < GetMuzzleCount(); i++)
461 {
463 }
464 }
465};
466
467
proto native float GetZoomMin(int muzzleIndex)
proto native bool AttachMagazine(int muzzleIndex, Magazine mag)
proto bool GetInternalMagazineCartridgeInfo(int muzzleIndex, int cartridgeIndex, out float ammoDamage, out string ammoTypeName)
proto native bool StepZoomIn()
sets zoom to next defined (respective to current) value in zoom fov config array
proto native bool ZoomIn()
moves current zoom by 1% up
proto native bool CreateRound(int muzzleIndex)
proto native bool GetCurrentModeAutoFire(int muzzleIndex)
proto native void SetMuzzleMode(int muzzleIndex, int modeIndex)
proto native int GetCurrentMuzzle()
proto native ItemOptics GetAttachedOptics()
proto native int GetInternalMagazineMaxCartridgeCount(int muzzleIndex)
proto native int GetSlotFromMuzzleIndex(int muzzleIndex)
proto native bool EjectCasing(int muzzleIndex)
proto native bool IsChamberFiredOut(int muzzleIndex)
proto native void SelectionBulletHide()
proto native float GetZoom()
returns current percentage of zoom
proto native owned string GetChamberAmmoTypeName(int muzzleIndex)
proto native bool IsFlashlightOn()
query state of flashlight
proto native bool CanAttachMagazine(int muzzleIndex, Magazine mag)
proto native bool SetZoom(float percent)
proto native int GetTotalMaxCartridgeCount(int muzzleIndex)
proto native void SetNextMuzzleMode(int muzzleIndex)
proto native bool SetStepZoom(int step)
proto native float GetZeroingDistanceZoomMax(int muzzleIndex)
proto native void SetCurrentMuzzle(int muzzleIndex)
proto native bool TestAttachMagazine(int muzzleIndex, Magazine mag, bool do_occupancy_test, bool do_script_check)
proto native bool IsChamberFull(int muzzleIndex)
proto native bool Fire(int muzzleIndex, vector pos, vector dir, vector speed)
proto native void Synchronize()
Force synchronizes the weapon state from Server to Client.
proto native int GetCurrentMode(int muzzleIndex)
proto native bool ZoomOut()
moves current zoom by 1% down
proto native float GetCurrentZeroing(int muzzleIndex=0)
proto native bool PushCartridgeToChamber(int muzzleIndex, float ammoDamage, string ammoTypeName)
proto native void SelectionMagazineHide()
proto native bool CanFire(int muzzleIndex)
proto bool GetCartridgeInfo(int muzzleIndex, out float ammoDamage, out string ammoTypeName)
proto native bool EnterOptics()
switches to optics mode if possible
proto native void GetCameraPoint(int muzzleIndex, out vector pos, out vector dir)
proto native float GetZeroingClamp(int muzzleIndex=0)
proto native void SelectionMagazineShow()
proto native bool StepZoomOut()
sets zoom to previous (respective to current) defined value in zoom fov config array
proto native int GetStepZoom()
returns position of currently used value in zoom config array
proto native bool CanChamberFromMag(int muzzleIndex, Magazine mag)
proto native bool IsChamberEmpty(int muzzleIndex)
proto native owned string GetMaxMagazineTypeName(int muzzleIndex)
proto bool PopCartridgeFromInternalMagazine(int muzzleIndex, out float ammoDamage, out string ammoTypeName)
proto native void EffectBulletHide(int muzzleIndex)
proto native bool HasInternalMagazine(int muzzleIndex)
proto native void EffectBulletShow(int muzzleIndex, float dmg, string type)
proto native int GetMuzzleModeCount(int muzzleIndex)
proto native int GetCurrentModeBurstSize(int muzzleIndex)
proto native bool StepZeroingDown(int muzzleIndex=0)
proto native UnderSlugLauncher GetAttachedLauncher()
bool IsInternalMagazineFull(int muzzleIndex)
Definition weapon.c:122
proto native owned string GetRandomMagazineTypeName(int muzzleIndex)
proto native bool FlashlightOn()
attempt to turn on flashlight
proto native void SetGroundAnimFrameIndex(int groundAnimFrameIndex)
proto native int GetMagazineTypeCount(int muzzleIndex)
proto native bool PushCartridgeToInternalMagazine(int muzzleIndex, float ammoDamage, string ammoTypeName)
proto native int GetInternalMagazineCartridgeCount(int muzzleIndex)
proto native bool SetStepZeroing(int muzzleIndex, int step)
bool IsChamberFullEx(int muzzleIndex)
Definition weapon.c:97
void StepZeroingUpAllMuzzles()
Definition weapon.c:450
proto native bool IsInOptics()
is weapon in optics mode or not
proto native bool DryFire(int muzzleIndex)
void StepZeroingDownAllMuzzles()
Definition weapon.c:458
proto native Magazine GetMagazine(int muzzleIndex)
proto native float GetZoomInit(int muzzleIndex)
proto native void SetCurrentMode(int muzzleIndex, int mode)
proto bool PopCartridgeFromChamber(int muzzleIndex, out float ammoDamage, out string ammoTypeName)
proto native owned string GetChamberedCartridgeMagazineTypeName(int muzzleIndex)
proto native float GetZoomMax(int muzzleIndex)
proto native int GetTotalCartridgeCount(int muzzleIndex)
proto native void SelectionBulletShow()
proto native bool StepZeroingUp(int muzzleIndex=0)
proto native bool DryDryFire(int muzzleIndex)
proto native int GetStepZeroing(int muzzleIndex=0)
proto native bool ExitOptics()
switches out of optics mode (if possible)
proto native bool FlashlightOff()
attempt to turn off flashlight
proto native float GetZeroingDistanceZoomMin(int muzzleIndex)
proto native bool IsChamberJammed(int muzzleIndex)
proto native bool IsChamberEjectable(int muzzleIndex)
proto native owned string GetRandomChamberableAmmoTypeName(int muzzleIndex)
proto native owned string GetCurrentModeName(int muzzleIndex)
proto native float GetReloadTime(int muzzleIndex)
proto native int GetMuzzleCount()
override bool IsWeapon()
Definition weapon.c:6
proto native ItemSuppressor GetAttachedSuppressor()
script counterpart to engine's class Weapon
bool IsChamberFull(int idx)