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_ProjectileWindTable.c
Go to the documentation of this file.
1
[
BaseContainerProps
(configRoot:
true
)]
2
class
SCR_ProjectileWindTable
3
{
4
[
Attribute
(
desc
:
"Data"
)]
5
protected
ref array<ref SCR_ProjectileWindData>
m_aData
;
6
7
//------------------------------------------------------------------------------------------------
10
static
SCR_ProjectileWindTable
GetProjectileWindageData
(notnull
IEntity
projectile)
11
{
12
ProjectileMoveComponent
pmc =
ProjectileMoveComponent
.Cast(projectile.FindComponent(
ProjectileMoveComponent
));
13
if
(!pmc)
14
return
null;
15
16
ProjectileMoveComponentClass
data
=
ProjectileMoveComponentClass
.Cast(pmc.GetComponentData(projectile));
17
ResourceName
rn =
data
.GetProjectileWindTable();
18
if
(rn.IsEmpty())
19
return
null;
20
21
Resource
res =
BaseContainerTools
.LoadContainer(rn);
22
if
(!res.IsValid())
23
return
null;
24
25
BaseContainer
container = res.GetResource().ToBaseContainer();
26
if
(!container)
27
return
null;
28
29
return
SCR_ProjectileWindTable
.Cast(
BaseContainerTools
.CreateInstanceFromContainer(container));
30
}
31
32
//------------------------------------------------------------------------------------------------
35
static
SCR_ProjectileWindTable
GetProjectileWindageData
(
ResourceName
projectileResource)
36
{
37
Resource
res =
Resource
.Load(projectileResource);
38
if
(!res.IsValid())
39
return
null;
40
41
BaseResourceObject
resObject = res.GetResource();
42
if
(!resObject)
43
return
null;
44
45
IEntitySource
projectileEntitySrc = resObject.ToEntitySource();
46
if
(!projectileEntitySrc)
47
return
null;
48
49
return
GetProjectileWindageData
(projectileEntitySrc);
50
}
51
52
//------------------------------------------------------------------------------------------------
55
static
SCR_ProjectileWindTable
GetProjectileWindageData
(notnull
IEntitySource
projectileEntitySrc)
56
{
57
ResourceName
rn;
58
IEntityComponentSource
componentSrc;
59
for
(
int
i, componentsCount = projectileEntitySrc.GetComponentCount(); i < componentsCount; i++)
60
{
61
componentSrc = projectileEntitySrc.GetComponent(i);
62
if
(!componentSrc)
63
continue
;
64
65
if
(!componentSrc.GetClassName().ToType().IsInherited(
ProjectileMoveComponent
))
66
continue
;
67
68
componentSrc.Get(
"ProjectileWindTableConfig"
, rn);
69
break
;
70
}
71
72
if
(rn.IsEmpty())
73
return
null;
74
75
Resource
res =
BaseContainerTools
.LoadContainer(rn);
76
if
(!res.IsValid())
77
return
null;
78
79
BaseContainer
container = res.GetResource().ToBaseContainer();
80
if
(!container)
81
return
null;
82
83
return
SCR_ProjectileWindTable
.Cast(
BaseContainerTools
.CreateInstanceFromContainer(container));
84
}
85
86
//------------------------------------------------------------------------------------------------
98
array<float>
GetDataByAngleDeg
(
float
angle,
float
windSpeed,
float
initSpeedCoef = 1)
99
{
100
angle =
SCR_Math
.
ConvertToRadians
(angle,
SCR_EOpticsAngleUnits
.DEGREES);
101
return
GetDataByAngle
(angle, windSpeed, initSpeedCoef);
102
}
103
104
//------------------------------------------------------------------------------------------------
116
array<float>
GetDataByAngle
(
float
angle,
float
windSpeed = 10,
float
initSpeedCoef = 1)
117
{
118
foreach
(
SCR_ProjectileWindData
data
:
m_aData
)
119
{
120
if
(initSpeedCoef !=
data
.GetInitSpeedCoef())
121
continue
;
122
123
if
(windSpeed !=
data
.GetWindSpeed())
124
continue
;
125
126
return
data
.GetDataByAngle(angle);
127
}
128
129
return
null;
130
}
131
132
//------------------------------------------------------------------------------------------------
145
array<float>
GetDataByDisance
(
float
distance
,
bool
directFire,
float
windSpeed,
float
initSpeedCoef = 1)
146
{
147
foreach
(
SCR_ProjectileWindData
data
:
m_aData
)
148
{
149
if
(initSpeedCoef !=
data
.GetInitSpeedCoef())
150
continue
;
151
152
if
(windSpeed !=
data
.GetWindSpeed())
153
continue
;
154
155
return
data
.GetDataByDisance(
distance
, directFire);
156
}
157
158
return
null;
159
}
160
161
//------------------------------------------------------------------------------------------------
162
// constructor
164
void
SCR_ProjectileWindTable
(array<ref SCR_ProjectileWindData>
data
)
165
{
166
if
(
data
)
167
m_aData
=
data
;
168
}
169
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
distance
float distance
Definition
SCR_DestructibleTreeV2.c:29
SCR_EOpticsAngleUnits
SCR_EOpticsAngleUnits
Definition
SCR_EOpticsAngleUnits.c:6
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
BaseContainer
Definition
BaseContainer.c:13
BaseContainerTools
Definition
BaseContainerTools.c:13
BaseResourceObject
Definition
BaseResourceObject.c:13
IEntityComponentSource
Definition
IEntityComponentSource.c:13
IEntity
Definition
IEntity.c:13
IEntitySource
Definition
IEntitySource.c:13
ProjectileMoveComponentClass
Definition
ProjectileMoveComponentClass.c:13
ProjectileMoveComponent
Definition
ProjectileMoveComponent.c:13
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_Math
Definition
SCR_Math.c:2
SCR_Math::ConvertToRadians
static float ConvertToRadians(float angleFrom, SCR_EOpticsAngleUnits fromUnitType)
Definition
SCR_Math.c:323
SCR_ProjectileWindData
Definition
SCR_ProjectileWindData.c:3
SCR_ProjectileWindTable::GetProjectileWindageData
static SCR_ProjectileWindTable GetProjectileWindageData(ResourceName projectileResource)
Definition
SCR_ProjectileWindTable.c:35
SCR_ProjectileWindTable::GetProjectileWindageData
static SCR_ProjectileWindTable GetProjectileWindageData(notnull IEntity projectile)
Definition
SCR_ProjectileWindTable.c:10
SCR_ProjectileWindTable::m_aData
ref array< ref SCR_ProjectileWindData > m_aData
Definition
SCR_ProjectileWindTable.c:5
SCR_ProjectileWindTable::GetProjectileWindageData
static SCR_ProjectileWindTable GetProjectileWindageData(notnull IEntitySource projectileEntitySrc)
Definition
SCR_ProjectileWindTable.c:55
SCR_ProjectileWindTable::SCR_ProjectileWindTable
void SCR_ProjectileWindTable(array< ref SCR_ProjectileWindData > data)
Definition
SCR_ProjectileWindTable.c:164
SCR_ProjectileWindTable::GetDataByAngleDeg
array< float > GetDataByAngleDeg(float angle, float windSpeed, float initSpeedCoef=1)
Definition
SCR_ProjectileWindTable.c:98
SCR_ProjectileWindTable::GetDataByAngle
array< float > GetDataByAngle(float angle, float windSpeed=10, float initSpeedCoef=1)
Definition
SCR_ProjectileWindTable.c:116
SCR_ProjectileWindTable::GetDataByDisance
array< float > GetDataByDisance(float distance, bool directFire, float windSpeed, float initSpeedCoef=1)
Definition
SCR_ProjectileWindTable.c:145
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Projectiles
SCR_ProjectileWindTable.c
Generated by
1.17.0