Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
kitbase.c
Go to the documentation of this file.
1class KitBase extends ItemBase
2{
3 protected bool m_DeployedRegularly;
4
5 override bool IsBasebuildingKit()
6 {
7 return true;
8 }
9
10 override bool HasProxyParts()
11 {
12 return true;
13 }
14
15 override bool CanProxyObstruct()
16 {
17 return false;
18 }
19
20 override void EEInit()
21 {
22 super.EEInit();
23
24 //set visual on init
27
28 if (GetGame().IsServer())
29 {
30 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).Call( AssembleKit );
31 }
32 }
33
35 {
36 return true;
37 }
38
39 override void EEItemDetached(EntityAI item, string slot_name)
40 {
41 super.EEItemDetached( item, slot_name );
42
43 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
44 if ( player && player.IsPlayerDisconnected() )
45 return;
46
47 if (item && slot_name == "Rope")
48 {
49 if (GetGame().IsServer() && !m_DeployedRegularly)
50 {
51 DisassembleKit(ItemBase.Cast(item));
52 Delete();
53 }
54 }
55 }
56
57 override void OnItemLocationChanged( EntityAI old_owner, EntityAI new_owner )
58 {
59 super.OnItemLocationChanged( old_owner, new_owner );
60
61 //update visuals after location change
63 }
64
65 override void OnEndPlacement()
66 {
67 m_DeployedRegularly = true;
68 }
69
70 override void OnPlacementCancelled( Man player )
71 {
72 super.OnPlacementCancelled(player);
73 m_DeployedRegularly = false;
74 }
75
76 override bool IsDeployable()
77 {
78 return true;
79 }
80
82 {
83 return false;
84 }
85
86 override string GetDeploySoundset()
87 {
88 return "putDown_FenceKit_SoundSet";
89 }
90
91 override string GetLoopDeploySoundset()
92 {
93 return "Shelter_Site_Build_Loop_SoundSet";
94 }
95
96 override void RefreshPhysics()
97 {
98 super.RefreshPhysics();
99
101 }
102
103 //Update visuals and physics
105 {
106 SetAnimationPhase( "Inventory", 0 );
107 SetAnimationPhase( "Placing", 1 );
108 }
109
111 {
112 AddProxyPhysics( "Inventory" );
113 RemoveProxyPhysics( "Placing" );
114 }
115
117 {
118 if (!IsHologram())
119 {
120 Rope rope = Rope.Cast(GetInventory().CreateAttachment("Rope"));
121 }
122 }
123
125
126 void CreateRope(Rope rope)
127 {
128 if (!rope)
129 return;
130
131 InventoryLocation targetLoc = rope.GetTargetLocation();
132 if (targetLoc && targetLoc.GetType() != InventoryLocationType.GROUND)
133 {
134 MiscGameplayFunctions.TransferItemProperties(this, rope);
135 return;
136 }
137
138 EntityAI newRope = EntityAI.Cast(GetGame().CreateObjectEx(rope.GetType(), GetPosition(), ECE_PLACE_ON_SURFACE));
139
140 if (newRope)
141 MiscGameplayFunctions.TransferItemProperties(this, newRope);
142
143 rope.Delete();
144 }
145
146 override void SetActions()
147 {
148 super.SetActions();
149
152 }
153
155 protected ref EffectSound m_DeployLoopSound; //DEPRECATED in favor of m_DeployLoopSoundEx
156
159}
void AddAction(typename actionName)
const int ECE_PLACE_ON_SURFACE
Wrapper class for managing sound through SEffectManager.
Definition effectsound.c:5
InventoryLocation.
void UpdateVisuals()
Definition kitbase.c:104
override bool IsBasebuildingKit()
Definition kitbase.c:5
bool m_DeployedRegularly
Definition kitbase.c:3
override bool HasProxyParts()
Definition kitbase.c:10
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition kitbase.c:57
void PlayDeployLoopSound()
override void SetActions()
Definition kitbase.c:146
void CreateRope(Rope rope)
Definition kitbase.c:126
void DisassembleKit(ItemBase item)
Definition kitbase.c:124
override bool DisassembleOnLastDetach()
Definition kitbase.c:34
override string GetDeploySoundset()
Definition kitbase.c:86
override bool CanAssignAttachmentsToQuickbar()
Definition kitbase.c:81
override void OnPlacementCancelled(Man player)
Definition kitbase.c:70
override void EEItemDetached(EntityAI item, string slot_name)
Definition kitbase.c:39
override void RefreshPhysics()
Definition kitbase.c:96
override void EEInit()
Definition kitbase.c:20
void AssembleKit()
Definition kitbase.c:116
void UpdatePhysics()
Definition kitbase.c:110
override string GetLoopDeploySoundset()
Definition kitbase.c:91
override bool CanProxyObstruct()
Definition kitbase.c:15
void StopDeployLoopSound()
DEPRECATED.
override bool IsDeployable()
Definition kitbase.c:76
override void OnEndPlacement()
Definition kitbase.c:65
void UpdateVisuals()
void UpdatePhysics()
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10
InventoryLocationType
types of Inventory Location
ref EffectSound m_DeployLoopSound
DEPRECATED.
Definition trapbase.c:692