DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс Clothing
+ Граф наследования: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)
 

Закрытые члены

override bool CanPutInCargo (EntityAI parent)
 
override bool CanPutAsAttachment (EntityAI parent)
 
override void SetActions ()
 
override void SwitchItemSelectionTextureEx (EItemManipulationContext context, Param par=null)
 
void Headtorch_ColorBase ()
 
override void SetActions ()
 

Закрытые данные

HeadtorchLight m_Light
 
ref Timer m_Timer
 

Закрытые статические данные

static int REFLECTOR_ID = 4
 
static int GLASS_ID = 5
 
static string LIGHT_OFF_GLASS = "dz\\characters\\headgear\\data\\HeadTorchGlass.rvmat"
 
static string LIGHT_OFF_REFLECTOR = "dz\\characters\\headgear\\data\\HeadTorch.rvmat"
 
static string LIGHT_ON_GLASS = "dz\\characters\\headgear\\data\\HeadTorchGlass_on.rvmat"
 
static string LIGHT_ON_GLASS_RED = "dz\\characters\\headgear\\data\\HeadTorchGlass_on_red.rvmat"
 
static string LIGHT_ON_REFLECTOR = "dz\\characters\\headgear\\data\\HeadTorch_ON.rvmat"
 
static string LIGHT_ON_REFLECTOR_RED = "dz\\characters\\headgear\\data\\HeadTorch_ON_red.rvmat"
 
static vector m_OnHeadLocalPos = Vector(0.12,0.15,0)
 
static vector m_OnHeadLocalOri = Vector(0,90,0)
 
static string m_OffHeadLightPoint = "beamStart"
 
static string m_OffHeadLightTarget = "beamEnd"
 

Подробное описание

Методы

◆ AttachLightOnHead()

void AttachLightOnHead ( EntityAI person)
inlineprotected
168 {
169 if (person.IsPlayer())
170 {
172 int boneIdx = player.GetBoneIndexByName("Head");
173
174 if (boneIdx != -1)
175 {
176 if (m_Light.GetParent())
177 m_Light.DetachFromParent();
178
179 m_Light.SetPosition(m_OnHeadLocalPos);
180 m_Light.SetOrientation(m_OnHeadLocalOri);
181
182 player.AddChild(m_Light, boneIdx);
183 }
184 }
185 else if (person.IsZombie())
186 {
187 if (m_Light.GetParent())
188 m_Light.DetachFromParent();
189
190 m_Light.SetPosition(m_OnHeadLocalPos);
191 m_Light.SetOrientation(m_OnHeadLocalOri);
192
193 person.AddChild(m_Light, 17);
194 }
195 }
static vector m_OnHeadLocalPos
Definition Headtorch_ColorBase.c:15
static vector m_OnHeadLocalOri
Definition Headtorch_ColorBase.c:16
HeadtorchLight m_Light
Definition Headtorch_ColorBase.c:3
Definition EntityAI.c:95
Definition PlayerBaseClient.c:2

Перекрестные ссылки m_Light.

◆ CanPutAsAttachment()

override bool CanPutAsAttachment ( EntityAI parent)
inlineprivate
14 {
15 if(!super.CanPutAsAttachment(parent)) {return false;}
16 if ( GetQuantity() <= 1 )
17 {
18 return true;
19 }
20 return false;
21 }
override float GetQuantity()
Definition ItemBase.c:8129

Перекрестные ссылки GetQuantity().

◆ CanPutInCargo()

override bool CanPutInCargo ( EntityAI parent)
inlineprivate
4 {
5 if( !super.CanPutInCargo(parent) ) {return false;}
6 if ( GetNumberOfItems() == 0 || !parent || parent.IsMan() )
7 {
8 return true;
9 }
10 return false;
11 }
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
Definition ItemBase.c:8193
override bool IsMan()
Definition Man.c:44

Перекрестные ссылки GetNumberOfItems() и EntityAI::IsMan().

◆ CheckParent()

