Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
aug.c
Go to the documentation of this file.
1 class Aug_Base : RifleBoltFree_Base
2 {
3  override RecoilBase SpawnRecoilObject()
4  {
5  return new AUGRecoil(this);
6  }
7 
8  //Debug menu Spawn Ground Special
9  override void OnDebugSpawn()
10  {
11  EntityAI entity;
12  if ( Class.CastTo(entity, this) )
13  {
14  entity.SpawnEntityOnGroundPos("Mag_Aug_30Rnd", entity.GetPosition());
15  }
16  }
17 
18  override int GetWeaponSpecificCommand(int weaponAction ,int subCommand)
19  {
20  if ( weaponAction == WeaponActions.RELOAD)
21  {
22  switch (subCommand)
23  {
24  case WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_BULLET:
25  return WeaponActionReloadTypes.RELOADSRIFLE_MAGAZINE_BULLET;
26 
27  case WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_BULLET:
28  return WeaponActionReloadTypes.RELOADSRIFLE_NOMAGAZINE_BULLET;
29 
30  case WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_NOBULLET:
31  return WeaponActionReloadTypes.RELOADSRIFLE_MAGAZINE_NOBULLET;
32 
33  case WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_NOBULLET:
34  return WeaponActionReloadTypes.RELOADSRIFLE_NOMAGAZINE_NOBULLET;
35 
36  default:
37  return subCommand;
38  }
39 
40  }
41  return subCommand;
42  }
43 };
44 
45 class Aug extends Aug_Base
46 {
47  //Debug menu Spawn Ground Special
48  override void OnDebugSpawn()
49  {
50  GameInventory inventory = GetInventory();
51 
52  inventory.CreateInInventory( "UniversalLight" );
53  inventory.CreateInInventory( "Battery9V" );
54  inventory.CreateInInventory( "ACOGOptic" );
55  inventory.CreateInInventory( "M4_Suppressor" );
56 
57  SpawnAttachedMagazine("Mag_Aug_30Rnd");
58  }
59 }
60 
61 class AugShort extends Aug_Base
62 {
63  override bool CanEnterIronsights()
64  {
65  return true;
66  }
67 
68  override void AssembleGun()
69  {
70  super.AssembleGun();
71 
72  if ( !FindAttachmentBySlotName("weaponOpticsAug") )
73  {
74  GetInventory().CreateAttachment("AugOptic");
75  }
76  }
77 
78  //Debug menu Spawn Ground Special
79  override void OnDebugSpawn()
80  {
81  SpawnAttachedMagazine("Mag_Aug_30Rnd");
82  }
83 }
84 
85 
87 {
88  override bool CanPutAsAttachment( EntityAI parent )
89  {
90  return true;
91  }
92 };
CanEnterIronsights
AugOptic CanEnterIronsights
Definition: aug.c:63
AssembleGun
override void AssembleGun()
Definition: aug.c:68
WeaponActionReloadTypes
WeaponActionReloadTypes
Definition: human.c:824
AUGRecoil
Definition: augrecoil.c:1
WeaponActions
WeaponActions
actions
Definition: human.c:808
RecoilBase
Definition: recoilbase.c:1
Aug_Base
Definition: aug.c:1
AugOptic
Definition: aug.c:86
ItemOptics
Definition: itemoptics.c:1
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
OnDebugSpawn
override void OnDebugSpawn()
Definition: aug.c:3
EntityAI
Definition: building.c:5
GameInventory
script counterpart to engine's class Inventory
Definition: inventory.c:78