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