void CheckParent ( )
inlineprotected
40 {
41 EntityAI owner = GetHierarchyParent();
42
43 // Spawn a battery in the headtorch if it's attached on a zombie and switch it on
44 if (owner && owner.IsZombie())
45 {
46 GetInventory().CreateAttachment("Battery9V");
47 GetCompEM().SwitchOn();
48 }
49
50 if (m_Timer)
51 m_Timer.Stop();
52
53 m_Timer = null;
54 }
ref Timer m_Timer
Definition Headtorch_ColorBase.c:20
Definition Building.c:6

Перекрестные ссылки m_Timer.

◆ CreateHeadtorchLight()

void CreateHeadtorchLight ( )
inlineprotected
123 {
124 if (!m_Light)
125 m_Light = HeadtorchLight.Cast(ScriptedLightBase.CreateLight( HeadtorchLight, "0 0 0"));
126
128
129 m_Light.PerformVisibilityCheck(this);
130
131 EntityAI owner = GetHierarchyParent();
132
133 if (owner)
134 {
135 if (owner.IsPlayer())
136 {
138 ItemBase att_item = owner_PB.GetItemOnSlot("Eyewear");
139
140 if (att_item == this)
141 {
143 }
144 else
145 {
146 m_Light.AttachOnMemoryPoint(this, m_OffHeadLightPoint, m_OffHeadLightTarget);
147 }
148 }
149 else if (owner.IsZombie())
150 {
152 EntityAI item_EAI = owner.GetInventory().FindAttachment(slot_id);
154
155 if (item_IB == this)
156 {
158 }
159 }
160 }
161 else
162 {
163 m_Light.AttachOnMemoryPoint(this, m_OffHeadLightPoint, m_OffHeadLightTarget);
164 }
165 }
void AttachLightOnHead(EntityAI person)
Definition Headtorch_ColorBase.c:167
static string m_OffHeadLightTarget
Definition Headtorch_ColorBase.c:18
static string m_OffHeadLightPoint
Definition Headtorch_ColorBase.c:17
void OnLightCreated()
Definition Headtorch_ColorBase.c:117
provides access to slot configuration
Definition InventorySlots.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
Definition InventoryItem.c:731
Definition PointLightBase.c:2

Перекрестные ссылки InventorySlots::GetSlotIdFromString() и m_Light.

◆ GetLightSourceItem()

override ItemBase GetLightSourceItem ( )
inlineprotected
241 {
242 return this;
243 }

◆ Headtorch_ColorBase()

void Headtorch_ColorBase ( )
inlineprivate
23 {
24 if (GetGame().IsServer())
25 {
26 if (!m_Timer)
28
29 m_Timer.Run(1 , this, "CheckParent", NULL, false);
30 }
31 }
Definition DayZPlayerImplement.c:63
proto native CGame GetGame()
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

Перекрестные ссылки CALL_CATEGORY_SYSTEM, GetGame() и m_Timer.

◆ InitGlobalExclusionValues()

void InitGlobalExclusionValues ( )
inlineprotected
34 {
35 super.InitGlobalExclusionValues();
36 AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_HEADSTRAP_0);
37 }

◆ IsLightSource()

override bool IsLightSource ( )
inlineprotected
236 {
237 return true;
238 }

◆ OnInvisibleSet()

override void OnInvisibleSet ( bool invisible)
inlineprotected
246 {
247 if (m_Light)
248 {
249 m_Light.SetEnabled(!invisible);
250 }
251 }

Перекрестные ссылки m_Light.

◆ OnLightCreated()

void OnLightCreated ( )
inlineprotected
118 {
119 m_Light.SetColorToWhite();
120 }

Перекрестные ссылки m_Light и PointLightBase::SetColorToWhite().

◆ OnWasAttached()

override void OnWasAttached ( EntityAI parent,
int slot_id )
inlineprotected
198 {
199 super.OnWasAttached(parent, slot_id);
200
201 PlayerBase player = PlayerBase.Cast(parent);
202
203 if (player)
204 {
205 if (m_Light)
206 {
208 }
209 }
210 }

Перекрестные ссылки m_Light.

◆ OnWasDetached()

