Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
clothing_base.c
Go to the documentation of this file.
1
// I know the filename is stupid, but it's what the other files in this structure use..
2
// And I can't really make it "class Clothing_Base extends Clothing"
3
// since that will conflict with config and other parts of script and break mods :c
4
class
Clothing
extends
Clothing_Base
5
{
6
override
bool
IsClothing
()
7
{
8
return
true
;
9
}
10
11
override
bool
CanHaveWetness
()
12
{
13
return
true
;
14
}
15
17
int
GetGlassesEffectID
()
18
{
19
return
-1;
20
}
21
22
//----------------------------------------------------------------
23
// GameplayWidgetEffects
24
array<int>
GetEffectWidgetTypes
()
25
{
26
return
null;
27
}
28
29
// Conditions
30
override
bool
CanPutInCargo
(
EntityAI
parent )
31
{
32
if
( !super.CanPutInCargo( parent ) )
33
return
false
;
34
35
return
!parent ||
CanPutInCargoClothingConditions
( parent );
36
}
37
38
bool
CanPutInCargoClothingConditions
(
EntityAI
parent )
39
{
40
bool
is_hidden_stash_exception =
false
;
41
42
if
( parent.IsInherited( UndergroundStash ) )
43
is_hidden_stash_exception =
true
;
44
45
if
(
GetNumberOfItems
() == 0 || !parent || parent.
IsMan
() || is_hidden_stash_exception )
46
{
47
EntityAI
cargoParent = parent.GetHierarchyParent();
48
ClothingBase
parentClothing =
ClothingBase
.Cast(parent);
49
if
(cargoParent)
50
return
!(parent.IsClothing() && cargoParent.IsClothing()) || ( parentClothing && parentClothing.SmershException(cargoParent) );
51
52
return
true
;
53
}
54
55
return
false
;
56
}
57
58
override
bool
CanReceiveItemIntoCargo
(
EntityAI
item )
59
{
60
if
(!super.CanReceiveItemIntoCargo(item))
61
return
false
;
62
63
return
CanReceiveItemIntoCargoClothingConditions
( item );
64
}
65
66
bool
CanReceiveItemIntoCargoClothingConditions
(
EntityAI
item )
67
{
68
EntityAI
hierarchyParent = GetHierarchyParent();
69
return
!hierarchyParent || hierarchyParent.
IsMan
() ||
SmershException
(hierarchyParent);
70
}
71
72
//Kind of a hack but I don't have enough time left to do larger scale reworks, sorry
73
bool
SmershException
(
EntityAI
hierarchyParent)
74
{
75
EntityAI
hp = hierarchyParent.GetHierarchyParent();
76
if
(hp)
77
{
78
if
(!hp.
IsMan
() && !hp.IsZombie())
79
return
false
;
80
}
81
82
return
IsInherited(SmershBag) && hierarchyParent.IsInherited(SmershVest);
83
}
84
85
override
bool
CanLoadItemIntoCargo
(
EntityAI
item)
86
{
87
if
(!super.CanLoadItemIntoCargo(item))
88
return
false
;
89
90
return
CanLoadItemIntoCargoClothingConditions
(item);
91
}
92
93
bool
CanLoadItemIntoCargoClothingConditions
(
EntityAI
item)
94
{
95
EntityAI
parent = GetHierarchyParent();
96
97
if
( parent && parent.IsInherited( UndergroundStash ) )
98
return
true
;
99
100
return
!parent || parent.
IsMan
() || parent.IsZombie() ||
SmershException
(parent);
101
}
102
103
//Method used to specify if a piece of eyeware can be worn under a gas mask
105
bool
CanWearUnderMask
(
EntityAI
parent)
106
{
107
return
true
;
108
}
109
110
// -------------------------------------------------------------------------
111
override
void
EEHealthLevelChanged
(
int
oldLevel,
int
newLevel,
string
zone)
112
{
113
super.EEHealthLevelChanged(oldLevel, newLevel, zone);
114
if
( !
g_Game
.IsDedicatedServer() )
115
{
116
PlayerBase
player_owner =
PlayerBase
.Cast(GetHierarchyParent());
117
118
if
( player_owner )
119
{
120
if
( player_owner.m_CorpseState != 0 )
121
{
122
g_Game
.GetCallQueue(
CALL_CATEGORY_GUI
).CallLater( player_owner.UpdateCorpseState, 0,
false
);
123
}
124
}
125
}
126
}
127
128
override
void
SwitchItemSelectionTextureEx
(EItemManipulationContext context,
Param
par = null)
129
{
130
super.SwitchItemSelectionTextureEx(context, par);
131
132
Param1<PlayerBase> data = Param1<PlayerBase>.Cast(par);
133
if
(!data)
134
{
135
return
;
136
}
137
138
PlayerBase
player = data.param1;
139
140
int
personality = GetHiddenSelectionIndex(
"personality"
);
141
if
(personality >= 0)
142
{
143
string
tone_mat = player.m_EmptyGloves.GetHiddenSelectionsMaterials().Get(0);
144
string
tone_texture;
145
146
if
(player.m_CorpseState >
PlayerConstants
.
CORPSE_STATE_FRESH
)
147
{
148
tone_texture = player.m_DecayedTexture;
149
}
150
else
151
{
152
tone_texture = player.m_EmptyGloves.GetHiddenSelectionsTextures().Get(0);
153
}
154
155
SetObjectMaterial( personality, tone_mat );
156
SetObjectTexture( personality, tone_texture );
157
}
158
}
159
};
160
162
//intermediate types//
164
class
Belt_Base
:
Clothing
{};
165
class
Backpack_Base
:
Clothing
{};
166
class
Glasses_Base
:
Clothing
167
{
168
override
protected
void
InitGlobalExclusionValues
()
169
{
170
super.InitGlobalExclusionValues();
171
172
AddSingleExclusionValueGlobal(EAttExclusions.EXCLUSION_GLASSES_REGULAR_0);
173
}
174
};
175
class
Gloves_Base
:
Clothing
{};
176
class
HeadGear_Base
:
Clothing
{};
177
class
Mask_Base
:
Clothing
178
{
179
override
protected
set<int>
GetAttachmentExclusionInitSlotValue
(
int
slotId)
180
{
181
set<int> ret = super.GetAttachmentExclusionInitSlotValue(slotId);
182
if
(slotId ==
InventorySlots
.MASK)
183
{
184
ret.Insert(EAttExclusions.SHAVING_MASK_ATT_0);
185
}
186
return
ret;
187
}
188
};
189
class
Pants_Base
:
Clothing
{};
190
class
Shoes_Base
:
Clothing
{};
191
class
Top_Base
:
Clothing
{};
192
class
Vest_Base
:
Clothing
{};
193
194
typedef
Clothing
ClothingBase
;
Backpack_Base
Definition
alicebag_colorbase.c:1
Belt_Base
Definition
leatherbelt_colorbase.c:2
Clothing_Base
Definition
clothing_base.c:5
Clothing_Base::CanReceiveItemIntoCargoClothingConditions
bool CanReceiveItemIntoCargoClothingConditions(EntityAI item)
Definition
clothing_base.c:66
Clothing_Base::GetEffectWidgetTypes
array< int > GetEffectWidgetTypes()
Definition
clothing_base.c:24
Clothing_Base::CanHaveWetness
override bool CanHaveWetness()
Definition
clothing_base.c:11
Clothing_Base::CanReceiveItemIntoCargo
override bool CanReceiveItemIntoCargo(EntityAI item)
Definition
clothing_base.c:58
Clothing_Base::CanLoadItemIntoCargo
override bool CanLoadItemIntoCargo(EntityAI item)
Definition
clothing_base.c:85
Clothing_Base::CanLoadItemIntoCargoClothingConditions
bool CanLoadItemIntoCargoClothingConditions(EntityAI item)
Definition
clothing_base.c:93
Clothing_Base::CanPutInCargoClothingConditions
bool CanPutInCargoClothingConditions(EntityAI parent)
Definition
clothing_base.c:38
Clothing_Base::SmershException
bool SmershException(EntityAI hierarchyParent)
Definition
clothing_base.c:73
Clothing_Base::EEHealthLevelChanged
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
Definition
clothing_base.c:111
Clothing_Base::CanPutInCargo
override bool CanPutInCargo(EntityAI parent)
Definition
clothing_base.c:30
Clothing_Base::GetGlassesEffectID
int GetGlassesEffectID()
Used for 'glasses' (and other colored layers triggered by attach/detach in the InventorySlots....
Definition
clothing_base.c:17
Clothing_Base::CanWearUnderMask
bool CanWearUnderMask(EntityAI parent)
deprecated
Definition
clothing_base.c:105
Clothing_Base::SwitchItemSelectionTextureEx
override void SwitchItemSelectionTextureEx(EItemManipulationContext context, Param par=null)
Definition
clothing_base.c:128
Clothing_Base::IsClothing
override bool IsClothing()
Definition
clothing_base.c:6
ClothingBase
Definition
dallasmask.c:2
Clothing
Definition
armband_colorbase.c:2
EntityAI
Definition
inventoryitem.c:2
EntityAI::IsMan
override bool IsMan()
Definition
man.c:48
Glasses_Base
Definition
aviatorglasses.c:2
Glasses_Base::InitGlobalExclusionValues
void InitGlobalExclusionValues()
Definition
clothing_base.c:168
Gloves_Base
Definition
handscover_improvised.c:2
HeadGear_Base
hard helmet base
Definition
baseballcap_colorbase.c:2
InventorySlots
provides access to slot configuration
Definition
inventoryslots.c:6
Mask_Base
gas mask base
Definition
balaclava3holes_colorbase.c:2
Mask_Base::GetAttachmentExclusionInitSlotValue
set< int > GetAttachmentExclusionInitSlotValue(int slotId)
Definition
clothing_base.c:179
Pants_Base
Definition
bdupants.c:2
Param
Base Param Class with no parameters.
Definition
param.c:12
PlayerBase
Definition
playerbaseclient.c:2
PlayerConstants
Definition
playerconstants.c:2
PlayerConstants::CORPSE_STATE_FRESH
static const int CORPSE_STATE_FRESH
Definition
playerconstants.c:213
Shoes_Base
Definition
athleticshoes_colorbase.c:1
Top_Base
Definition
bdujacket.c:2
Vest_Base
Definition
chestholster.c:1
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
ClothingBase
Clothing ClothingBase
Definition
clothing_base.c:194
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
CALL_CATEGORY_GUI
const int CALL_CATEGORY_GUI
Definition
tools.c:9
GetNumberOfItems
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
Definition
itembase.c:8462
Games
Dayz
scripts
4_world
entities
itembase
clothing_base.c
Generated by
1.17.0