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;
20 static const int PACKED = 0;
21 static const int PITCHED = 1;
22 const float MAX_PLACEMENT_HEIGHT_DIFF = 1.5;
25 protected int m_StateLocal = -1;
29 protected bool m_IsBeingPacked =
false;
30 protected int m_OpeningMask = 0;
31 protected int m_OpeningMaskLocal = -1;
48 RegisterNetSyncVariableInt(
"m_State");
49 RegisterNetSyncVariableBool(
"m_IsSoundSynchRemote");
50 RegisterNetSyncVariableBool(
"m_IsEntrance");
51 RegisterNetSyncVariableBool(
"m_IsWindow");
52 RegisterNetSyncVariableBool(
"m_IsToggle");
53 RegisterNetSyncVariableBool(
"m_IsDeploySound");
54 RegisterNetSyncVariableInt(
"m_OpeningMask");
55 RegisterNetSyncVariableBool(
"m_IsBeingPacked");
63 DestroyClutterCutter();
70 return "disableContainerDamage";
104 ctx.Write(m_OpeningMask);
109 if (!
super.OnStoreLoad(
ctx, version))
115 if (!
ctx.Read(m_OpeningMask))
116 Print(
"ERROR: no opening mask found! Default openinng settings initialized.");
131 RefreshAttachements();
142 super.RefreshPhysics();
145 TryPitch(
false,
true);
156 if (GetInventory().CountInventory() == 1)
163 super.OnVariablesSynchronized();
176 SoundTentClosePlay();
181 SoundTentOpenWindowPlay();
183 SoundTentCloseWindowPlay();
204 if ((m_OpeningMaskLocal != m_OpeningMask))
206 HandleOpeningsPhysics();
207 m_OpeningMaskLocal = m_OpeningMask;
226 if (
zone !=
"Body" &&
zone !=
"Inventory" &&
zone !=
"")
276 return CanBeManipulated();
281 if (!
super.CanPutIntoHands(parent))
284 return CanBeManipulated();
289 if (!
super.CanPutInCargo(parent))
292 return CanBeManipulated();
297 return CanBeManipulated();
322 if (!IsKindOf(
"MediumTent"))
323 AddProxyPhysics(
"camonet");
328 SetAnimationPhase(
"Xlights", 0);
329 SetAnimationPhase(
"Xlights_glass_r", 0);
330 SetAnimationPhase(
"Xlights_glass_g", 0);
331 SetAnimationPhase(
"Xlights_glass_b", 0);
332 SetAnimationPhase(
"Xlights_glass_y", 0);
340 if (
item.IsKindOf(
"CamoNet"))
346 if (!IsKindOf(
"MediumTent"))
347 AddProxyPhysics(
"camonet");
350 if (
item.IsKindOf(
"XmasLights"))
352 SetAnimationPhase(
"Xlights", 0);
353 SetAnimationPhase(
"Xlights_glass_r", 0);
354 SetAnimationPhase(
"Xlights_glass_g", 0);
355 SetAnimationPhase(
"Xlights_glass_b", 0);
356 SetAnimationPhase(
"Xlights_glass_y", 0);
367 if (
item.IsKindOf(
"CamoNet"))
373 if (!IsKindOf(
"MediumTent"))
374 RemoveProxyPhysics(
"camonet");
377 if (
item.IsKindOf(
"XmasLights"))
379 SetAnimationPhase(
"Xlights", 1);
380 SetAnimationPhase(
"Xlights_glass_r", 1);
381 SetAnimationPhase(
"Xlights_glass_g", 1);
382 SetAnimationPhase(
"Xlights_glass_b", 1);
383 SetAnimationPhase(
"Xlights_glass_y", 1);
386 xlights.DetachFromObject(
this);
392 if (MemoryPointExists(
"invView2"))
395 GetInventory().GetCurrentInventoryLocation(
il);
438 if (GetInventory().GetCargo().GetItemCount() == 0 && GetInventory().AttachmentCount() == 0)
468 HideAllAnimationsAndProxyPhysics();
471 m_IsEntrance = PACKED;
482 DestroyClutterCutter();
490 GetOnViewIndexChanged().Invoke();
495 HideAllAnimationsAndProxyPhysics();
498 m_IsEntrance = PITCHED;
499 m_IsWindow = PITCHED;
500 m_IsToggle = PITCHED;
512 GetOnViewIndexChanged().Invoke();
517 if (GetHierarchyRootPlayer())
519 if (
GetGame().IsDedicatedServer())
535 for (
int i = 0;
i < m_ShowAnimationsWhenPitched.Count();
i++)
542 HandleOpeningsVisuals();
546 for (
int j = 0;
j < m_ShowAnimationsWhenPacked.Count();
j++)
562 for (
int i = 0;
i < m_ShowAnimationsWhenPitched.Count();
i++)
575 for (
int j = 0;
j < m_ShowAnimationsWhenPacked.Count();
j++)
595 for (
int i = 0;
i < m_ToggleAnimations.Count();
i++)
616 m_IsEntrance =
false;
650 for (
int i = 0;
i < m_ToggleAnimations.Count();
i++)
664 SetAnimationPhase(
toggle.GetToggleOff(), 0);
665 AddProxyPhysics(
toggle.GetToggleOff());
666 SetAnimationPhase(
toggle.GetToggleOn(), 1);
667 RemoveProxyPhysics(
toggle.GetToggleOn());
668 m_ToggleAnimations.Set(
toggle,
false);
670 m_OpeningMask &=
~toggle.GetOpeningBit();
676 ManipulateEntrance();
682 SetAnimationPhase(
toggle.GetToggleOff(), 1);
683 RemoveProxyPhysics(
toggle.GetToggleOff());
684 SetAnimationPhase(
toggle.GetToggleOn(), 0);
685 AddProxyPhysics(
toggle.GetToggleOn());
686 m_ToggleAnimations.Set(
toggle,
true);
688 m_OpeningMask |=
toggle.GetOpeningBit();
694 ManipulateEntrance();
706 SetAnimationPhase(
"CamoNet",
hide);
724 sound.SetAutodestroy(
true);
730 sound.SetAutodestroy(
true);
736 sound.SetAutodestroy(
true);
742 sound.SetAutodestroy(
true);
747 SetAffectPathgraph(
true,
false);
787 if (!
GetGame().IsDedicatedServer())
796 if (!
GetGame().IsDedicatedServer())
821 for (
int i = 0;
i < m_ToggleAnimations.Count();
i++)
823 toggle = m_ToggleAnimations.GetKey(
i);
832 SetAnimationPhase(
toggle.GetToggleOff(), 1);
834 m_ToggleAnimations.Set(
toggle,
false);
838 SetAnimationPhase(
toggle.GetToggleOn(), 1);
840 m_ToggleAnimations.Set(
toggle,
true);
855 for (
int i = 0;
i < m_ToggleAnimations.Count();
i++)
857 toggle = m_ToggleAnimations.GetKey(
i);
865 RemoveProxyPhysics(
toggle.GetToggleOff());
866 RemoveProxyPhysics(
toggle.GetToggleOn());
871 AddProxyPhysics(
toggle.GetToggleOn());
873 AddProxyPhysics(
toggle.GetToggleOff());
888 return super.CanReceiveItemIntoCargo(
item);
922 if (
delta1 > MAX_PLACEMENT_HEIGHT_DIFF ||
delta1 < -MAX_PLACEMENT_HEIGHT_DIFF)
eBleedingSourceType GetType()
ActionPackTentCB ActionContinuousBaseCB ActionPackTent()
void AddAction(typename actionName)
override string GetInvulnerabilityTypeString()
const int ECE_PLACE_ON_SURFACE
Container_Base m_HalfExtents
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
void SetIsDeploySound(bool is_deploy_sound)
bool CanPlayDeployLoopSound()
override bool IsHologram()
bool m_FixDamageSystemInit
bool IsSoundSynchRemote()
enum MagnumStableStateID init
void PlayDeployLoopSound()
void StopDeployLoopSound()
ref EffectSound m_DeployLoopSound
class JsonUndergroundAreaTriggerData GetPosition
Wrapper class for managing sound through SEffectManager.
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
override int GetMeleeTargetType()
override void EEItemAttached(EntityAI item, string slot_name)
bool CanToggleAnimations(string selection)
bool IsManipulatedWindow()
bool CanAttach(ItemBase item)
void HandleOpeningsPhysics()
void SoundTentClosePlay()
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
void HandleOpeningsVisuals()
bool IsManipulatedEntrance()
override int GetViewIndex()
override bool CanProxyObstructSelf()
prevents showing cargo when outside the tent geometry
override bool HasProxyParts()
override bool CanBeRepairedByCrafting()
bool ConditionOutOfHands(EntityAI player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
string GetSoundCloseWindow()
override bool CanPutIntoHands(EntityAI parent)
void PlayDeployLoopSound()
override bool IsItemTent()
override void SetActions()
void HideAllAnimationsAndProxyPhysics(bool hide_animations=true, bool hide_physics=true)
override string GetInvulnerabilityTypeString()
override bool CanLoadAttachment(EntityAI attachment)
string GetClutterCutter()
override int GetDamageSystemVersionChange()
ref array< string > m_ShowAnimationsWhenPacked
string GetSoundOpenWindow()
void Pack(bool update_navmesh, bool init=false)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
void Pitch(bool update_navmesh, bool init=false)
void SoundTentOpenWindowPlay()
override bool CanLoadItemIntoCargo(EntityAI item)
void ManipulateEntrance()
void HandleCamoNetAttachment(bool hide)
override void EEItemDetached(EntityAI item, string slot_name)
void AnimateCamonetToggle(ToggleAnimations toggle)
override void OnVariablesSynchronized()
override void RefreshPhysics()
void SetIsBeingPacked(bool isBeingPacked)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
void RefreshAttachements()
ref array< string > m_ShowAnimationsWhenPitched
void TryPitch(bool update_navmesh, bool init=false)
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
void SoundTentCloseWindowPlay()
override bool IsIgnoredByConstruction()
ref map< ref ToggleAnimations, bool > m_ToggleAnimations
void StopDeployLoopSound()
bool ConditionIntoInventory(EntityAI player)
override bool CanBePlaced(Man player, vector position)
void AnimateCamonetByOpeningSelection(string opening_selection)
override bool CanBeRepairedToPristine()
override bool IsDeployable()
void DestroyClutterCutter()
void ToggleAnimation(string selection)
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Serialization general interface. Serializer API works with:
override string GetSoundClose()
override void AnimateCamonetToggle(ToggleAnimations toggle)
override string GetClutterCutter()
override string GetSoundOpen()
override string GetSoundCloseWindow()
override void AnimateCamonetByOpeningSelection(string opening_selection)
override void HandleCamoNetAttachment(bool hide)
override bool HasClutterCutter()
override string GetSoundOpenWindow()
override string GetLoopDeploySoundset()
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
bool Contains(string sample)
Returns true if sample is substring of string.
proto native int GetState()
returns one of STATE_...