override void OnWasDetached ( EntityAI parent,
int slot_id )
inlineprotected
213 {
214 super.OnWasDetached(parent, slot_id);
215
216 if (parent && (parent.IsPlayer() || parent.IsZombie()))
217 {
218 if (m_Light)
219 {
220 m_Light.DetachFromParent();
221 m_Light.AttachOnMemoryPoint(this, m_OffHeadLightPoint, m_OffHeadLightTarget);
222 }
223 }
224 }

Перекрестные ссылки m_Light.

◆ OnWork()

override void OnWork ( float consumed_energy)
inlineprotected
94 {
95 super.OnWork(consumed_energy);
96
97 if (!GetGame().IsServer() || !GetGame().IsMultiplayer()) // Client side
98 {
99 Battery9V battery = Battery9V.Cast(GetCompEM().GetEnergySource());
100
101 if (battery && m_Light)
102 {
103 float efficiency = battery.GetEfficiency0To1();
104
105 if (efficiency < 1)
106 {
107 m_Light.SetIntensity(efficiency, GetCompEM().GetUpdateInterval());
108 }
109 else
110 {
111 m_Light.SetIntensity(1, 0);
112 }
113 }
114 }
115 }
Definition Battery9V.c:2

Перекрестные ссылки GetGame(), m_Light и PointLightBase::SetIntensity().

◆ OnWorkStart()

override void OnWorkStart ( )
inlineprotected
57 {
58 super.OnWorkStart();
59
60 if (!GetGame().IsServer() || !GetGame().IsMultiplayer()) // Client side
61 {
63 }
64
65 if (IsInherited(Headtorch_Black))
66 {
67 SetObjectMaterial(GLASS_ID, LIGHT_ON_GLASS_RED);
68 SetObjectMaterial(REFLECTOR_ID, LIGHT_ON_REFLECTOR_RED);
69 }
70 else
71 {
72 SetObjectMaterial(GLASS_ID, LIGHT_ON_GLASS);
73 SetObjectMaterial(REFLECTOR_ID, LIGHT_ON_REFLECTOR);
74 }
75 }
static string LIGHT_ON_GLASS
Definition Headtorch_ColorBase.c:10
static string LIGHT_ON_GLASS_RED
Definition Headtorch_ColorBase.c:11
void CreateHeadtorchLight()
Definition Headtorch_ColorBase.c:122
static string LIGHT_ON_REFLECTOR_RED
Definition Headtorch_ColorBase.c:13
static string LIGHT_ON_REFLECTOR
Definition Headtorch_ColorBase.c:12
static int REFLECTOR_ID
Definition Headtorch_ColorBase.c:5
static int GLASS_ID
Definition Headtorch_ColorBase.c:6
Definition Headtorch_Black.c:2

Перекрестные ссылки GetGame().

◆ OnWorkStop()

override void OnWorkStop ( )
inlineprotected
78 {
79 super.OnWorkStop();
80
81 if (!GetGame().IsServer() || !GetGame().IsMultiplayer()) // Client side
82 {
83 if (m_Light)
84 m_Light.FadeOut();
85
86 m_Light = NULL;
87 }
88
89 SetObjectMaterial(GLASS_ID, LIGHT_OFF_GLASS);
90 SetObjectMaterial(REFLECTOR_ID, LIGHT_OFF_REFLECTOR);
91 }
static string LIGHT_OFF_GLASS
Definition Headtorch_ColorBase.c:8
static string LIGHT_OFF_REFLECTOR
Definition Headtorch_ColorBase.c:9

Перекрестные ссылки GetGame() и m_Light.

◆ SetActions() [1/3]

override void SetActions ( )
inlineprivate
24 {
25 super.SetActions();
27 }
void AddAction(typename actionName)
Definition AdvancedCommunication.c:220
Definition ActionWringClothes.c:13

Перекрестные ссылки AddAction().

◆ SetActions() [2/3]

override void SetActions ( )
inlineprotected
227 {
228 super.SetActions();
233 }
Definition ActionTurnOffHeadtorch.c:2
Definition ActionTurnOffWhileInHands.c:2
Definition ActionTurnOnHeadtorch.c:2
Definition ActionTurnOnWhileInHands.c:2

Перекрестные ссылки AddAction().

◆ SetActions() [3/3]

