DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PumpkinHelmet.c
См. документацию.
1// Have a spooky Halloween everyone!
2
4{
6 {
7 SetEventMask(EntityEvent.INIT); // Enable EOnInit event
8 }
9
14
15 override void OnMovedInsideCargo(EntityAI container)
16 {
18 }
19
20 override void OnMovedWithinCargo(EntityAI container)
21 {
23 }
24
25 override void OnRemovedFromCargo(EntityAI container)
26 {
28 }
29
30 override void EOnInit( IEntity other, int extra)
31 {
33 }
34
35 override void OnItemLocationChanged( EntityAI old_owner, EntityAI new_owner)
36 {
37 super.OnItemLocationChanged( old_owner, new_owner);
38
40 }
41
42 override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
43 {
44 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
45
47 }
48
50 {
51 // Makes sure PumpkinHelmet doesn't glow when it's attached on head, or it's inside cargo.
52
53 bool do_glow = true;
54
55 if ( IsDamageDestroyed() )
56 {
57 do_glow = false;
58 }
59 else
60 {
61 int id = InventorySlots.HEADGEAR;
63 GetInventory().GetCurrentInventoryLocation( IL );
64
65 int id_2 = IL.GetSlot();
66 int id_cargo = IL.GetIdx();
67
68 if ( id == id_2) // Pumpkin is attached on head
69 do_glow = false;
70
71 if ( id_cargo != -1 ) // Pumpkin is in cargo
72 do_glow = false;
73 }
74
75 SetPilotLight(do_glow);
76 }
77
78 override void UpdateNVGStatus(PlayerBase player, bool attaching = false, bool force_disable = false)
79 {
80 if ( !g_Game.IsDedicatedServer() ) //SP only
81 {
82 if (force_disable)
83 {
84 player.RemoveActiveNV(NVTypes.NV_PUMPKIN);
85 }
86 else
87 {
88 if ( attaching && (!player.IsNVGWorking() || player.GetNVType() != NVTypes.NV_PUMPKIN) )
89 {
90 player.AddActiveNV(NVTypes.NV_PUMPKIN);
91 }
92 else if ( !attaching && player.IsNVGWorking() )
93 {
94 player.RemoveActiveNV(NVTypes.NV_PUMPKIN);
95 }
96 }
97 }
98 }
99
100 override protected set<int> GetAttachmentExclusionInitSlotValue(int slotId)
101 {
102 set<int> ret = super.GetAttachmentExclusionInitSlotValue(slotId);
103 if (slotId == InventorySlots.HEADGEAR)
104 {
105 ret.Insert(EAttExclusions.EXCLUSION_HEADGEAR_HELMET_0);
106
107 ret.Insert(EAttExclusions.EXCLUSION_MASK_1);
108 ret.Insert(EAttExclusions.EXCLUSION_MASK_2);
109 ret.Insert(EAttExclusions.EXCLUSION_HEADSTRAP_0);
110
111 ret.Insert(EAttExclusions.SHAVING_HEADGEAR_ATT_0);
112 }
113 return ret;
114 }
115};
116
117// boo!
bool IsDamageDestroyed(ActionTarget target)
Определения ActionBase.c:1275
DayZGame g_Game
Определения DayZGame.c:4074
NVTypes
Определения DayZPlayerCamera_Base.c:55
ECachedEquipmentItemCategory
Определения ECachedEquipmentItemCategory.c:2
Определения GreatHelm.c:2
Определения EnEntity.c:165
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
InventoryLocation.
Определения InventoryLocation.c:30
provides access to slot configuration
Определения InventorySlots.c:6
Определения PlayerBaseClient.c:2
override void OnRemovedFromCargo(EntityAI container)
Определения PumpkinHelmet.c:25
override ECachedEquipmentItemCategory GetCachedEquipmentCategory()
Определения PumpkinHelmet.c:10
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Определения PumpkinHelmet.c:35
override void OnMovedWithinCargo(EntityAI container)
Определения PumpkinHelmet.c:20
void UpdateGlowState()
Определения PumpkinHelmet.c:49
void PumpkinHelmet()
Определения PumpkinHelmet.c:5
override void OnMovedInsideCargo(EntityAI container)
Определения PumpkinHelmet.c:15
set< int > GetAttachmentExclusionInitSlotValue(int slotId)
Определения PumpkinHelmet.c:100
override void EOnInit(IEntity other, int extra)
Определения PumpkinHelmet.c:30
override void UpdateNVGStatus(PlayerBase player, bool attaching=false, bool force_disable=false)
Определения PumpkinHelmet.c:78
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
Определения PumpkinHelmet.c:42
EntityEvent
Entity events for event-mask, or throwing event from code.
Определения EnEntity.c:45