Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
mouthrag.c
Go to the documentation of this file.
1
class
MouthRag
extends
Mask_Base
2
{
3
bool
m_IncomingLambdaChange
;
4
5
void
MouthRag
()
6
{
7
m_IncomingLambdaChange
=
false
;
8
}
9
10
override
bool
CanDetachAttachment
(
EntityAI
parent)
11
{
12
return
m_IncomingLambdaChange
;
13
}
14
15
override
bool
IsObstructingVoice
()
16
{
17
return
true
;
18
}
19
20
override
int
GetVoiceEffect
()
21
{
22
return
VoiceEffectObstruction;
23
}
24
25
override
void
EEItemLocationChanged
(notnull
InventoryLocation
oldLoc, notnull
InventoryLocation
newLoc)
26
{
27
super.EEItemLocationChanged(oldLoc,newLoc);
28
29
if
(
g_Game
.IsDedicatedServer())
30
{
31
PlayerBase
playerOld;
32
PlayerBase
playerNew;
33
if
(oldLoc.GetParent())
34
Class
.
CastTo
(playerOld,oldLoc.GetParent().GetHierarchyRootPlayer());
35
if
(newLoc.GetParent())
36
Class
.
CastTo
(playerNew,newLoc.GetParent().GetHierarchyRootPlayer());
37
38
if
(newLoc.GetType() ==
InventoryLocationType
.GROUND)
39
{
40
ItemBase
newItem;
41
if
(
Class
.
CastTo
(newItem,
g_Game
.CreateObjectEx(
"Rag"
,newLoc.GetPos(),
ECE_PLACE_ON_SURFACE
,
RF_DEFAULT
)))
42
{
43
MiscGameplayFunctions.TransferItemProperties(
this
,newItem);
44
newItem.
SetQuantity
(1);
45
DeleteSafe();
46
}
47
}
48
}
49
}
50
51
override
void
OnWasAttached
(
EntityAI
parent,
int
slot_id)
52
{
53
super.OnWasAttached(parent, slot_id);
54
55
if
(parent.IsPlayer())
56
{
57
PlayerBase
.Cast(parent).CheckForGag();
//gag removal action does check, since 'OnWasDetached' is not called on item destruction.
58
}
59
}
60
61
void
SetIncomingLambaBool
(
bool
state)
62
{
63
m_IncomingLambdaChange
= state;
64
}
65
66
bool
GetIncomingLambdaBool
()
67
{
68
return
m_IncomingLambdaChange
;
69
}
70
};
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition
centraleconomy.c:37
RF_DEFAULT
const int RF_DEFAULT
Definition
centraleconomy.c:65
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
EntityAI
Definition
inventoryitem.c:2
InventoryLocation
InventoryLocation.
Definition
inventorylocation.c:30
ItemBase
Definition
inventoryitem.c:742
ItemBase::SetQuantity
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Definition
pileofwoodenplanks.c:88
Mask_Base
gas mask base
Definition
balaclava3holes_colorbase.c:2
Mask_Base::GetIncomingLambdaBool
bool GetIncomingLambdaBool()
Definition
mouthrag.c:66
Mask_Base::IsObstructingVoice
override bool IsObstructingVoice()
Definition
mouthrag.c:15
Mask_Base::GetVoiceEffect
override int GetVoiceEffect()
Definition
mouthrag.c:20
Mask_Base::SetIncomingLambaBool
void SetIncomingLambaBool(bool state)
Definition
mouthrag.c:61
Mask_Base::EEItemLocationChanged
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Definition
mouthrag.c:25
Mask_Base::OnWasAttached
override void OnWasAttached(EntityAI parent, int slot_id)
Definition
mouthrag.c:51
Mask_Base::m_IncomingLambdaChange
bool m_IncomingLambdaChange
Definition
mouthrag.c:3
Mask_Base::CanDetachAttachment
override bool CanDetachAttachment(EntityAI parent)
Definition
mouthrag.c:10
Mask_Base::MouthRag
void MouthRag()
Definition
mouthrag.c:5
PlayerBase
Definition
playerbaseclient.c:2
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
Class::CastTo
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
InventoryLocationType
InventoryLocationType
types of Inventory Location
Definition
inventorylocation.c:4
Games
Dayz
scripts
4_world
entities
itembase
clothing
mouthrag.c
Generated by
1.17.0