override void SetActions ( )
inlineprivate
4 {
5 super.SetActions();
7 }

Перекрестные ссылки AddAction().

◆ SwitchItemSelectionTextureEx()

override void SwitchItemSelectionTextureEx ( EItemManipulationContext context,
Param par = null )
inlineprivate
30 {
31 super.SwitchItemSelectionTextureEx(context, par);
32
34 {
36 if (!data)
37 {
38 return;
39 }
40
41 PlayerBase player = data.param1;
42
43 int selection_idx = -1;
44 string texture;
45
48
49 //has top
50 if (player.FindAttachmentBySlotName("Body"))
51 {
52 show_selections.Insert("camoMale_big_a");
53 show_selections.Insert("camoMale_big_b");
54 show_selections.Insert("camoFemale_big_a");
55 show_selections.Insert("camoFemale_big_b");
56
57 hide_selections.Insert("camoMale_small_a");
58 hide_selections.Insert("camoMale_small_b");
59 hide_selections.Insert("camoFemale_small_a");
60 hide_selections.Insert("camoFemale_small_b");
61 }
62 //has no top
63 else
64 {
65 hide_selections.Insert("camoMale_big_a");
66 hide_selections.Insert("camoMale_big_b");
67 hide_selections.Insert("camoFemale_big_a");
68 hide_selections.Insert("camoFemale_big_b");
69
70 show_selections.Insert("camoMale_small_a");
71 show_selections.Insert("camoMale_small_b");
72 show_selections.Insert("camoFemale_small_a");
73 show_selections.Insert("camoFemale_small_b");
74 }
75
76 int i;
77 for (i = 0; i < show_selections.Count(); i++)
78 {
79 selection_idx = GetHiddenSelectionIndex(show_selections[i]);
80 texture = GetHiddenSelectionsData().GetHiddenSelectionsTextures()[selection_idx];
81 SetObjectTexture( selection_idx, texture );
82 }
83
84 for (i = 0; i < hide_selections.Count(); i++)
85 {
86 selection_idx = GetHiddenSelectionIndex(hide_selections[i]);
87 SetObjectTexture( selection_idx, "" );
88 }
89 }
90 }

Поля

◆ GLASS_ID

int GLASS_ID = 5
staticprivate

◆ LIGHT_OFF_GLASS

string LIGHT_OFF_GLASS = "dz\\characters\\headgear\\data\\HeadTorchGlass.rvmat"
staticprivate

◆ LIGHT_OFF_REFLECTOR

string LIGHT_OFF_REFLECTOR = "dz\\characters\\headgear\\data\\HeadTorch.rvmat"
staticprivate

◆ LIGHT_ON_GLASS

string LIGHT_ON_GLASS = "dz\\characters\\headgear\\data\\HeadTorchGlass_on.rvmat"
staticprivate

◆ LIGHT_ON_GLASS_RED

string LIGHT_ON_GLASS_RED = "dz\\characters\\headgear\\data\\HeadTorchGlass_on_red.rvmat"
staticprivate

◆ LIGHT_ON_REFLECTOR

string LIGHT_ON_REFLECTOR = "dz\\characters\\headgear\\data\\HeadTorch_ON.rvmat"
staticprivate

◆ LIGHT_ON_REFLECTOR_RED

string LIGHT_ON_REFLECTOR_RED = "dz\\characters\\headgear\\data\\HeadTorch_ON_red.rvmat"
staticprivate

◆ m_Light

HeadtorchLight m_Light
private

◆ m_OffHeadLightPoint

string m_OffHeadLightPoint = "beamStart"
staticprivate

◆ m_OffHeadLightTarget

string m_OffHeadLightTarget = "beamEnd"
staticprivate

◆ m_OnHeadLocalOri

vector m_OnHeadLocalOri = Vector(0,90,0)
staticprivate

◆ m_OnHeadLocalPos

vector m_OnHeadLocalPos = Vector(0.12,0.15,0)
staticprivate

◆ m_Timer

ref Timer m_Timer
private

◆ REFLECTOR_ID

int REFLECTOR_ID = 4
staticprivate

Объявления и описания членов классов находятся в файлах: