DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
TentBase.c
См. документацию.
1class TentBase extends ItemBase
2{
3 const int OPENING_0 = 1;
4 const int OPENING_1 = 2;
5 const int OPENING_2 = 4;
6 const int OPENING_3 = 8;
7 const int OPENING_4 = 16;
8 const int OPENING_5 = 32;
9 const int OPENING_6 = 64;
10 const int OPENING_7 = 128;
11 const int OPENING_8 = 256;
12 const int OPENING_9 = 512;
13 const int OPENING_10 = 1024;
14 const int OPENING_11 = 2048;
15 const int OPENING_12 = 4096;
16 const int OPENING_13 = 8192;
17 const int OPENING_14 = 16384;
18 const int OPENING_15 = 32768;
19
20 static const int PACKED = 0;
21 static const int PITCHED = 1;
22 const float MAX_PLACEMENT_HEIGHT_DIFF = 1.5;
23
24 protected int m_State;
25 protected int m_StateLocal = -1;
26 protected bool m_IsEntrance;
27 protected bool m_IsWindow;
28 protected bool m_IsToggle;
29 protected bool m_IsBeingPacked = false;
30 protected int m_OpeningMask = 0;
31 protected int m_OpeningMaskLocal = -1;
32
37 protected CamoNet m_CamoNet;
38 protected vector m_HalfExtents; // The Y value contains a heightoffset and not the halfextent !!!
39
40 protected bool m_IsFalling;
41
42 void TentBase()
43 {
47
49 RegisterNetSyncVariableInt("m_State");
50 RegisterNetSyncVariableBool("m_IsEntrance");
51 RegisterNetSyncVariableBool("m_IsWindow");
52 RegisterNetSyncVariableBool("m_IsToggle");
53 RegisterNetSyncVariableInt("m_OpeningMask");
54 RegisterNetSyncVariableBool("m_IsBeingPacked");
55
56 ProcessInvulnerabilityCheck(GetInvulnerabilityTypeString());
57 }
58
59 void ~TentBase()
60 {
61 if (g_Game)
62 {
64 }
65 }
66
68 {
69 return "disableContainerDamage";
70 }
71
72 override bool HasProxyParts()
73 {
74 return true;
75 }
76
78 override bool CanProxyObstructSelf()
79 {
80 return true;
81 }
82
83 override bool IsItemTent()
84 {
85 return true;
86 }
87
89 {
90 return false;
91 }
92
93 override bool CanDisplayCargo()
94 {
95 if(m_State == PACKED)
96 return false;
97 return true;
98 }
99
100 override bool CanDisplayAttachmentCategory(string category_name)
101 {
102 if(m_State == PACKED)
103 return false;
104 return true;
105 }
106
107 override bool CanDisplayAttachmentSlot(int slot_id)
108 {
109 if(m_State == PACKED)
110 return false;
111 return true;
112 }
113
114 override int GetMeleeTargetType()
115 {
116 return EMeleeTargetType.NONALIGNABLE;
117 }
118
120 {
121 super.OnStoreSave(ctx);
122
123 ctx.Write(m_State);
124 ctx.Write(m_OpeningMask);
125 }
126
127 override bool OnStoreLoad(ParamsReadContext ctx, int version)
128 {
129 if (!super.OnStoreLoad(ctx, version))
130 return false;
131
132 ctx.Read(m_State);
133 if (version >= 110)
134 {
135 if (!ctx.Read(m_OpeningMask))
136 Print("ERROR: no opening mask found! Default openinng settings initialized.");
137 }
138
139 if (m_State == PITCHED)
140 {
141 TryPitch(true);
142
143 if (g_Game.IsServer())
144 {
146 {
148 m_ClutterCutter.SetOrientation(GetOrientation());
149 }
150
152 }
153 }
154 else
155 {
156 Pack(true);
157 }
158
159 return true;
160 }
161
162 override void RefreshPhysics()
163 {
164 super.RefreshPhysics();
165
166 if (m_State == PITCHED)
167 {
168 TryPitch(false, true);
169 }
170 else
171 {
172 Pack(false, true);
173 }
174 }
175
176 override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
177 {
178 super.OnItemLocationChanged(old_owner, new_owner);
179
180 if (new_owner || old_owner)
181 {
182 if (GetInventory().CountInventory() == 1) // refuse to pack tent with anything inside
183 Pack(false);
184 }
185 }
186
188 {
189 super.OnVariablesSynchronized();
190
191 if (m_State != m_StateLocal)
192 {
193 if (m_State == PACKED)
194 Pack(false);
195 else
196 TryPitch(false);
197
199 }
200
201 if ((m_OpeningMaskLocal != m_OpeningMask)) //opening synchronization for physics recalculation
202 {
205
206 if (m_State == PACKED)
207 {
208 Pack(false); //intentional
209 }
210 }
211 }
212
213 override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
214 {
215 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
216
218 return;
219
220 if (zone == "" && GetState() == PITCHED && newLevel == GameConstants.STATE_RUINED && g_Game.IsServer())
221 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(this, m_HalfExtents);
222
223 if (zone != "Body" && zone != "Inventory" && zone != "")
224 {
225 if (newLevel == GameConstants.STATE_RUINED)
226 {
227 array<string> selections = new array<string>;
228 DamageSystem.GetComponentNamesFromDamageZone(this,zone,selections);
229 for (int j = 0; j < selections.Count(); j++)
230 {
231 if (selections.Get(j) != "")
232 {
233 RemoveProxyPhysics(selections.Get(j)); //To keep
234 //HideSelection(selections.Get(j)); //To change
235 AnimateCamonetByOpeningSelection(selections.Get(j)); //To keep
236 }
237 }
238 }
239 else if (oldLevel == GameConstants.STATE_RUINED)
240 {
241 if (GetState() == PITCHED)
242 {
243 TryPitch(true);
244 }
245 }
246 }
247 }
248
249 void HideAllAnimationsAndProxyPhysics(bool hide_animations = true, bool hide_physics = true)
250 {
251 string cfg_path = "cfgVehicles " + GetType() + " AnimationSources";
252
253 if (g_Game.ConfigIsExisting(cfg_path))
254 {
255 int selections = g_Game.ConfigGetChildrenCount(cfg_path);
256 string proxy_selection_name;
257
258 for (int i = 0; i < selections; i++)
259 {
260 string selection_name;
261 g_Game.ConfigGetChildName(cfg_path, i, selection_name);
262 if (hide_animations)
263 {
264 SetAnimationPhase(selection_name, 1);
265 }
266
267 proxy_selection_name = selection_name;
268 proxy_selection_name.ToLower();
269 if (hide_physics)
270 {
271 RemoveProxyPhysics(proxy_selection_name);
272 }
273 }
274 }
275 }
276
278 {
279 return CanBeManipulated();
280 }
281
282 override bool IsTakeable()
283 {
284 if (!super.IsTakeable())
285 return false;
286
287 return CanBeManipulated();
288 }
289
290 override bool CanPutIntoHands(EntityAI parent)
291 {
292 if (!super.CanPutIntoHands(parent))
293 {
294 return false;
295 }
296
297 return CanBeManipulated();
298 }
299
300 override bool CanPutInCargo(EntityAI parent)
301 {
302 if (!super.CanPutInCargo(parent))
303 {
304 return false;
305 }
306
307 return CanBeManipulated();
308 }
309
310 override bool CanRemoveFromCargo(EntityAI parent)
311 {
312 if (!super.CanRemoveFromCargo(parent))
313 return false;
314
315 return CanBeManipulated();
316 }
317
318 override bool CanRemoveFromHands(EntityAI parent)
319 {
320 if (!super.CanRemoveFromHands(parent))
321 return false;
322
323 return CanBeManipulated();
324 }
325
327 {
328 return CanBeManipulated();
329 }
330
332 {
333 return true;
334 }
335
337 {
338 int slot_id_camo;
339 int slot_id_xlights;
340 EntityAI eai_xlights;
341
342 slot_id_camo = InventorySlots.GetSlotIdFromString("CamoNet");
343 m_CamoNet = CamoNet.Cast(GetInventory().FindAttachment(slot_id_camo));
344
345 slot_id_xlights = InventorySlots.GetSlotIdFromString("Lights");
346 eai_xlights = GetInventory().FindAttachment(slot_id_xlights);
347
348 if (m_CamoNet)
349 {
351 //SetAnimationPhase("Camonet", 0);
352
353 if (!IsKindOf("MediumTent"))
354 {
355 AddProxyPhysics("camonet");
356 }
357 }
358
359 if (eai_xlights)
360 {
361 SetAnimationPhase("Xlights", 0);
362 SetAnimationPhase("Xlights_glass_r", 0);
363 SetAnimationPhase("Xlights_glass_g", 0);
364 SetAnimationPhase("Xlights_glass_b", 0);
365 SetAnimationPhase("Xlights_glass_y", 0);
366 }
367 }
368
369 override void EEItemAttached(EntityAI item, string slot_name)
370 {
371 super.EEItemAttached(item, slot_name);
372
373 if (item.IsKindOf ("CamoNet"))
374 {
375 m_CamoNet = CamoNet.Cast(item);
377 //SetAnimationPhase("Camonet", 0);
378
379 if (!IsKindOf ("MediumTent"))
380 {
381 AddProxyPhysics("camonet");
382 }
383 }
384
385 if (item.IsKindOf ("XmasLights"))
386 {
387 SetAnimationPhase("Xlights", 0);
388 SetAnimationPhase("Xlights_glass_r", 0);
389 SetAnimationPhase("Xlights_glass_g", 0);
390 SetAnimationPhase("Xlights_glass_b", 0);
391 SetAnimationPhase("Xlights_glass_y", 0);
392
393 XmasLights xlights = XmasLights.Cast(item);
394 xlights.AttachToObject(this);
395 }
396 }
397
398 override void EEItemDetached(EntityAI item, string slot_name)
399 {
400 super.EEItemDetached(item, slot_name);
401
402 if (item.IsKindOf ("CamoNet"))
403 {
404 m_CamoNet = null;
406 //SetAnimationPhase("Camonet", 1);
407
408 if (!IsKindOf ("MediumTent"))
409 {
410 RemoveProxyPhysics("camonet");
411 }
412 }
413
414 if (item.IsKindOf ("XmasLights"))
415 {
416 SetAnimationPhase("Xlights", 1);
417 SetAnimationPhase("Xlights_glass_r", 1);
418 SetAnimationPhase("Xlights_glass_g", 1);
419 SetAnimationPhase("Xlights_glass_b", 1);
420 SetAnimationPhase("Xlights_glass_y", 1);
421
422 XmasLights xlights = XmasLights.Cast(item);
423 xlights.DetachFromObject(this);
424 }
425 }
426
427 override int GetViewIndex()
428 {
429 if (MemoryPointExists("invView2"))
430 {
432 GetInventory().GetCurrentInventoryLocation(il);
433 InventoryLocationType type = il.GetType();
434
435 if (GetState() == PACKED)
436 {
437 switch (type)
438 {
439 case InventoryLocationType.ATTACHMENT:
440 return 1;
441 default:
442 return 0;
443 }
444 }
445 else
446 {
447 switch (type)
448 {
449 case InventoryLocationType.ATTACHMENT:
450 case InventoryLocationType.GROUND:
451 return 1;
452 default:
453 return 0;
454 }
455 }
456 }
457
458 return 0;
459 }
460
462 {
463 return m_State;
464 }
465
467 {
468 return m_StateLocal;
469 }
470
472 {
473 if (GetState() == PITCHED)
474 {
475 if (GetInventory().GetCargo().GetItemCount() == 0 && GetInventory().AttachmentCount() == 0)
476 {
477 return true;
478 }
479 }
480
481 return false;
482 }
483
485 {
486 if (GetState() == PACKED)
487 {
488 return true;
489 }
490 else
491 {
492 return false;
493 }
494 }
495
497 {
498 if (item.IsKindOf ("CamoNet") && GetState() == PITCHED)
499 {
500 return true;
501 }
502
503 return false;
504 }
505
507 {
508 return false;
509 }
510
511 void Pack(bool update_navmesh, bool init = false)
512 {
514
515 m_State = PACKED;
519
520 Refresh();
521
522 GetInventory().LockInventory(HIDE_INV_FROM_SCRIPT);
523
524 if (update_navmesh)
525 {
527 }
528
530
531 if (g_Game.IsServer() && !IsHologram())
532 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(this, m_HalfExtents);
533
534 SetSynchDirty();
535
536 if ((!g_Game.IsDedicatedServer()) && !init)
537 {
538 GetOnViewIndexChanged().Invoke();
539 }
540 }
541
542 void Pitch(bool update_navmesh, bool init = false)
543 {
545
550
551 Refresh();
552
553 GetInventory().UnlockInventory(HIDE_INV_FROM_SCRIPT);
554
555 if (update_navmesh)
556 {
558 }
559
560 SetSynchDirty();
561
562 if ((!g_Game.IsDedicatedServer()) && !init)
563 {
564 GetOnViewIndexChanged().Invoke();
565 }
566 }
567
568 protected void TryPitch(bool update_navmesh, bool init = false)
569 {
570 if (GetHierarchyRootPlayer())
571 {
572 if (g_Game.IsDedicatedServer())
573 {
574 Pack(update_navmesh,init);
575 }
576
577 return;
578 }
579
580 Pitch(update_navmesh,init);
581 }
582
584 {
585 string proxy_selection_name;
586 string animation_name;
587
588 if (GetState() == PITCHED)
589 {
590 for (int i = 0; i < m_ShowAnimationsWhenPitched.Count(); i++)
591 {
592 animation_name = m_ShowAnimationsWhenPitched.Get(i);
593
594 SetAnimationPhase(animation_name, 0);
595 }
596
598 }
599 else
600 {
601 for (int j = 0; j < m_ShowAnimationsWhenPacked.Count(); j++)
602 {
603 animation_name = m_ShowAnimationsWhenPacked.Get(j);
604
605 SetAnimationPhase(animation_name, 0);
606 }
607 }
608 }
609
611 {
612 string proxy_selection_name;
613 string animation_name;
614
615 if (GetState() == PITCHED)
616 {
617 for (int i = 0; i < m_ShowAnimationsWhenPitched.Count(); i++)
618 {
619 animation_name = m_ShowAnimationsWhenPitched.Get(i);
620
621 proxy_selection_name = animation_name;
622 proxy_selection_name.ToLower();
623 AddProxyPhysics(proxy_selection_name);
624 }
625
627 }
628 else
629 {
630 for (int j = 0; j < m_ShowAnimationsWhenPacked.Count(); j++)
631 {
632 animation_name = m_ShowAnimationsWhenPacked.Get(j);
633
634 proxy_selection_name = animation_name;
635 proxy_selection_name.ToLower();
636 AddProxyPhysics(proxy_selection_name);
637 }
638 }
639 }
640
641 //refresh visual/physics state
642 void Refresh()
643 {
644 g_Game.GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(UpdateVisuals);
646 }
647
648 bool CanToggleAnimations(string selection)
649 {
650 for (int i = 0; i < m_ToggleAnimations.Count(); i++)
651 {
652 ToggleAnimations toggle = m_ToggleAnimations.GetKey(i);
653 string toggle_off = toggle.GetToggleOff();
654 toggle_off.ToLower();
655 string toggle_on = toggle.GetToggleOn();
656 toggle_on.ToLower();
657
658 if (toggle_off == selection || toggle_on == selection)
659 {
660 string zone;
661 DamageSystem.GetDamageZoneFromComponentName(this,selection,zone);
662 return GetHealthLevel(zone) < GameConstants.STATE_RUINED;
663 }
664 }
665
666 return false;
667 }
668
670 {
671 m_IsEntrance = false;
672 m_IsWindow = false;
673 m_IsToggle = false;
674 }
675
677 {
678 m_IsEntrance = true;
679 }
680
682 {
683 m_IsWindow = true;
684 }
685
687 {
688 return m_IsEntrance;
689 }
690
692 {
693 return m_IsWindow;
694 }
695
696 //used by user action
697 void ToggleAnimation(string selection)
698 {
699 if (m_State == PACKED)
700 {
701 return;
702 }
703
704 bool is_closed;
705 ResetToggle();
706
707 for (int i = 0; i < m_ToggleAnimations.Count(); i++)
708 {
709 ToggleAnimations toggle = m_ToggleAnimations.GetKey(i);
710
711 string toggle_off = toggle.GetToggleOff();
712 toggle_off.ToLower();
713 string toggle_on = toggle.GetToggleOn();
714 toggle_on.ToLower();
715
716 if (toggle_off == selection || toggle_on == selection)
717 {
718 is_closed = m_OpeningMask & toggle.GetOpeningBit();
719 if (is_closed)
720 {
721 SetAnimationPhase(toggle.GetToggleOff(), 0);
722 AddProxyPhysics(toggle.GetToggleOff());
723 SetAnimationPhase(toggle.GetToggleOn(), 1);
724 RemoveProxyPhysics(toggle.GetToggleOn());
725 m_ToggleAnimations.Set(toggle, false);
726 m_IsToggle = true;
727 m_OpeningMask &= ~toggle.GetOpeningBit();
728
729 if (selection.Contains("window"))
730 {
732 if (GetSoundOpenWindow() != string.Empty)
733 StartItemSoundServer(SoundConstants.ITEM_TENT_WINDOW_OPEN);
734 }
735
736 if (selection.Contains("entrance") || selection.Contains("door"))
737 {
739 if (GetSoundOpen() != string.Empty)
740 StartItemSoundServer(SoundConstants.ITEM_TENT_OPEN);
741 }
742
743 AnimateCamonetToggle(toggle);
744 }
745 else
746 {
747 SetAnimationPhase(toggle.GetToggleOff(), 1);
748 RemoveProxyPhysics(toggle.GetToggleOff());
749 SetAnimationPhase(toggle.GetToggleOn(), 0);
750 AddProxyPhysics(toggle.GetToggleOn());
751 m_ToggleAnimations.Set(toggle, true);
752 m_IsToggle = false;
753 m_OpeningMask |= toggle.GetOpeningBit();
754
755 if (selection.Contains("window"))
756 {
758 if (GetSoundCloseWindow() != string.Empty)
759 StartItemSoundServer(SoundConstants.ITEM_TENT_WINDOW_CLOSE);
760 }
761
762 if (selection.Contains("entrance") || selection.Contains("door"))
763 {
765 if (GetSoundClose() != string.Empty)
766 StartItemSoundServer(SoundConstants.ITEM_TENT_CLOSE);
767 }
768
769 AnimateCamonetToggle(toggle);
770 }
771 }
772 }
773 SetSynchDirty();
774 }
775
777 {
778 SetAnimationPhase("CamoNet", hide);
779 }
780
782
783 void AnimateCamonetByOpeningSelection(string opening_selection) {};
784
785 string GetSoundOpen() {};
786
787 string GetSoundClose() {};
788
790
792
794 {
795 SetAffectPathgraph(true, false);
796
797 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(g_Game.UpdatePathgraphRegionByObject, 100, false, this);
798 }
799
801 string GetClutterCutter() {};
802
804 {
805 if (g_Game.IsMultiplayer() || g_Game.IsServer())
806 {
807 if (m_ClutterCutter)
808 {
809 g_Game.ObjectDelete(m_ClutterCutter);
810 }
811 }
812 }
813
814 //================================================================
815 // ADVANCED PLACEMENT
816 //================================================================
817
818 override bool IsDeployable()
819 {
820 return true;
821 }
822
823 override void OnPlacementComplete(Man player, vector position = "0 0 0", vector orientation = "0 0 0")
824 {
825 super.OnPlacementComplete(player, position, orientation);
826
827 if (g_Game.IsServer())
828 {
829 TryPitch(true);
830 }
831 }
832
833 override void InitItemSounds()
834 {
835 super.InitItemSounds();
836
838
839 if (GetSoundOpen() != string.Empty)
840 handler.AddSound(SoundConstants.ITEM_TENT_OPEN, GetSoundOpen());
841
842 if (GetSoundClose() != string.Empty)
843 handler.AddSound(SoundConstants.ITEM_TENT_CLOSE, GetSoundClose());
844
845 if (GetSoundOpenWindow() != string.Empty)
846 handler.AddSound(SoundConstants.ITEM_TENT_WINDOW_OPEN, GetSoundOpenWindow());
847
848 if (GetSoundCloseWindow() != string.Empty)
849 handler.AddSound(SoundConstants.ITEM_TENT_WINDOW_CLOSE, GetSoundCloseWindow());
850 }
851
852 override void SetActions()
853 {
854 super.SetActions();
855
860 }
861
863 {
864 bool is_closed;
865 bool is_ruined;
866 string zone;
867 string component;
868 ToggleAnimations toggle;
869
870 for (int i = 0; i < m_ToggleAnimations.Count(); i++)
871 {
872 toggle = m_ToggleAnimations.GetKey(i);
873 is_closed = m_OpeningMask & toggle.GetOpeningBit();
874 component = toggle.GetToggleOff(); //either one works
875 component.ToLower();
876 DamageSystem.GetDamageZoneFromComponentName(this,component,zone);
877 //is_ruined = (GetHealthLevel(zone) == GameConstants.STATE_RUINED);
878
879 if (is_closed)
880 {
881 SetAnimationPhase(toggle.GetToggleOff(),1);
882 SetAnimationPhase(toggle.GetToggleOn(),is_ruined);
883 m_ToggleAnimations.Set(toggle, false);
884 }
885 else
886 {
887 SetAnimationPhase(toggle.GetToggleOn(),1);
888 SetAnimationPhase(toggle.GetToggleOff(),is_ruined);
889 m_ToggleAnimations.Set(toggle, true);
890 }
891 //AnimateCamonetToggle(toggle);
892 }
893 }
894
896 {
897 bool is_closed;
898 bool is_ruined;
899 int hplevel;
900 string zone;
901 string component;
902 ToggleAnimations toggle;
903
904 for (int i = 0; i < m_ToggleAnimations.Count(); i++)
905 {
906 toggle = m_ToggleAnimations.GetKey(i);
907 is_closed = m_OpeningMask & toggle.GetOpeningBit();
908 component = toggle.GetToggleOff(); //either one works
909 component.ToLower();
910 DamageSystem.GetDamageZoneFromComponentName(this,component,zone);
911 is_ruined = (GetHealthLevel(zone) == GameConstants.STATE_RUINED);
912
913 //re-adding physics to avoid proxy physics stacking
914 RemoveProxyPhysics(toggle.GetToggleOff());
915 RemoveProxyPhysics(toggle.GetToggleOn());
916
917 if (!is_ruined && GetState() == PITCHED)
918 {
919 if (is_closed)
920 {
921 AddProxyPhysics(toggle.GetToggleOn());
922 }
923 else
924 {
925 AddProxyPhysics(toggle.GetToggleOff());
926 }
927 }
928 }
929 }
930
932 {
933 return 110;
934 }
935
937 {
938 if (GetHealthLevel() == GameConstants.STATE_RUINED || m_IsBeingPacked)
939 return false;
940
941 return super.CanReceiveItemIntoCargo(item);
942 }
943
944 override bool CanLoadItemIntoCargo(EntityAI item)
945 {
946 if (!super.CanLoadItemIntoCargo(item))
947 return false;
948 if (GetHealthLevel() == GameConstants.STATE_RUINED)
949 return false;
950
951 return true;
952 }
953
954 override bool CanReceiveAttachment(EntityAI attachment, int slotId)
955 {
956 if (GetHealthLevel() == GameConstants.STATE_RUINED)
957 return false;
958
959 return super.CanReceiveAttachment(attachment, slotId);
960 }
961
962 override bool CanLoadAttachment(EntityAI attachment)
963 {
964 if (GetHealthLevel() == GameConstants.STATE_RUINED)
965 return false;
966
967 return super.CanLoadAttachment(attachment);
968 }
969
970 override bool CanBePlaced(Man player, vector position)
971 {
972 vector playerpos = player.GetPosition();
973 float delta1 = playerpos[1] - position[1];
974
976 return false;
977 return true;
978 }
979
980 void SetIsBeingPacked(bool isBeingPacked)
981 {
982 m_IsBeingPacked = isBeingPacked;
983 SetSynchDirty();
984 }
985
986 override void OnItemFallRebuilding()
987 {
988 if (!g_Game.IsServer() || m_IsFalling)
989 return;
990
992 Pack(false);
993 m_IsFalling = true;
994
995 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ClearIsFalling, 800);
996 }
997
999 {
1000 if (HasAnyAttachmentsOrCargo())
1001 {
1003 MiscGameplayFunctions.ThrowAllItemsInInventoryEx(this, ThrowEntityFlags.NONE, vector.Zero);
1004 }
1005 }
1006
1007 protected void ClearIsFalling()
1008 {
1009 m_IsFalling = false;
1010 }
1011
1013 protected ref EffectSound m_DeployLoopSound; //DEPRECATED in favor of m_DeployLoopSoundEx
1014
1021};
eBleedingSourceType GetType()
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
Определения ActionDeployObject.c:9
ActionPackTentCB ActionContinuousBaseCB ActionPackTent()
Определения ActionPackTent.c:11
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
vector GetOrientation()
Определения AreaDamageManager.c:306
override string GetInvulnerabilityTypeString()
Определения BaseBuildingBase.c:1356
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:38
void UpdatePhysics()
update ALL parts physics. Sets hide first, then shows the rest. Use only if the update queue system w...
Определения ConstructionBase.c:490
DayZGame g_Game
Определения DayZGame.c:4074
vector position
Определения DustKickupEffects.c:20
vector orientation
Определения DustKickupEffects.c:21
EMeleeTargetType
Определения EMeleeTargetType.c:2
Empty
Определения Hand_States.c:14
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override bool IsHologram()
Определения ItemBase.c:920
ItemSoundHandler GetItemSoundHandler()
Определения ItemBase.c:4407
void StartItemSoundServer(int id, int slotId)
Определения ItemBase.c:4436
bool m_FixDamageSystemInit
Определения ItemBase.c:61
void ItemSoundHandler(ItemBase parent)
Определения ItemSoundHandler.c:31
enum MagnumStableStateID init
ThrowEntityFlags
Определения MiscGameplayFunctions.c:208
void Refresh()
Определения SizeToChild.c:108
ref EffectSound m_DeployLoopSound
DEPRECATED.
Определения TrapBase.c:732
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
proto native int GetType()
returns type of InventoryLocation
InventoryLocation.
Определения InventoryLocation.c:30
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
Определения InventorySlots.c:6
void DropCargoItems()
Определения TentBase.c:998
override int GetMeleeTargetType()
Определения TentBase.c:114
override void EEItemAttached(EntityAI item, string slot_name)
Определения TentBase.c:369
bool CanToggleAnimations(string selection)
Определения TentBase.c:648
override bool CanDisplayCargo()
Определения TentBase.c:93
bool IsManipulatedWindow()
Определения TentBase.c:691
bool CanAttach(ItemBase item)
Определения TentBase.c:496
const int OPENING_9
Определения TentBase.c:12
void UpdateVisuals()
Определения TentBase.c:583
void HandleOpeningsPhysics()
Определения TentBase.c:895
void SoundTentClosePlay()
override void OnItemFallRebuilding()
Определения TentBase.c:986
override bool CanReceiveItemIntoCargo(EntityAI item)
Определения TentBase.c:936
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Определения TentBase.c:127
const int OPENING_13
Определения TentBase.c:16
const int OPENING_15
Определения TentBase.c:18
void HandleOpeningsVisuals()
Определения TentBase.c:862
bool IsManipulatedEntrance()
Определения TentBase.c:686
void ClearIsFalling()
Определения TentBase.c:1007
int GetStateLocal()
Определения TentBase.c:466
const int OPENING_14
Определения TentBase.c:17
void SoundTentOpenPlay()
DEPRECATED.
override int GetViewIndex()
Определения TentBase.c:427
override bool CanProxyObstructSelf()
prevents showing cargo when outside the tent geometry
Определения TentBase.c:78
override bool HasProxyParts()
Определения TentBase.c:72
override bool CanBeRepairedByCrafting()
Определения TentBase.c:88
bool ConditionOutOfHands(EntityAI player)
Определения TentBase.c:326
int m_StateLocal
Определения TentBase.c:25
void Refresh()
Определения TentBase.c:642
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Определения TentBase.c:176
string GetSoundCloseWindow()
Определения TentBase.c:791
override bool CanPutIntoHands(EntityAI parent)
Определения TentBase.c:290
void PlayDeployLoopSound()
override bool IsItemTent()
Определения TentBase.c:83
override void SetActions()
Определения TentBase.c:852
int m_OpeningMask
Определения TentBase.c:30
void HideAllAnimationsAndProxyPhysics(bool hide_animations=true, bool hide_physics=true)
Определения TentBase.c:249
bool CanBeManipulated()
Определения TentBase.c:484
const int OPENING_6
Определения TentBase.c:9
int m_OpeningMaskLocal
Определения TentBase.c:31
override string GetInvulnerabilityTypeString()
Определения TentBase.c:67
override bool CanLoadAttachment(EntityAI attachment)
Определения TentBase.c:962
bool m_IsEntrance
Определения TentBase.c:26
string GetClutterCutter()
Определения TentBase.c:801
override int GetDamageSystemVersionChange()
Определения TentBase.c:931
const int OPENING_1
Определения TentBase.c:4
ref array< string > m_ShowAnimationsWhenPacked
Определения TentBase.c:35
string GetSoundOpenWindow()
Определения TentBase.c:789
const int OPENING_7
Определения TentBase.c:10
override bool CanRemoveFromHands(EntityAI parent)
Определения TentBase.c:318
CamoNet m_CamoNet
Определения TentBase.c:37
string GetSoundOpen()
Определения TentBase.c:785
const int OPENING_11
Определения TentBase.c:14
void Pack(bool update_navmesh, bool init=false)
Определения TentBase.c:511
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
Определения TentBase.c:213
override void OnStoreSave(ParamsWriteContext ctx)
Определения TentBase.c:119
bool m_IsToggle
Определения TentBase.c:28
bool HasClutterCutter()
Определения TentBase.c:800
void Pitch(bool update_navmesh, bool init=false)
Определения TentBase.c:542
vector m_HalfExtents
Определения TentBase.c:38
void SoundTentOpenWindowPlay()
void ResetToggle()
Определения TentBase.c:669
override bool CanLoadItemIntoCargo(EntityAI item)
Определения TentBase.c:944
void ManipulateEntrance()
Определения TentBase.c:676
const int OPENING_4
Определения TentBase.c:7
int m_State
Определения TentBase.c:24
void HandleCamoNetAttachment(bool hide)
Определения TentBase.c:776
override void EEItemDetached(EntityAI item, string slot_name)
Определения TentBase.c:398
void AnimateCamonetToggle(ToggleAnimations toggle)
Определения TentBase.c:781
override void OnVariablesSynchronized()
Определения TentBase.c:187
override void RefreshPhysics()
Определения TentBase.c:162
override bool CanDisplayAttachmentSlot(int slot_id)
Определения TentBase.c:107
override bool CanRemoveFromCargo(EntityAI parent)
Определения TentBase.c:310
static const int PITCHED
Определения TentBase.c:21
void SetIsBeingPacked(bool isBeingPacked)
Определения TentBase.c:980
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Определения TentBase.c:954
override bool CanPutInCargo(EntityAI parent)
Определения TentBase.c:300
const int OPENING_0
Определения TentBase.c:3
void RefreshAttachements()
Определения TentBase.c:336
ref array< string > m_ShowAnimationsWhenPitched
Определения TentBase.c:34
const int OPENING_12
Определения TentBase.c:15
void UpdatePhysics()
Определения TentBase.c:610
const float MAX_PLACEMENT_HEIGHT_DIFF
Определения TentBase.c:22
const int OPENING_2
Определения TentBase.c:5
void TryPitch(bool update_navmesh, bool init=false)
Определения TentBase.c:568
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Определения TentBase.c:823
override bool CanDisplayAttachmentCategory(string category_name)
Определения TentBase.c:100
string GetSoundClose()
Определения TentBase.c:787
override bool IsTakeable()
Определения TentBase.c:282
void SoundTentCloseWindowPlay()
override bool IsIgnoredByConstruction()
Определения TentBase.c:506
void ManipulateWindow()
Определения TentBase.c:681
override void InitItemSounds()
Определения TentBase.c:833
Object m_ClutterCutter
Определения TentBase.c:36
ref map< ref ToggleAnimations, bool > m_ToggleAnimations
Определения TentBase.c:33
const int OPENING_5
Определения TentBase.c:8
void TentBase()
Определения TentBase.c:42
bool CanBePacked()
Определения TentBase.c:471
static const int PACKED
Определения TentBase.c:20
const int OPENING_10
Определения TentBase.c:13
void StopDeployLoopSound()
DEPRECATED.
bool ConditionIntoInventory(EntityAI player)
Определения TentBase.c:277
bool m_IsWindow
Определения TentBase.c:27
void RegenerateNavmesh()
Определения TentBase.c:793
override bool CanBePlaced(Man player, vector position)
Определения TentBase.c:970
bool m_IsBeingPacked
Определения TentBase.c:29
const int OPENING_3
Определения TentBase.c:6
void AnimateCamonetByOpeningSelection(string opening_selection)
Определения TentBase.c:783
override bool CanBeRepairedToPristine()
Определения TentBase.c:331
override bool IsDeployable()
Определения TentBase.c:818
void DestroyClutterCutter()
Определения TentBase.c:803
void ToggleAnimation(string selection)
Определения TentBase.c:697
void ~TentBase()
Определения TentBase.c:59
const int OPENING_8
Определения TentBase.c:11
bool m_IsFalling
Определения TentBase.c:40
int GetState()
Определения TentBase.c:461
Определения ObjectTyped.c:2
proto bool Write(void value_out)
proto bool Read(void value_in)
override string GetSoundClose()
Определения CarTent.c:31
override void AnimateCamonetToggle(ToggleAnimations toggle)
Определения PartyTent.c:129
override string GetClutterCutter()
Определения MediumTent.c:41
override string GetSoundOpen()
Определения CarTent.c:26
override string GetSoundCloseWindow()
Определения PartyTent.c:41
override void AnimateCamonetByOpeningSelection(string opening_selection)
Определения PartyTent.c:143
override void HandleCamoNetAttachment(bool hide)
Определения PartyTent.c:86
override bool HasClutterCutter()
Определения CarTent.c:36
override string GetSoundOpenWindow()
Определения PartyTent.c:36
Определения CarTent.c:2
int GetOpeningBit()
Определения ToggleSelections.c:28
string GetToggleOn()
Определения ToggleSelections.c:23
string GetToggleOff()
Определения ToggleSelections.c:18
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения Transport.c:70
static const vector Zero
Определения EnConvert.c:123
Определения EnConvert.c:119
Serializer ParamsReadContext
Определения gameplay.c:15
Serializer ParamsWriteContext
Определения gameplay.c:16
proto void Print(void var)
Prints content of variable to console/log.
const int STATE_RUINED
Определения 3_Game/DayZ/constants.c:909
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473
bool Contains(string sample)
Returns true if sample is substring of string.
Определения EnString.c:286
proto int ToLower()
Changes string to lowercase. Returns length.
const int CALL_CATEGORY_GAMEPLAY
Определения 3_Game/DayZ/tools/tools.c:10
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8
proto native int GetState()
returns one of STATE_...
Определения StaminaHandler.c:31