DayZ 1.24
Loading...
Searching...
No Matches
Mask_Base Class Reference

gas mask base More...

Inheritance diagram for Mask_Base:
[legend]
Collaboration diagram for Mask_Base:
[legend]

Protected Member Functions

void InitGlobalExclusionValues ()
 
set< intGetAttachmentExclusionInitSlotValue (int slotId)
 
void InitGlobalExclusionValues ()
 
void InitGlobalExclusionValues ()
 
void InitGlobalExclusionValues ()
 
set< intGetAttachmentExclusionInitSlotValue (int slotId)
 

Private Member Functions

override void SetActions ()
 
override void SetActions ()
 
override void SetActions ()
 
override bool IsGasMask ()
 
override array< intGetEffectWidgetTypes ()
 
override bool AllowFoodConsumption ()
 
override void OnDebugSpawn ()
 
EntityAI GetExternalFilter ()
 
bool HasValidFilter ()
 has either external or integrated non-empty non-ruined filter ?
 
float GetFilterQuantityMax ()
 
float GetFilterQuantity ()
 
float GetFilterQuantity01 ()
 
bool IsExternalFilterAttached ()
 
bool HasIntegratedFilter ()
 
bool CanHaveExternalFilter ()
 
bool ConsumeQuantity (float quantity, PlayerBase consumer_player)
 
void OnQuantityConsumed (notnull ItemBase filter, PlayerBase consumer_player)
 
void OnQuantityConsumed (notnull ItemBase filter, PlayerBase consumer_player, float quantity)
 
void MouthRag ()
 
override bool CanDetachAttachment (EntityAI parent)
 
override bool IsObstructingVoice ()
 
override int GetVoiceEffect ()
 
override void EEItemLocationChanged (notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
override void OnWasAttached (EntityAI parent, int slot_id)
 
void SetIncomingLambaBool (bool state)
 
bool GetIncomingLambdaBool ()
 
override void SetActions ()
 
override void SetActions ()
 
- Private Member Functions inherited from Clothing
void InitGlobalExclusionValues ()
 
void CheckParent ()
 
override void OnWorkStart ()
 
override void OnWorkStop ()
 
override void OnWork (float consumed_energy)
 
void OnLightCreated ()
 
void CreateHeadtorchLight ()
 
void AttachLightOnHead (EntityAI person)
 
override void OnWasAttached (EntityAI parent, int slot_id)
 
override void OnWasDetached (EntityAI parent, int slot_id)
 
override void SetActions ()
 
override bool IsLightSource ()
 
override ItemBase GetLightSourceItem ()
 
override void OnInvisibleSet (bool invisible)
 

Private Attributes

float m_LowFilterEventTime
 
bool m_IncomingLambdaChange
 

Detailed Description

gas mask base

Definition at line 1 of file Balaclava3Holes_ColorBase.c.

Member Function Documentation

◆ AllowFoodConsumption()

override bool Mask_Base::AllowFoodConsumption ( )
inlineprivate

Definition at line 16 of file MaskBase.c.

17 {
18 return false;
19 }

◆ CanDetachAttachment()

override bool Mask_Base::CanDetachAttachment ( EntityAI parent)
inlineprivate

Definition at line 10 of file MouthRag.c.

11 {
13 }
bool m_IncomingLambdaChange
Definition MouthRag.c:3

References m_IncomingLambdaChange.

◆ CanHaveExternalFilter()

bool Mask_Base::CanHaveExternalFilter ( )
inlineprivate

Definition at line 96 of file MaskBase.c.

97 {
98 return !HasIntegratedFilter();
99 }
bool HasIntegratedFilter()
Definition MaskBase.c:91

◆ ConsumeQuantity()

bool Mask_Base::ConsumeQuantity ( float quantity,
PlayerBase consumer_player )
inlineprivate

Definition at line 101 of file MaskBase.c.

102 {
103 ItemBase filter = ItemBase.Cast(FindAttachmentBySlotName("GasMaskFilter"));
105
106 if (HasQuantity() && GetQuantity() > 0)
107 {
108 itemToConsume = this;//this mask itself has quantity(masks with integrated, non-attached filter)
109 }
110 else if (HasValidFilter())
112 if (itemToConsume)
113 {
114 itemToConsume.AddQuantity(-quantity);
116 return true;
117 }
118
119 return false;
120 }
override float GetQuantity()
Definition ItemBase.c:7995
bool HasQuantity()
Definition ItemBase.c:7990
bool HasValidFilter()
has either external or integrated non-empty non-ruined filter ?
Definition MaskBase.c:32
void OnQuantityConsumed(notnull ItemBase filter, PlayerBase consumer_player)
Definition MaskBase.c:122

References GetQuantity(), and HasQuantity().

◆ EEItemLocationChanged()

override void Mask_Base::EEItemLocationChanged ( notnull InventoryLocation oldLoc,
notnull InventoryLocation newLoc )
inlineprivate

Definition at line 25 of file MouthRag.c.

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 }
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
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), ECE_PLACE_ON_SURFACE, GetGame(), and RF_DEFAULT.

