Dayz Explorer 1.28.160049
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();
403 proto native ItemOptics GetAttachedOptics();
407 proto native ItemSuppressor GetAttachedSuppressor();
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
450 void StepZeroingUpAllMuzzles()
451 {
452 for (int i = 0; i < GetMuzzleCount(); i++)
453 {
454 StepZeroingUp(i);
455 }
456 }
457
458 void StepZeroingDownAllMuzzles()
459 {
460 for (int i = 0; i < GetMuzzleCount(); i++)
461 {
462 StepZeroingDown(i);
463 }
464 }
465};
466
467
script counterpart to engine's class Weapon
bool CanFire()
void Synchronize()
enum ChatChannelType Fire
< VoiceEffectObstruction
bool IsChamberFiredOut(int idx)
bool IsChamberFull(int idx)