DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ EEInit()

override void GetShelterVariant::EEInit ( )

См. определение в файле Shelter.c строка 142

143{
144 static const string SITE_OBJECT_TYPE = "ShelterSite";
145
146 void ShelterBase()
147 {
148 m_ShowAnimationsWhenPitched.Insert("Body");
149 m_ShowAnimationsWhenPacked.Insert("Body");
150
151 m_HalfExtents = Vector(0.8, 0.15, 1.3);
152 }
153
154 override void SetActions()
155 {
156 super.SetActions();
157
162
164 }
165
166 override void EEInit()
167 {
168 super.EEInit();
169
170 TryPitch(true, true);
171 }
172
173 void Deconstruct()
174 {
176 }
177
178 void DeconstructEx(bool createdItemsFall = false)
179 {
181 SpawnKitEx(createdItemsFall);
182 Delete();
183 }
184
185 string GetMaterialPath()
186 {
187 return string.Format("%1 %2 Construction site %3 Materials", CFG_VEHICLESPATH, SITE_OBJECT_TYPE, GetShelterVariant());
188 }
189
190 string GetShelterVariant()
191 {
192 return "";
193 }
194
195 void SpawnKit()
196 {
197 SpawnKitEx();
198 }
199
200 void SpawnKitEx(bool shouldKitFall = false)
201 {
202 ItemBase constructionKit = ItemBase.Cast(g_Game.CreateObjectEx("ShelterKit", GetPosition(), ECE_PLACE_ON_SURFACE));
203 constructionKit.SetHealth01("", "", GetHealth01());
204
205 if (shouldKitFall)
206 constructionKit.ThrowPhysically(null, vector.Zero);
207 }
208
209 override bool IsPlayerInside(PlayerBase player, string selection)
210 {
211 vector player_pos = player.GetPosition();
212 vector shelter_pos = GetPosition();
213 vector ref_dir = GetDirection();
214 ref_dir[1] = 0;
215 ref_dir.Normalize();
216
217 vector x[2];
218 vector b1,b2;
219 GetCollisionBox(x);
220 b1 = x[0];
221 b2 = x[1];
222
223 vector dir_to_shelter = shelter_pos - player_pos;
224 dir_to_shelter[1] = 0;
225 float len = dir_to_shelter.Length();
226
227 dir_to_shelter.Normalize();
228
229 vector ref_dir_angle = ref_dir.VectorToAngles();
230 vector dir_to_shelter_angle = dir_to_shelter.VectorToAngles();
231 vector test_angles = dir_to_shelter_angle - ref_dir_angle;
232
233 vector test_position = test_angles.AnglesToVector() * len;
234
235 if (test_position[0] < b1[0] || test_position[0] > b2[0] || test_position[2] < 0.2 || test_position[2] > 2.2 )
236 {
237 return false;
238 }
239 else
240 {
241 return true;
242 }
243 }
244
245 override void OnItemFallRebuilding()
246 {
247 if (!g_Game.IsServer() || m_IsFalling)
248 return;
249
250 DropCargoItems();
251 DeconstructEx(true);
252 m_IsFalling = true;
253
254 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ClearIsFalling, 800);
255 }
256}
257
258class ShelterFabric extends ShelterBase
259{
260 override string GetShelterVariant()
261 {
262 return "fabric";
263 }
264}
265
266class ShelterLeather extends ShelterBase
267{
268 override string GetShelterVariant()
269 {
270 return "leather";
271 }
272}
273
274class ShelterStick extends ShelterBase
275{
276 override string GetShelterVariant()
277 {
278 return "stick";
279 }
280}
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
Определения ActionDeployObject.c:9
ActionPackTentCB ActionContinuousBaseCB ActionPackTent()
Определения ActionPackTent.c:11
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
void RemoveAction(typename actionName)
Определения AdvancedCommunication.c:252
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:38
Container_Base m_HalfExtents
DayZGame g_Game
Определения DayZGame.c:4074
Icon x
class ShelterBase extends TentBase GetShelterVariant()
Определения Shelter.c:119
override bool IsPlayerInside(PlayerBase player, string selection)
Определения Shelter.c:185
override void OnItemFallRebuilding()
Определения Shelter.c:221
void DeconstructEx(bool createdItemsFall=false)
Определения Shelter.c:154
static const string SITE_OBJECT_TYPE
Определения Shelter.c:120
void SpawnKitEx(bool shouldKitFall=false)
Определения Shelter.c:176
void SpawnKit()
Определения Shelter.c:171
void Deconstruct()
Определения Shelter.c:149
override void EEInit()
Определения Shelter.c:142
override void SetActions()
Определения Shelter.c:130
string GetMaterialPath()
Определения Shelter.c:161
void ShelterBase()
Определения Shelter.c:122
bool m_IsFalling
Определения TrapBase.c:48
void ClearIsFalling()
Определения TrapBase.c:723
Определения PlayerBaseClient.c:2
override string GetShelterVariant()
Определения Shelter.c:127
Определения Shelter.c:126
static void SpawnConstructionMaterialPilesEx(notnull EntityAI entity, Man player, string cfgPath, string mainPartName, string damagezoneName="", bool isBase=false, bool throwPiles=false)
spawns material from any construction; 'player' parameter optional; 'main_part_name' is actually a PA...
Определения ConstructionBase.c:1809
Deprecated.
Определения ConstructionBase.c:1807
proto native float Length()
Returns length of vector (magnitude)
static const vector Zero
Определения EnConvert.c:123
proto float Normalize()
Normalizes vector. Returns length.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
proto vector AnglesToVector()
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
Определения EnConvert.c:119
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
const string CFG_VEHICLESPATH
Определения 3_Game/DayZ/constants.c:228
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8