Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_SecondaryExplosions.c
Go to the documentation of this file.
1
//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
2
// TODO: Separate file
4
enum
SCR_ESecondaryExplosionType
5
{
6
DEFAULT
,
7
FUEL
,
8
AMMO
,
9
TIRE
,
10
BATTERY
,
11
RESOURCE
12
}
13
15
enum
SCR_ESecondaryExplosionScale
16
{
17
NONE
,
18
SMALL
,
19
MEDIUM
,
20
LARGE
,
21
MASSIVE
22
}
23
//---- REFACTOR NOTE END ----
24
25
[
BaseContainerProps
(configRoot:
true
)]
26
class
SCR_SecondaryExplosions
27
{
28
[
Attribute
()]
29
protected
ref array<ref SCR_SecondaryExplosionType> m_aSecondaryExplosionTypes;
30
31
//------------------------------------------------------------------------------------------------
32
SCR_SecondaryExplosion
GetSecondaryExplosionForScale
(SCR_ESecondaryExplosionScale
scale
,
SCR_ESecondaryExplosionType
explosionType,
EResourceType
resourceType =
EResourceType
.INVALID)
33
{
34
foreach
(
SCR_SecondaryExplosionType
explosions : m_aSecondaryExplosionTypes)
35
{
36
if
(explosions.GetExplosionType() != explosionType)
37
continue
;
38
39
if
(explosionType ==
SCR_ESecondaryExplosionType
.RESOURCE && explosions.GetResourceType() != resourceType)
40
continue
;
41
42
return
explosions.GetSecondaryExplosionForScale(
scale
);
43
}
44
45
return
null;
46
}
47
48
//------------------------------------------------------------------------------------------------
49
SCR_ESecondaryExplosionScale
GetSecondaryExplosionScale
(
float
value,
SCR_ESecondaryExplosionType
explosionType,
EResourceType
resourceType =
EResourceType
.INVALID)
50
{
51
foreach
(SCR_SecondaryExplosionType explosions : m_aSecondaryExplosionTypes)
52
{
53
if
(explosionType ==
SCR_ESecondaryExplosionType
.RESOURCE && explosions.GetResourceType() != resourceType)
54
continue
;
55
56
if
(explosions.GetExplosionType() != explosionType)
57
continue
;
58
59
return
explosions.GetSecondaryExplosionScale(value);
60
}
61
62
return
SCR_ESecondaryExplosionScale.NONE;
63
}
64
65
//------------------------------------------------------------------------------------------------
66
ResourceName
GetExplosionPrefab
(
float
value,
SCR_ESecondaryExplosionType
explosionType,
EResourceType
resourceType =
EResourceType
.INVALID)
67
{
68
foreach
(SCR_SecondaryExplosionType explosions : m_aSecondaryExplosionTypes)
69
{
70
if
(explosionType ==
SCR_ESecondaryExplosionType
.RESOURCE && explosions.GetResourceType() != resourceType)
71
continue
;
72
73
if
(explosions.GetExplosionType() != explosionType)
74
continue
;
75
76
return
explosions.GetExplosionPrefab(value);
77
}
78
return
ResourceName.Empty;
79
}
80
81
//------------------------------------------------------------------------------------------------
82
ResourceName
GetFireParticles
(
float
value,
SCR_ESecondaryExplosionType
explosionType,
EResourceType
resourceType =
EResourceType
.INVALID)
83
{
84
foreach
(SCR_SecondaryExplosionType explosions : m_aSecondaryExplosionTypes)
85
{
86
if
(explosionType ==
SCR_ESecondaryExplosionType
.RESOURCE && explosions.GetResourceType() != resourceType)
87
continue
;
88
89
if
(explosions.GetExplosionType() != explosionType)
90
continue
;
91
92
return
explosions.GetFireParticles(value);
93
}
94
return
ResourceName.Empty;
95
}
96
}
97
98
[
BaseContainerProps
(), SCR_SecondaryExplosionTypeContainerTitle()]
99
class
SCR_SecondaryExplosionType
100
{
101
[
Attribute
(defvalue:
SCR_Enum
.GetDefault(
SCR_ESecondaryExplosionType
.DEFAULT), uiwidget:
UIWidgets
.ComboBox, enums: ParamEnumArray.FromEnum(
SCR_ESecondaryExplosionType
))]
102
protected
SCR_ESecondaryExplosionType
m_eSecondaryExplosionType
;
103
104
[
Attribute
(defvalue:
SCR_Enum
.GetDefault(
EResourceType
.INVALID), uiwidget:
UIWidgets
.ComboBox, enums: ParamEnumArray.FromEnum(
EResourceType
))]
105
protected
EResourceType
m_eResourceType
;
106
107
[
Attribute
()]
108
protected
ref array<ref SCR_SecondaryExplosion>
m_aSecondaryExplosions
;
109
110
//------------------------------------------------------------------------------------------------
111
SCR_ESecondaryExplosionType
GetExplosionType
()
112
{
113
return
m_eSecondaryExplosionType
;
114
}
115
116
//------------------------------------------------------------------------------------------------
117
EResourceType
GetResourceType
()
118
{
119
return
m_eResourceType
;
120
}
121
122
//------------------------------------------------------------------------------------------------
123
SCR_SecondaryExplosion
GetSecondaryExplosionForScale
(SCR_ESecondaryExplosionScale
scale
)
124
{
125
foreach
(
SCR_SecondaryExplosion
explosion :
m_aSecondaryExplosions
)
126
{
127
if
(
scale
== explosion.m_eSecondaryExplosionScale)
128
return
explosion;
129
}
130
131
return
null;
132
}
133
134
//------------------------------------------------------------------------------------------------
135
SCR_ESecondaryExplosionScale
GetSecondaryExplosionScale
(
float
value)
136
{
137
SCR_ESecondaryExplosionScale
scale
;
138
float
topValue;
139
140
foreach
(
SCR_SecondaryExplosion
explosion :
m_aSecondaryExplosions
)
141
{
142
if
(value < explosion.m_fMinValue)
143
continue
;
144
145
if
(topValue > explosion.m_fMinValue)
146
continue
;
147
148
topValue = explosion.m_fMinValue;
149
scale
= explosion.m_eSecondaryExplosionScale;
150
}
151
152
return
scale
;
153
}
154
155
//------------------------------------------------------------------------------------------------
156
ResourceName
GetExplosionPrefab
(
float
value)
157
{
158
ResourceName
prefab;
159
float
topValue;
160
161
foreach
(
SCR_SecondaryExplosion
explosion :
m_aSecondaryExplosions
)
162
{
163
if
(value < explosion.m_fMinValue)
164
continue
;
165
166
if
(topValue > explosion.m_fMinValue)
167
continue
;
168
169
topValue = explosion.m_fMinValue;
170
prefab = explosion.m_sSecondaryExplosionPrefab;
171
}
172
173
return
prefab;
174
}
175
176
//------------------------------------------------------------------------------------------------
177
ResourceName
GetFireParticles
(
float
value)
178
{
179
ResourceName
particles;
180
float
topValue;
181
182
foreach
(
SCR_SecondaryExplosion
explosion :
m_aSecondaryExplosions
)
183
{
184
if
(value < explosion.m_fMinValue)
185
continue
;
186
187
if
(topValue > explosion.m_fMinValue)
188
continue
;
189
190
topValue = explosion.m_fMinValue;
191
particles = explosion.m_sSecondaryFireParticles;
192
}
193
194
return
particles;
195
}
196
}
197
198
class
SCR_SecondaryExplosionTypeContainerTitle :
BaseContainerCustomTitle
199
{
200
//------------------------------------------------------------------------------------------------
201
override
bool
_WB_GetCustomTitle
(BaseContainer source, out
string
title)
202
{
203
SCR_ESecondaryExplosionType
type
;
204
if
(!source.Get(
"m_eSecondaryExplosionType"
,
type
))
205
return
false
;
206
207
title =
"Type: "
+
SCR_Enum
.GetEnumName(
SCR_ESecondaryExplosionType
,
type
);
208
return
true
;
209
}
210
}
211
212
[
BaseContainerProps
(), SCR_SecondaryExplosionContainerTitle()]
213
class
SCR_SecondaryExplosion
214
{
215
[
Attribute
()]
216
float
m_fMinValue;
217
218
[
Attribute
(defvalue:
SCR_Enum
.GetDefault(SCR_ESecondaryExplosionScale.NONE), uiwidget:
UIWidgets
.ComboBox, enums: ParamEnumArray.FromEnum(SCR_ESecondaryExplosionScale))]
219
SCR_ESecondaryExplosionScale
m_eSecondaryExplosionScale
;
220
221
[
Attribute
(
desc
:
"Explosion prefab"
,
UIWidgets
.ResourcePickerThumbnail,
params
:
"et"
)]
222
ResourceName
m_sSecondaryExplosionPrefab
;
223
224
[
Attribute
(
desc
:
"Fire particles"
,
UIWidgets
.ResourcePickerThumbnail,
params
:
"ptc"
)]
225
ResourceName
m_sSecondaryFireParticles
;
226
}
227
228
class
SCR_SecondaryExplosionContainerTitle :
BaseContainerCustomTitle
229
{
230
//------------------------------------------------------------------------------------------------
231
override
bool
_WB_GetCustomTitle
(BaseContainer source, out
string
title)
232
{
233
float
minValue;
234
if
(source.Get(
"m_fMinValue"
, minValue))
235
title = minValue.ToString(-1, 3);
236
237
SCR_ESecondaryExplosionScale state;
238
if
(source.Get(
"m_eSecondaryExplosionScale"
, state))
239
title +=
" - fire state: "
+
SCR_Enum
.GetEnumName(SCR_ESecondaryExplosionScale, state);
240
241
return
true
;
242
}
243
}
scale
vector scale
Definition
BlenderEndpoints.c:50
FUEL
@ FUEL
Definition
ESupportStationType.c:7
AMMO
@ AMMO
Definition
InventoryConstants.c:37
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
MEDIUM
enum SCR_EAITalkRequestState MEDIUM
Definition
SCR_DamageIntensityHolder.c:6
GetSecondaryExplosionForScale
SCR_SecondaryExplosion GetSecondaryExplosionForScale(SCR_ESecondaryExplosionScale scale, SCR_ESecondaryExplosionType explosionType, EResourceType resourceType=EResourceType.SUPPLIES)
Determine secondary explosion prefab based on explosion scale, type and resource type if defined.
Definition
SCR_DamageManagerComponent.c:990
type
EDamageType type
Definition
SCR_DestructibleTreeV2.c:32
GetSecondaryExplosionScale
override float GetSecondaryExplosionScale()
Definition
SCR_FlammableHitZone.c:785
EResourceType
EResourceType
Definition
SCR_ResourceContainer.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
SCR_ESecondaryExplosionType
SCR_ESecondaryExplosionType
Exploding material type.
Definition
SCR_SecondaryExplosions.c:5
RESOURCE
RESOURCE
Definition
SCR_SecondaryExplosions.c:32
GetExplosionPrefab
ResourceName GetExplosionPrefab(float value)
Definition
SCR_SecondaryExplosions.c:257
TIRE
TIRE
Definition
SCR_SecondaryExplosions.c:29
m_sSecondaryFireParticles
ResourceName m_sSecondaryFireParticles
Definition
SCR_SecondaryExplosions.c:242
m_eSecondaryExplosionScale
SCR_ESecondaryExplosionScale m_eSecondaryExplosionScale
Definition
SCR_SecondaryExplosions.c:236
GetFireParticles
ResourceName GetFireParticles(float value)
Definition
SCR_SecondaryExplosions.c:278
LARGE
enum SCR_ESecondaryExplosionType LARGE
SMALL
enum SCR_ESecondaryExplosionType SMALL
m_sSecondaryExplosionPrefab
ResourceName m_sSecondaryExplosionPrefab
Definition
SCR_SecondaryExplosions.c:239
BATTERY
BATTERY
Definition
SCR_SecondaryExplosions.c:30
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
BaseContainerCustomTitle
Definition
BaseContainerCustomTitle.c:35
ResourceName
Definition
ResourceName.c:13
SCR_Enum
Definition
SCR_Enum.c:2
SCR_SecondaryExplosion
Definition
SCR_SecondaryExplosions.c:214
SCR_SecondaryExplosionType
Definition
SCR_SecondaryExplosions.c:100
SCR_SecondaryExplosionType::m_eResourceType
EResourceType m_eResourceType
Definition
SCR_SecondaryExplosions.c:105
SCR_SecondaryExplosionType::GetExplosionType
SCR_ESecondaryExplosionType GetExplosionType()
Definition
SCR_SecondaryExplosions.c:111
SCR_SecondaryExplosionType::GetSecondaryExplosionForScale
SCR_SecondaryExplosion GetSecondaryExplosionForScale(SCR_ESecondaryExplosionScale scale)
Definition
SCR_SecondaryExplosions.c:123
SCR_SecondaryExplosionType::GetResourceType
EResourceType GetResourceType()
Definition
SCR_SecondaryExplosions.c:117
SCR_SecondaryExplosionType::GetFireParticles
ResourceName GetFireParticles(float value)
Definition
SCR_SecondaryExplosions.c:177
SCR_SecondaryExplosionType::GetSecondaryExplosionScale
SCR_ESecondaryExplosionScale GetSecondaryExplosionScale(float value)
Definition
SCR_SecondaryExplosions.c:135
SCR_SecondaryExplosionType::GetExplosionPrefab
ResourceName GetExplosionPrefab(float value)
Definition
SCR_SecondaryExplosions.c:156
SCR_SecondaryExplosionType::m_aSecondaryExplosions
ref array< ref SCR_SecondaryExplosion > m_aSecondaryExplosions
Definition
SCR_SecondaryExplosions.c:108
SCR_SecondaryExplosionType::m_eSecondaryExplosionType
SCR_ESecondaryExplosionType m_eSecondaryExplosionType
Definition
SCR_SecondaryExplosions.c:102
UIWidgets
Definition
attributes.c:40
NONE
@ NONE
When Shape is created and not initialized yet.
Definition
ShapeType.c:15
DEFAULT
@ DEFAULT
Use currently set main RT format (based on game options).
Definition
DebugTextFlags.c:14
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
_WB_GetCustomTitle
class SCR_BaseManualCameraComponent _WB_GetCustomTitle(BaseContainer source, out string title)
Definition
SCR_BaseManualCameraComponent.c:141
scripts
GameCode
Components
SCR_SecondaryExplosions.c
Generated by
1.17.0