DayZ
1.27
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
AmmoTypes.c
См. документацию.
1
class
AmmoTypesAPI
2
{
3
static
protected
ref
map<string, ref map<string, int>
>
m_TypeToSurfaceParticleIDMap
;
4
5
private
void
AmmoTypesAPI
() {}
6
private
void
~AmmoTypesAPI
() {}
7
9
static
proto
bool
Exists
(
string
ammoType);
11
static
proto
bool
GetAmmoType
(
string
magazineType, out
string
ammoType);
12
14
static
bool
MagazineTypeToAmmoType
(
string
magazineType, out
string
ammoType)
15
{
16
if
( !
AmmoTypesAPI
.Exists(magazineType) )
17
{
18
if
( !
AmmoTypesAPI
.GetAmmoType(magazineType, ammoType) )
19
{
20
ErrorEx
(
string
.Format(
"%1 is not a magazineType or ammoType or has no default 'ammo' set up in config."
, magazineType));
21
return
false
;
22
}
23
return
true
;
24
}
25
else
26
{
27
// This is already an ammoType
28
ammoType = magazineType;
29
return
true
;
30
}
31
}
32
33
static
void
Init
()
34
{
35
if
(!
m_TypeToSurfaceParticleIDMap
)
36
{
37
m_TypeToSurfaceParticleIDMap
=
new
map<string, ref map<string, int>
>();
38
39
AddExplosionParticleEffect
(
"Explosion_40mm_Ammo"
,
"Hit_Snow"
,
ParticleList
.
EXPLOSION_GRENADE_SNOW
);
40
AddExplosionParticleEffect
(
"Explosion_40mm_Ammo"
,
"Hit_Ice"
,
ParticleList
.
EXPLOSION_GRENADE_ICE
);
41
AddExplosionParticleEffect
(
"Explosion_40mm_Ammo"
,
"default"
,
ParticleList
.
EXPLOSION_LANDMINE
);
42
}
43
}
44
45
static
void
AddExplosionParticleEffect
(
string
ammoName,
string
surfaceName,
int
particleID)
46
{
47
map<string, int>
> surfaceNameToEffectIDMap;
48
if
(!
m_TypeToSurfaceParticleIDMap
.Find(ammoName, surfaceNameToEffectIDMap))
49
{
50
surfaceNameToEffectIDMap =
new
map<string, int>
>;
51
m_TypeToSurfaceParticleIDMap
.Insert(ammoName, surfaceNameToEffectIDMap);
52
}
53
54
surfaceNameToEffectIDMap.Insert(surfaceName, particleID);
55
}
56
57
static
int
GetExplosionParticleID
(
string
ammoName,
string
surfaceName)
58
{
59
int
result;
60
map<string, int>
> surfaceNameToEffectIDMap =
m_TypeToSurfaceParticleIDMap
.Get(ammoName);
61
if
(surfaceNameToEffectIDMap)
62
{
63
if
(!surfaceNameToEffectIDMap.Find(surfaceName, result))
64
{
65
if
(!surfaceNameToEffectIDMap.Find(
"default"
, result))
66
{
67
result = -1;
68
}
69
}
70
}
71
return
result;
72
}
73
74
static
void
Cleanup
()
75
{
76
if
(!
m_TypeToSurfaceParticleIDMap
)
77
{
78
m_TypeToSurfaceParticleIDMap
.Clear();
79
}
80
}
81
}
map
map
Определения
ControlsXboxNew.c:4
AmmoTypesAPI::Exists
static proto bool Exists(string ammoType)
Check if ammoType exists (registered in cfgAmmoTypes)
AmmoTypesAPI::AmmoTypesAPI
void AmmoTypesAPI()
Определения
AmmoTypes.c:5
AmmoTypesAPI::GetExplosionParticleID
static int GetExplosionParticleID(string ammoName, string surfaceName)
Определения
AmmoTypes.c:57
AmmoTypesAPI::GetAmmoType
static proto bool GetAmmoType(string magazineType, out string ammoType)
Get the default ammoType of a magazine.
AmmoTypesAPI::Cleanup
static void Cleanup()
Определения
AmmoTypes.c:74
AmmoTypesAPI::AddExplosionParticleEffect
static void AddExplosionParticleEffect(string ammoName, string surfaceName, int particleID)
Определения
AmmoTypes.c:45
AmmoTypesAPI::Init
static void Init()
Определения
AmmoTypes.c:33
AmmoTypesAPI::~AmmoTypesAPI
void ~AmmoTypesAPI()
Определения
AmmoTypes.c:6
AmmoTypesAPI::MagazineTypeToAmmoType
static bool MagazineTypeToAmmoType(string magazineType, out string ammoType)
Helper method.
Определения
AmmoTypes.c:14
AmmoTypesAPI::m_TypeToSurfaceParticleIDMap
ref map< string, ref map< string, int > > m_TypeToSurfaceParticleIDMap
Определения
AmmoTypes.c:3
ParticleList::EXPLOSION_LANDMINE
static const int EXPLOSION_LANDMINE
Определения
ParticleList.c:267
ParticleList::EXPLOSION_GRENADE_ICE
static const int EXPLOSION_GRENADE_ICE
Определения
ParticleList.c:136
ParticleList::EXPLOSION_GRENADE_SNOW
static const int EXPLOSION_GRENADE_SNOW
Определения
ParticleList.c:135
ParticleList
Определения
ParticleList.c:12
ErrorEx
enum ShapeType ErrorEx
Ishodniki
scripts
3_Game
Global
AmmoTypes.c
Создано системой
1.13.2