DayZ 1.24
Loading...
Searching...
No Matches
PumpkinHelmet Class Reference
Inheritance diagram for PumpkinHelmet:
[legend]
Collaboration diagram for PumpkinHelmet:
[legend]

Protected Member Functions

set< intGetAttachmentExclusionInitSlotValue (int slotId)
 

Private Member Functions

void PumpkinHelmet ()
 
override void OnMovedInsideCargo (EntityAI container)
 
override void OnMovedWithinCargo (EntityAI container)
 
override void OnRemovedFromCargo (EntityAI container)
 
override void EOnInit (IEntity other, int extra)
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
 
void UpdateGlowState ()
 
override void UpdateNVGStatus (PlayerBase player, bool attaching=false, bool force_disable=false)
 
- Private Member Functions inherited from HelmetBase
set< intGetAttachmentExclusionInitSlotValue (int slotId)
 
set< intGetAttachmentExclusionInitSlotValue (int slotId)
 
void InitGlobalExclusionValues ()
 
set< intGetAttachmentExclusionInitSlotValue (int slotId)
 
set< intGetAttachmentExclusionInitSlotValue (int slotId)
 
set< intGetAttachmentExclusionInitSlotValue (int slotId)
 

Detailed Description

Definition at line 3 of file PumpkinHelmet.c.

Constructor & Destructor Documentation

◆ PumpkinHelmet()

void PumpkinHelmet::PumpkinHelmet ( )
inlineprivate

Definition at line 5 of file PumpkinHelmet.c.

6 {
7 SetEventMask(EntityEvent.INIT); // Enable EOnInit event
8 }
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition EnEntity.c:44

Member Function Documentation

◆ EEHealthLevelChanged()

override void PumpkinHelmet::EEHealthLevelChanged ( int oldLevel,
int newLevel,
string zone )
inlineprivate

Definition at line 37 of file PumpkinHelmet.c.

38 {
39 super.EEHealthLevelChanged(oldLevel, newLevel, zone);
40
42 }
void UpdateGlowState()

References UpdateGlowState().

◆ EOnInit()

override void PumpkinHelmet::EOnInit ( IEntity other,
int extra )
inlineprivate

Definition at line 25 of file PumpkinHelmet.c.

26 {
28 }

References UpdateGlowState().

◆ GetAttachmentExclusionInitSlotValue()

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

Definition at line 87 of file PumpkinHelmet.c.

88 {
89 set<int> ret = super.GetAttachmentExclusionInitSlotValue(slotId);
90 if (slotId == InventorySlots.HEADGEAR)
91 {
92 ret.Insert(EAttExclusions.EXCLUSION_HEADGEAR_HELMET_0);
93
94 ret.Insert(EAttExclusions.EXCLUSION_MASK_1);
95 ret.Insert(EAttExclusions.EXCLUSION_MASK_2);
96 ret.Insert(EAttExclusions.EXCLUSION_HEADSTRAP_0);
97
98 ret.Insert(EAttExclusions.SHAVING_HEADGEAR_ATT_0);
99 }
100 return ret;
101 }
provides access to slot configuration

◆ OnItemLocationChanged()

override void PumpkinHelmet::OnItemLocationChanged ( EntityAI old_owner,
EntityAI new_owner )
inlineprivate

Definition at line 30 of file PumpkinHelmet.c.

31 {
32 super.OnItemLocationChanged(old_owner, new_owner);
33
35 }

References UpdateGlowState().

◆ OnMovedInsideCargo()

override void PumpkinHelmet::OnMovedInsideCargo ( EntityAI container)
inlineprivate

Definition at line 10 of file PumpkinHelmet.c.

11 {
13 }

References UpdateGlowState().

◆ OnMovedWithinCargo()

override void PumpkinHelmet::OnMovedWithinCargo ( EntityAI container)
inlineprivate

Definition at line 15 of file PumpkinHelmet.c.

16 {
18 }

References UpdateGlowState().

◆ OnRemovedFromCargo()

override void PumpkinHelmet::OnRemovedFromCargo ( EntityAI container)
inlineprivate

Definition at line 20 of file PumpkinHelmet.c.

21 {
23 }

References UpdateGlowState().

◆ UpdateGlowState()

void PumpkinHelmet::UpdateGlowState ( )
inlineprivate

Definition at line 44 of file PumpkinHelmet.c.

45 {
46 // Makes sure PumpkinHelmet doesn't glow when it's attached on head, or it's inside cargo.
47
48 bool do_glow = true;
49
51 do_glow = false;
52 else
53 {
54 int id = InventorySlots.HEADGEAR;
56 GetInventory().GetCurrentInventoryLocation(IL);
57
58 int id_2 = IL.GetSlot();
59 int id_cargo = IL.GetIdx();
60
61 if (id == id_2) // Pumpkin is attached on head
62 do_glow = false;
63
64 if (id_cargo != -1) // Pumpkin is in cargo
65 do_glow = false;
66 }
67
68 SetPilotLight(do_glow);
69 }
bool IsDamageDestroyed(ActionTarget target)
Definition ActionBase.c:841
InventoryLocation.

References IsDamageDestroyed().

Referenced by EEHealthLevelChanged(), EOnInit(), OnItemLocationChanged(), OnMovedInsideCargo(), OnMovedWithinCargo(), and OnRemovedFromCargo().

◆ UpdateNVGStatus()

override void PumpkinHelmet::UpdateNVGStatus ( PlayerBase player,
bool attaching = false,
bool force_disable = false )
inlineprivate

Definition at line 71 of file PumpkinHelmet.c.

72 {
73 if (!GetGame().IsDedicatedServer()) //SP only
74 {
75 if (force_disable)
76 player.RemoveActiveNV(NVTypes.NV_PUMPKIN);
77 else
78 {
79 if (attaching && (!player.IsNVGWorking() || player.GetNVType() != NVTypes.NV_PUMPKIN))
80 player.AddActiveNV(NVTypes.NV_PUMPKIN);
81 else if (!attaching && player.IsNVGWorking())
82 player.RemoveActiveNV(NVTypes.NV_PUMPKIN);
83 }
84 }
85 }
proto native CGame GetGame()

References GetGame().


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