DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
AmmoEffects.c
См. документацию.
1
5//Obsolete
7{
10
13
14
15
20
22 static int GetAmmoParticleID(string ammoType)
23 {
24 int particleID;
25
26 // Search for it in the static map
27 if ( !m_AmmoParticles.Find(ammoType, particleID) )
28 {
29 // Load it in when we can't find it
30 string particleFileName;
31 g_Game.ConfigGetText(string.Format("cfgAmmo %1 particle", ammoType), particleFileName);
32
33 // If we found a valid entry, try looking for it in ParticleList
34 if ( particleFileName != "" )
35 {
36 particleID = ParticleList.GetParticleIDByName(particleFileName);
37 }
38
39 // Store it for next search
40 m_AmmoParticles.Insert(ammoType, particleID);
41 }
42
43 return particleID;
44 }
45
47 static bool PlayAmmoParticle(string ammoType, vector pos)
48 {
49 string surfaceType;
50 g_Game.SurfaceGetType3D(pos[0], pos[1], pos[2], surfaceType);
51 ExplosiveEffectData explosiveEffectData = AmmoTypesAPI.GetExplosiveEffectData(ammoType, surfaceType);
52 //int particleID = GetAmmoParticleID(ammoType);
53
54 if (ParticleList.IsValidId(explosiveEffectData.m_ParticleID))
55 {
56 return ParticleManager.GetInstance().PlayInWorld(explosiveEffectData.m_ParticleID, pos) != null;
57 }
58
59 return false;
60 }
61
63
64
65
70
72 static typename GetAmmoEffectTypename(string ammoType)
73 {
74 typename typeName;
75
76 // Search for it in the static map
77 if ( !m_AmmoEffects.Find(ammoType, typeName) )
78 {
79 // Load it in when we can't find it
80 string effectName;
81 g_Game.ConfigGetText(string.Format("cfgAmmo %1 effect", ammoType), effectName);
82
83 // If we found a valid entry, try looking for it in ParticleList
84 if ( effectName != "" )
85 {
86 typeName = effectName.ToType();
87 }
88
89 // Store it for next search
90 m_AmmoEffects.Insert(ammoType, typeName);
91 }
92
93 return typeName;
94 }
95
97 static bool PlayAmmoEffect(string ammoType, vector pos)
98 {
99 string surfaceType;
100 g_Game.SurfaceGetType3D(pos[0], pos[1], pos[2], surfaceType);
101
102 typename typeName = GetAmmoEffectTypename(ammoType);
103
104 if ( typeName )
105 {
106 Effect eff = Effect.Cast(typeName.Spawn());
107
108 if ( eff )
109 {
110 eff.SetAutodestroy(true);
111 return SEffectManager.PlayInWorld( eff, pos );
112 }
113 }
114
115 return false;
116 }
117
119
120
121
126
128 static void Init()
129 {
132 }
133
135 static void Cleanup()
136 {
137 /* These ain't containing no refs, so whatever
138 m_AmmoParticles.Clear();
139 m_AmmoEffects.Clear();
140 */
141 }
142
144}
void AmmoTypesAPI()
Определения AmmoTypes.c:17
DayZGame g_Game
Определения DayZGame.c:4074
string ammoType
Определения DustKickupEffects.c:24
void Effect()
ctor
Определения Effect.c:72
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения ParticleManager.c:88
static bool PlayAmmoEffect(string ammoType, vector pos)
Attempt to play the ammo effect at pos if found, returns true on success.
Определения AmmoEffects.c:97
static ref map< string, typename > m_AmmoEffects
Key: Ammo class name; Data: ParticleList ID.
Определения AmmoEffects.c:12
static ref map< string, int > m_AmmoParticles
Key: Ammo class name; Data: ParticleList ID.
Определения AmmoEffects.c:9
static GetAmmoEffectTypename(string ammoType)
Get the typename for the effect for this ammoType.
Определения AmmoEffects.c:72
static void Cleanup()
Clean up the data.
Определения AmmoEffects.c:135
static bool PlayAmmoParticle(string ammoType, vector pos)
Attempt to play the ammo particle at pos if found, returns true on success.
Определения AmmoEffects.c:47
static void Init()
Initialize the containers: this is done this way, to have these not exist on server.
Определения AmmoEffects.c:128
static int GetAmmoParticleID(string ammoType)
Get the ParticleList ID for the particle for this ammoType.
Определения AmmoEffects.c:22
Static data holder for certain ammo config values.
Определения AmmoEffects.c:7
int m_ParticleID
Определения AmmoTypes.c:3
Определения AmmoTypes.c:2
static int GetParticleIDByName(string name)
Returns particle's ID based on the filename (without .ptc suffix)
Определения ParticleList.c:552
static bool IsValidId(int id)
Purely checks for an invalid number, does NOT mean it is actually registered.
Определения ParticleList.c:520
Определения ParticleList.c:12
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
Определения EffectManager.c:47
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
Определения Transport.c:70
Определения EnConvert.c:119
proto native ToType()
Returns internal type representation. Can be used in runtime, or cached in variables and used for fas...