◆ GetAttachmentExclusionInitSlotValue() [1/2]

set< int > Mask_Base::GetAttachmentExclusionInitSlotValue ( int slotId)
inlineprotected

Definition at line 14 of file CrookedNose.c.

15 {
16 set<int> ret = super.GetAttachmentExclusionInitSlotValue(slotId);
17
18 //allows shaving
19 ret.RemoveItem(EAttExclusions.SHAVING_MASK_ATT_0);
20 return ret;
21 }

◆ GetAttachmentExclusionInitSlotValue() [2/2]

set< int > Mask_Base::GetAttachmentExclusionInitSlotValue ( int slotId)
inlineprotected

Definition at line 171 of file Clothing_Base.c.

172 {
173 set<int> ret = super.GetAttachmentExclusionInitSlotValue(slotId);
174 if (slotId == InventorySlots.MASK)
175 ret.Insert(EAttExclusions.SHAVING_MASK_ATT_0);
176 return ret;
177 }
provides access to slot configuration

◆ GetEffectWidgetTypes()

override array< int > Mask_Base::GetEffectWidgetTypes ( )
inlineprivate

Definition at line 11 of file MaskBase.c.

12 {
13 return {EffectWidgetsTypes.MASK_OCCLUDER, EffectWidgetsTypes.MASK_BREATH};
14 }

◆ GetExternalFilter()

EntityAI Mask_Base::GetExternalFilter ( )
inlineprivate

Definition at line 26 of file MaskBase.c.

27 {
28 return FindAttachmentBySlotName("GasMaskFilter");
29 }

◆ GetFilterQuantity()

float Mask_Base::GetFilterQuantity ( )
inlineprivate

Definition at line 55 of file MaskBase.c.

56 {
58 if (filter)
59 return filter.GetQuantity();
60 else
61 return GetQuantity();
62 }
EntityAI GetExternalFilter()
Definition MaskBase.c:26

References GetQuantity().

◆ GetFilterQuantity01()

float Mask_Base::GetFilterQuantity01 ( )
inlineprivate

Definition at line 64 of file MaskBase.c.

65 {
66 if (!HasValidFilter())
67 return 0;
68
70 float quantity, quantityMax;
71
72 if (filter)
73 {
74 quantity = filter.GetQuantity();
75 quantityMax = filter.GetQuantityMax();
76 }
77 else
78 {
81 }
82
84 }
float quantityMax
override int GetQuantityMax()
Definition ItemBase.c:7941
Definition EnMath.c:7
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

References GetQuantity(), GetQuantityMax(), Math::InverseLerp(), and quantityMax.

◆ GetFilterQuantityMax()

float Mask_Base::GetFilterQuantityMax ( )
inlineprivate

Definition at line 43 of file MaskBase.c.

44 {
46 if (filter) //mask can have a filter, and filter is attached
47 return filter.GetQuantityMax();
48 else if (HasQuantity())//filter was not attached, checking if mask has internal filter
49 return GetQuantityMax();
50
51 //mask does not have a filter attached nor does it have internal filter, max quantity can't be obtained
52 return 0;
53 }

References GetQuantityMax(), and HasQuantity().

◆ GetIncomingLambdaBool()

bool Mask_Base::GetIncomingLambdaBool ( )
inlineprivate

Definition at line 66 of file MouthRag.c.

67 {
69 }

References m_IncomingLambdaChange.

◆ GetVoiceEffect()

override int Mask_Base::GetVoiceEffect ( )
inlineprivate

Definition at line 20 of file MouthRag.c.

21 {
23 }

◆ HasIntegratedFilter()

bool Mask_Base::HasIntegratedFilter ( )
inlineprivate

Definition at line 91 of file MaskBase.c.

92 {
93 return HasQuantity();
94 }

References HasQuantity().

◆ HasValidFilter()

bool Mask_Base::HasValidFilter ( )
inlineprivate

has either external or integrated non-empty non-ruined filter ?

Definition at line 32 of file MaskBase.c.

33 {
35 if (filter && !filter.IsRuined() && filter.GetQuantity() > 0)
36 return true;
37 else if (GetQuantity() > 0 && !IsRuined())
38 return true;
39
40 return false;
41 }

References GetQuantity().

◆ InitGlobalExclusionValues() [1/4]

void Mask_Base::InitGlobalExclusionValues ( )
inlineprotected

Definition at line 3 of file CrookedNose.c.

