DayZ 1.24
Loading...
Searching...
No Matches
MouthRag.c
Go to the documentation of this file.
1class MouthRag extends Mask_Base
2{
4
5 void MouthRag()
6 {
7 m_IncomingLambdaChange = false;
8 }
9
10 override bool CanDetachAttachment(EntityAI parent)
11 {
13 }
14
15 override bool IsObstructingVoice()
16 {
17 return true;
18 }
19
20 override int GetVoiceEffect()
21 {
23 }
24
26 {
27 super.EEItemLocationChanged(oldLoc, newLoc);
28
29 if (GetGame().IsDedicatedServer())
30 {
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 {
41 if (Class.CastTo(newItem, GetGame().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
62 {
63 m_IncomingLambdaChange = state;
64 }
65
67 {
69 }
70};
const int ECE_PLACE_ON_SURFACE
const int RF_DEFAULT
InventoryLocationType
types of Inventory Location
Super root of all classes in Enforce script.
Definition EnScript.c:11
InventoryLocation.
override int GetVoiceEffect()
Definition MouthRag.c:20
override void OnWasAttached(EntityAI parent, int slot_id)
Definition MouthRag.c:51
bool m_IncomingLambdaChange
Definition MouthRag.c:3
void MouthRag()
Definition MouthRag.c:5
void SetIncomingLambaBool(bool state)
Definition MouthRag.c:61
bool GetIncomingLambdaBool()
Definition MouthRag.c:66
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Definition MouthRag.c:25
override bool CanDetachAttachment(EntityAI parent)
Definition MouthRag.c:10
override bool IsObstructingVoice()
Definition MouthRag.c:15
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.