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

◆ IsPlayerInside()

override bool GetShelterVariant::IsPlayerInside ( PlayerBase player,
string selection )

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

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