Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
mosin_bayonet.c
Go to the documentation of this file.
1
class
Mosin_Bayonet
extends
Inventory_Base
2
{
3
override
bool
IsMeleeFinisher
()
4
{
5
return
true
;
6
}
7
8
override
array<int>
GetValidFinishers
()
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
(
"weaponMuzzleMosin"
)))
19
return
false
;
20
21
if
( parent.FindAttachmentBySlotName(
"suppressorImpro"
) == null && parent.FindAttachmentBySlotName(
"weaponMuzzleMosin"
) == 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
52
AddAction
(
ActionUnrestrainTarget
);
53
AddAction
(
ActionDigWorms
);
54
}
55
}
AddAction
void AddAction(typename actionName)
Definition
advancedcommunication.c:220
ActionDigWorms
Definition
actiondigworms.c:18
ActionUnrestrainTarget
Definition
actionunrestraintarget.c:56
EntityAI
Definition
inventoryitem.c:2
Inventory_Base
Definition
barbedbaseballbat.c:2
Inventory_Base::OnWasDetached
override void OnWasDetached(EntityAI parent, int slot_id)
Definition
mosin_bayonet.c:38
Inventory_Base::GetValidFinishers
override array< int > GetValidFinishers()
Definition
mosin_bayonet.c:8
Inventory_Base::IsMeleeFinisher
override bool IsMeleeFinisher()
Definition
mosin_bayonet.c:3
Inventory_Base::CanPutAsAttachment
override bool CanPutAsAttachment(EntityAI parent)
Definition
mosin_bayonet.c:13
Inventory_Base::OnWasAttached
override void OnWasAttached(EntityAI parent, int slot_id)
Definition
mosin_bayonet.c:28
Inventory_Base::SetActions
override void SetActions()
Definition
mosin_bayonet.c:48
InventorySlots
provides access to slot configuration
Definition
inventoryslots.c:6
InventorySlots::GetSlotIdFromString
static proto native int GetSlotIdFromString(string slot_name)
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
EMeleeHitType
EMeleeHitType
Definition
dayzplayerimplementmeleecombat.c:2
Games
Dayz
scripts
4_world
entities
itembase
inventory_base
mosin_bayonet.c
Generated by
1.17.0