Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
kitbase.c
Go to the documentation of this file.
1
class
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
25
UpdateVisuals
();
26
UpdatePhysics
();
27
28
if
(
g_Game
.IsServer())
29
{
30
g_Game
.GetCallQueue(
CALL_CATEGORY_GAMEPLAY
).Call(
AssembleKit
);
31
}
32
}
33
34
override
bool
DisassembleOnLastDetach
()
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
(
g_Game
.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
62
UpdatePhysics
();
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
81
override
bool
CanAssignAttachmentsToQuickbar
()
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
100
UpdatePhysics
();
101
}
102
103
//Update visuals and physics
104
void
UpdateVisuals
()
105
{
106
SetAnimationPhase(
"Inventory"
, 0 );
107
SetAnimationPhase(
"Placing"
, 1 );
108
}
109
110
void
UpdatePhysics
()
111
{
112
AddProxyPhysics(
"Inventory"
);
113
RemoveProxyPhysics(
"Placing"
);
114
}
115
116
void
AssembleKit
()
117
{
118
if
(!
IsHologram
())
119
{
120
Rope rope = Rope.Cast(GetInventory().CreateAttachment(
"Rope"
));
121
}
122
}
123
124
void
DisassembleKit
(
ItemBase
item) {}
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(
g_Game
.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
150
AddAction
(
ActionTogglePlaceObject
);
151
AddAction
(
ActionDeployObject
);
152
}
153
155
protected
ref
EffectSound
m_DeployLoopSound
;
//DEPRECATED in favor of m_DeployLoopSoundEx
156
157
void
PlayDeployLoopSound
();
158
void
StopDeployLoopSound
();
159
}
ActionDeployObject
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
Definition
actiondeployobject.c:9
AddAction
void AddAction(typename actionName)
Definition
advancedcommunication.c:220
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition
centraleconomy.c:37
ActionTogglePlaceObject
Definition
actiontoggleplaceobject.c:2
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition
effectsound.c:5
EntityAI
Definition
inventoryitem.c:2
InventoryLocation
InventoryLocation.
Definition
inventorylocation.c:30
InventoryLocation::GetType
proto native int GetType()
returns type of InventoryLocation
ItemBase
Definition
inventoryitem.c:742
ItemBase::AssembleKit
void AssembleKit()
Definition
kitbase.c:116
ItemBase::OnItemLocationChanged
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition
kitbase.c:57
ItemBase::GetDeploySoundset
override string GetDeploySoundset()
Definition
kitbase.c:86
ItemBase::CanProxyObstruct
override bool CanProxyObstruct()
Definition
kitbase.c:15
ItemBase::GetLoopDeploySoundset
override string GetLoopDeploySoundset()
Definition
kitbase.c:91
ItemBase::IsBasebuildingKit
override bool IsBasebuildingKit()
Definition
kitbase.c:5
ItemBase::PlayDeployLoopSound
void PlayDeployLoopSound()
ItemBase::UpdateVisuals
void UpdateVisuals()
Definition
kitbase.c:104
ItemBase::StopDeployLoopSound
void StopDeployLoopSound()
DEPRECATED.
ItemBase::EEInit
override void EEInit()
Definition
kitbase.c:20
ItemBase::RefreshPhysics
override void RefreshPhysics()
Definition
kitbase.c:96
ItemBase::EEItemDetached
override void EEItemDetached(EntityAI item, string slot_name)
Definition
kitbase.c:39
ItemBase::OnPlacementCancelled
override void OnPlacementCancelled(Man player)
Definition
kitbase.c:70
ItemBase::HasProxyParts
override bool HasProxyParts()
Definition
kitbase.c:10
ItemBase::CanAssignAttachmentsToQuickbar
override bool CanAssignAttachmentsToQuickbar()
Definition
kitbase.c:81
ItemBase::DisassembleOnLastDetach
override bool DisassembleOnLastDetach()
Definition
kitbase.c:34
ItemBase::m_DeployedRegularly
bool m_DeployedRegularly
Definition
kitbase.c:3
ItemBase::IsDeployable
override bool IsDeployable()
Definition
kitbase.c:76
ItemBase::OnEndPlacement
override void OnEndPlacement()
Definition
kitbase.c:65
ItemBase::UpdatePhysics
void UpdatePhysics()
Definition
kitbase.c:110
ItemBase::CreateRope
void CreateRope(Rope rope)
Definition
kitbase.c:126
ItemBase::DisassembleKit
void DisassembleKit(ItemBase item)
Definition
kitbase.c:124
ItemBase::SetActions
override void SetActions()
Definition
kitbase.c:146
KitBase
Definition
fencekit.c:2
KitBase::DisassembleKit
override void DisassembleKit(ItemBase item)
Definition
fencekit.c:46
PlayerBase
Definition
playerbaseclient.c:2
UpdateVisuals
void UpdateVisuals()
Definition
construction.c:188
UpdatePhysics
void UpdatePhysics()
Definition
construction.c:207
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
GetPosition
vector GetPosition()
Get the world position of the Effect.
Definition
effect.c:473
CALL_CATEGORY_GAMEPLAY
const int CALL_CATEGORY_GAMEPLAY
Definition
tools.c:10
InventoryLocationType
InventoryLocationType
types of Inventory Location
Definition
inventorylocation.c:4
IsHologram
override bool IsHologram()
Definition
itembase.c:5885
m_DeployLoopSound
ref EffectSound m_DeployLoopSound
DEPRECATED.
Definition
trapbase.c:682
Games
Dayz
scripts
4_world
entities
itembase
kitbase.c
Generated by
1.17.0