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

◆ SpawnKitEx()

void GetShelterVariant::SpawnKitEx ( bool shouldKitFall = false)

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

177{
178 static const string SITE_OBJECT_TYPE = "ShelterSite";
179
180 void ShelterBase()
181 {
182 m_ShowAnimationsWhenPitched.Insert("Body");
183 m_ShowAnimationsWhenPacked.Insert("Body");
184
185 m_HalfExtents = Vector(0.8, 0.15, 1.3);
186 }
187
188 override void SetActions()
189 {
190 super.SetActions();
191
196
198 }
199
200 override void EEInit()
201 {
202 super.EEInit();
203
204 TryPitch(true, true);
205 }
206
207 void Deconstruct()
208 {
210 }
211
212 void DeconstructEx(bool createdItemsFall = false)
213 {
215 SpawnKitEx(createdItemsFall);
216 Delete();
217 }
218
219 string GetMaterialPath()
220 {
221 return string.Format("%1 %2 Construction site %3 Materials", CFG_VEHICLESPATH, SITE_OBJECT_TYPE, GetShelterVariant());
222 }
223
224 string GetShelterVariant()
225 {
226 return "";
227 }
228
229 void SpawnKit()
230 {
231 SpawnKitEx();
232 }
233
234 void SpawnKitEx(bool shouldKitFall = false)
235 {
236 ItemBase constructionKit = ItemBase.Cast(g_Game.CreateObjectEx("ShelterKit", GetPosition(), ECE_PLACE_ON_SURFACE));
237 constructionKit.SetHealth01("", "", GetHealth01());
238
239 if (shouldKitFall)
240 constructionKit.ThrowPhysically(null, vector.Zero);
241 }
242
243 override bool IsPlayerInside(PlayerBase player, string selection)
244 {
245 vector player_pos = player.GetPosition();
246 vector shelter_pos = GetPosition();
247 vector ref_dir = GetDirection();
248 ref_dir[1] = 0;
249 ref_dir.Normalize();
250
251 vector x[2];
252 vector b1,b2;
253 GetCollisionBox(x);
254 b1 = x[0];
255 b2 = x[1];
256
257 vector dir_to_shelter = shelter_pos - player_pos;
258 dir_to_shelter[1] = 0;
259 float len = dir_to_shelter.Length();
260
261 dir_to_shelter.Normalize();
262
263 vector ref_dir_angle = ref_dir.VectorToAngles();
264 vector dir_to_shelter_angle = dir_to_shelter.VectorToAngles();
265 vector test_angles = dir_to_shelter_angle - ref_dir_angle;
266
267 vector test_position = test_angles.AnglesToVector() * len;
268
269 if (test_position[0] < b1[0] || test_position[0] > b2[0] || test_position[2] < 0.2 || test_position[2] > 2.2 )
270 {
271 return false;
272 }
273 else
274 {
275 return true;
276 }
277 }
278
279 override void OnItemFallRebuilding()
280 {
281 if (!g_Game.IsServer() || m_IsFalling)
282 return;
283
284 DropCargoItems();
285 DeconstructEx(true);
286 m_IsFalling = true;
287
288 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ClearIsFalling, 800);
289 }
290}
291
292class ShelterFabric extends ShelterBase
293{
294 override string GetShelterVariant()
295 {
296 return "fabric";
297 }
298}
299
300class ShelterLeather extends ShelterBase
301{
302 override string GetShelterVariant()
303 {
304 return "leather";
305 }
306}
307
308class ShelterStick extends ShelterBase
309{
310 override string GetShelterVariant()
311 {
312 return "stick";
313 }
314}
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

Используется в TentBase::DeconstructEx() и TentBase::SpawnKit().