4 {
5 super.InitGlobalExclusionValues();
6
7 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_MASK_0);
8 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_MASK_1);
9 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_MASK_2);
10
11 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_HEADGEAR_HELMET_0);
12 }

◆ InitGlobalExclusionValues() [2/4]

void Mask_Base::InitGlobalExclusionValues ( )
inlineprotected

Definition at line 3 of file HockeyMask.c.

4 {
5 super.InitGlobalExclusionValues();
6
7 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_MASK_0);
8
9 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_GLASSES_TIGHT_0);
10 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_GLASSES_REGULAR_0);
11 }

◆ InitGlobalExclusionValues() [3/4]

void Mask_Base::InitGlobalExclusionValues ( )
inlineprotected

Definition at line 130 of file MaskBase.c.

131 {
132 super.InitGlobalExclusionValues();
133
134 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_MASK_2);
135
136 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_GLASSES_TIGHT_0);
137 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_HEADGEAR_HELMET_0);
138 }

◆ InitGlobalExclusionValues() [4/4]

void Mask_Base::InitGlobalExclusionValues ( )
inlineprotected

Definition at line 9 of file SantasBeard.c.

10 {
11 super.InitGlobalExclusionValues();
12
13 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_MASK_0);
14 }

◆ IsExternalFilterAttached()

bool Mask_Base::IsExternalFilterAttached ( )
inlineprivate

Definition at line 86 of file MaskBase.c.

87 {
88 return ItemBase.Cast(FindAttachmentBySlotName("GasMaskFilter")) != null;
89 }

◆ IsGasMask()

override bool Mask_Base::IsGasMask ( )
inlineprivate

Definition at line 6 of file MaskBase.c.

7 {
8 return true;
9 }

◆ IsObstructingVoice()

override bool Mask_Base::IsObstructingVoice ( )
inlineprivate

Definition at line 15 of file MouthRag.c.

16 {
17 return true;
18 }

◆ MouthRag()

void Mask_Base::MouthRag ( )
inlineprivate

Definition at line 5 of file MouthRag.c.

6 {
8 }

◆ OnDebugSpawn()

override void Mask_Base::OnDebugSpawn ( )
inlineprivate

Definition at line 21 of file MaskBase.c.

22 {
23 GetInventory().CreateInInventory("GasMask_Filter");
24 }

◆ OnQuantityConsumed() [1/2]

void Mask_Base::OnQuantityConsumed ( notnull ItemBase filter,
PlayerBase consumer_player )
inlineprivate

Definition at line 122 of file MaskBase.c.

122{};

◆ OnQuantityConsumed() [2/2]

void Mask_Base::OnQuantityConsumed ( notnull ItemBase filter,
PlayerBase consumer_player,
float quantity )
inlineprivate

Definition at line 124 of file MaskBase.c.

125 {
126 float damage = quantity * filter.GetFilterDamageRatio();
127 filter.AddHealth("", "", -damage);
128 }

◆ OnWasAttached()

override void Mask_Base::OnWasAttached ( EntityAI parent,
int slot_id )
inlineprivate

Definition at line 51 of file MouthRag.c.

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 }

◆ SetActions() [1/5]

override void Mask_Base::SetActions ( )
inlineprivate

Definition at line 3 of file Balaclava3Holes_ColorBase.c.

4 {
5 super.SetActions();
7 }
void AddAction(typename actionName)

References AddAction().

◆ SetActions() [2/5]

override void Mask_Base::SetActions ( )
inlineprivate

Definition at line 3 of file BalaclavaMask_ColorBase.c.

4 {
5 super.SetActions();
7 }

References AddAction().

◆ SetActions() [3/5]

override void Mask_Base::SetActions ( )
inlineprivate

Definition at line 3 of file FaceCover_improvised.c.

4 {
5 super.SetActions();
7 }

References AddAction().

◆ SetActions() [4/5]

override void Mask_Base::SetActions ( )
inlineprivate

Definition at line 3 of file SantasBeard.c.

4 {
5 super.SetActions();
7 }

References AddAction().

◆ SetActions() [5/5]

override void Mask_Base::SetActions ( )
inlineprivate

Definition at line 3 of file SurgicalMask.c.

4 {
5 super.SetActions();
7 }

References AddAction().

◆ SetIncomingLambaBool()

void Mask_Base::SetIncomingLambaBool ( bool state)
inlineprivate

Definition at line 61 of file MouthRag.c.

62 {
64 }

Member Data Documentation

◆ m_IncomingLambdaChange

bool Mask_Base::m_IncomingLambdaChange
private

Definition at line 3 of file MouthRag.c.

Referenced by CanDetachAttachment(), and GetIncomingLambdaBool().

◆ m_LowFilterEventTime

float Mask_Base::m_LowFilterEventTime
private

Definition at line 4 of file MaskBase.c.


The documentation for this class was generated from the following files: