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;
47 RegisterNetSyncVariableInt(
"m_State");
48 RegisterNetSyncVariableBool(
"m_IsEntrance");
49 RegisterNetSyncVariableBool(
"m_IsWindow");
50 RegisterNetSyncVariableBool(
"m_IsToggle");
51 RegisterNetSyncVariableInt(
"m_OpeningMask");
52 RegisterNetSyncVariableBool(
"m_IsBeingPacked");
67 return "disableContainerDamage";
119 super.OnStoreSave(ctx);
127 if (!super.OnStoreLoad(ctx, version))
134 Print(
"ERROR: no opening mask found! Default openinng settings initialized.");
162 super.RefreshPhysics();
176 super.OnItemLocationChanged(old_owner, new_owner);
178 if (new_owner || old_owner)
180 if (GetInventory().CountInventory() == 1)
187 super.OnVariablesSynchronized();
213 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
219 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(
this,
m_HalfExtents);
221 if (zone !=
"Body" && zone !=
"Inventory" && zone !=
"")
226 DamageSystem.GetComponentNamesFromDamageZone(
this,zone,selections);
227 for (
int j = 0; j < selections.Count(); j++)
229 if (selections.Get(j) !=
"")
231 RemoveProxyPhysics(selections.Get(j));
249 string cfg_path =
"cfgVehicles " +
GetType() +
" AnimationSources";
251 if (
g_Game.ConfigIsExisting(cfg_path))
253 int selections =
g_Game.ConfigGetChildrenCount(cfg_path);
254 string proxy_selection_name;
256 for (
int i = 0; i < selections; i++)
258 string selection_name;
259 g_Game.ConfigGetChildName(cfg_path, i, selection_name);
262 SetAnimationPhase(selection_name, 1);
265 proxy_selection_name = selection_name;
266 proxy_selection_name.ToLower();
269 RemoveProxyPhysics(proxy_selection_name);
282 if (!super.IsTakeable())
290 if (!super.CanPutIntoHands(parent))
300 if (!super.CanPutInCargo(parent))
310 if (!super.CanRemoveFromCargo(parent))
318 if (!super.CanRemoveFromHands(parent))
341 m_CamoNet = CamoNet.Cast(GetInventory().FindAttachment(slot_id_camo));
344 eai_xlights = GetInventory().FindAttachment(slot_id_xlights);
351 if (!IsKindOf(
"MediumTent"))
353 AddProxyPhysics(
"camonet");
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);
369 super.EEItemAttached(item, slot_name);
371 if (item.IsKindOf (
"CamoNet"))
377 if (!IsKindOf (
"MediumTent"))
379 AddProxyPhysics(
"camonet");
383 if (item.IsKindOf (
"XmasLights"))
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);
391 XmasLights xlights = XmasLights.Cast(item);
392 xlights.AttachToObject(
this);
398 super.EEItemDetached(item, slot_name);
400 if (item.IsKindOf (
"CamoNet"))
406 if (!IsKindOf (
"MediumTent"))
408 RemoveProxyPhysics(
"camonet");
412 if (item.IsKindOf (
"XmasLights"))
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);
420 XmasLights xlights = XmasLights.Cast(item);
421 xlights.DetachFromObject(
this);
427 if (MemoryPointExists(
"invView2"))
430 GetInventory().GetCurrentInventoryLocation(il);
473 if (GetInventory().GetCargo().GetItemCount() == 0 && GetInventory().AttachmentCount() == 0)
496 if (item.IsKindOf (
"CamoNet") &&
GetState() == PITCHED)
520 GetInventory().LockInventory(HIDE_INV_FROM_SCRIPT);
529 if (
g_Game.IsServer() && !IsHologram())
530 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(
this,
m_HalfExtents);
536 GetOnViewIndexChanged().Invoke();
551 GetInventory().UnlockInventory(HIDE_INV_FROM_SCRIPT);
562 GetOnViewIndexChanged().Invoke();
568 if (GetHierarchyRootPlayer())
570 if (
g_Game.IsDedicatedServer())
583 string proxy_selection_name;
584 string animation_name;
592 SetAnimationPhase(animation_name, 0);
603 SetAnimationPhase(animation_name, 0);
610 string proxy_selection_name;
611 string animation_name;
619 proxy_selection_name = animation_name;
620 proxy_selection_name.ToLower();
621 AddProxyPhysics(proxy_selection_name);
632 proxy_selection_name = animation_name;
633 proxy_selection_name.ToLower();
634 AddProxyPhysics(proxy_selection_name);
652 toggle_off.ToLower();
656 if (toggle_off == selection || toggle_on == selection)
659 DamageSystem.GetDamageZoneFromComponentName(
this,selection,zone);
710 toggle_off.ToLower();
714 if (toggle_off == selection || toggle_on == selection)
727 if (selection.Contains(
"window"))
734 if (selection.Contains(
"entrance") || selection.Contains(
"door"))
753 if (selection.Contains(
"window"))
760 if (selection.Contains(
"entrance") || selection.Contains(
"door"))
776 SetAnimationPhase(
"CamoNet", hide);
793 SetAffectPathgraph(
true,
false);
823 super.OnPlacementComplete(player, position, orientation);
833 super.InitItemSounds();
838 handler.AddSound(SoundConstants.ITEM_TENT_OPEN,
GetSoundOpen());
841 handler.AddSound(SoundConstants.ITEM_TENT_CLOSE,
GetSoundClose());
874 DamageSystem.GetDamageZoneFromComponentName(
this,
component,zone);
908 DamageSystem.GetDamageZoneFromComponentName(
this,
component,zone);
909 is_ruined = (GetHealthLevel(zone) ==
GameConstants.STATE_RUINED);
915 if (!is_ruined &&
GetState() == PITCHED)
939 return super.CanReceiveItemIntoCargo(item);
944 if (!super.CanLoadItemIntoCargo(item))
957 return super.CanReceiveAttachment(attachment, slotId);
965 return super.CanLoadAttachment(attachment);
970 vector playerpos = player.GetPosition();
971 float delta1 = playerpos[1] - position[1];
973 if (delta1 > MAX_PLACEMENT_HEIGHT_DIFF || delta1 < -MAX_PLACEMENT_HEIGHT_DIFF)
eBleedingSourceType GetType()
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
ActionPackTentCB ActionContinuousBaseCB ActionPackTent()
void AddAction(typename actionName)
override string GetInvulnerabilityTypeString()
const int ECE_PLACE_ON_SURFACE
Wrapper class for managing sound through SEffectManager.
provides access to slot configuration
override int GetMeleeTargetType()
override void EEItemAttached(EntityAI item, string slot_name)
bool CanToggleAnimations(string selection)
override bool CanDisplayCargo()
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()
void SoundTentOpenPlay()
DEPRECATED.
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()
override bool CanRemoveFromHands(EntityAI parent)
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()
override bool CanDisplayAttachmentSlot(int slot_id)
override bool CanRemoveFromCargo(EntityAI parent)
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")
override bool CanDisplayAttachmentCategory(string category_name)
override bool IsTakeable()
void SoundTentCloseWindowPlay()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
ref map< ref ToggleAnimations, bool > m_ToggleAnimations
void StopDeployLoopSound()
DEPRECATED.
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)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Serializer ParamsReadContext
Serializer ParamsWriteContext
proto void Print(void var)
Prints content of variable to console/log.
vector GetPosition()
Get the world position of the Effect.
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
void StartItemSoundServer(int id, int slotId)
ItemSoundHandler GetItemSoundHandler()
bool m_FixDamageSystemInit
void ItemSoundHandler(ItemBase parent)
override bool HasClutterCutter()
override string GetSoundClose()
override string GetClutterCutter()
override string GetSoundOpen()
override string GetSoundCloseWindow()
override string GetSoundOpenWindow()
enum MagnumStableStateID init
bool GetState()
returns one of STATE_...
ref EffectSound m_DeployLoopSound
DEPRECATED.