Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
ak_bayonet.c
Go to the documentation of this file.
1class AK_Bayonet extends ToolBase
2{
3 override bool IsMeleeFinisher()
4 {
5 return true;
6 }
7
9 {
10 return {EMeleeHitType.FINISHER_LIVERSTAB,EMeleeHitType.FINISHER_NECKSTAB};
11 }
12
13 override bool CanPutAsAttachment( EntityAI parent )
14 {
15 if (!super.CanPutAsAttachment(parent))
16 return false;
17
18 if (parent.IsSlotReserved(InventorySlots.GetSlotIdFromString("suppressorImpro")) || parent.IsSlotReserved(InventorySlots.GetSlotIdFromString("weaponMuzzleAK")))
19 return false;
20
21 if ( parent.FindAttachmentBySlotName("suppressorImpro") == null && parent.FindAttachmentBySlotName("weaponMuzzleAK") == null )
22 {
23 return true;
24 }
25 return false;
26 }
27
28 override void OnWasAttached(EntityAI parent, int slot_id)
29 {
30 super.OnWasAttached(parent, slot_id);
31
32 if( parent.IsWeapon() )
33 {
34 parent.SetBayonetAttached(true,slot_id);
35 }
36 }
37
38 override void OnWasDetached(EntityAI parent, int slot_id)
39 {
40 super.OnWasDetached(parent, slot_id);
41
42 if( parent.IsWeapon() )
43 {
44 parent.SetBayonetAttached(false);
45 }
46 }
47
48 override void SetActions()
49 {
50 super.SetActions();
51
62 }
63}
ActionDisarmExplosiveCB ActionContinuousBaseCB ActionDisarmExplosive()
ActionDisarmMineCB ActionContinuousBaseCB ActionDisarmMine()
ActionSkinningCB ActionContinuousBaseCB ActionSkinning()
void AddAction(typename actionName)
void SetActions()
provides access to slot configuration
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
array< int > GetValidFinishers()
returns an array of possible finishers
Definition itembase.c:9590
override bool CanPutAsAttachment(EntityAI parent)
Definition itembase.c:8966
override void OnWasDetached(EntityAI parent, int slot_id)