Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс AmmoEffects

Static data holder for certain ammo config values. Подробнее...

Закрытые статические члены

Ammo particles

Methods regarding getting/playing ammo particle

static int GetAmmoParticleID (string ammoType)
 Get the ParticleList ID for the particle for this ammoType.
 
static bool PlayAmmoParticle (string ammoType, vector pos)
 Attempt to play the ammo particle at pos if found, returns true on success.
 
Ammo effects

Methods regarding getting/playing ammo effect

static GetAmmoEffectTypename (string ammoType)
 Get the typename for the effect for this ammoType.
 
static bool PlayAmmoEffect (string ammoType, vector pos)
 Attempt to play the ammo effect at pos if found, returns true on success.
 
Lifetime

Creation and cleanup

static void Init ()
 Initialize the containers: this is done this way, to have these not exist on server.
 
static void Cleanup ()
 Clean up the data.
 

Закрытые статические данные

static ref map< string, intm_AmmoParticles
 Key: Ammo class name; Data: ParticleList ID.
 
static ref map< string, typenamem_AmmoEffects
 Key: Ammo class name; Data: ParticleList ID.
 

Подробное описание

Static data holder for certain ammo config values.

Заметки
Kept the names similar to what is in config, but it might be a little deceiving as this is mainly used for explosives

Методы

◆ Cleanup()

static void Cleanup ( )
inlinestaticprivate

Clean up the data.

129 {
130 /* These ain't containing no refs, so whatever
131 m_AmmoParticles.Clear();
132 m_AmmoEffects.Clear();
133 */
134 }

Используется в CGame::~CGame().

◆ GetAmmoEffectTypename()

static GetAmmoEffectTypename ( string ammoType)
inlinestaticprivate

Get the typename for the effect for this ammoType.

69 {
70 typename typeName;
71
72 // Search for it in the static map
73 if ( !m_AmmoEffects.Find(ammoType, typeName) )
74 {
75 // Load it in when we can't find it
76 string effectName;
77 GetGame().ConfigGetText(string.Format("cfgAmmo %1 effect", ammoType), effectName);
78
79 // If we found a valid entry, try looking for it in ParticleList
80 if ( effectName != "" )
81 {
82 typeName = effectName.ToType();
83 }
84
85 // Store it for next search
87 }
88
89 return typeName;
90 }
static ref map< string, typename > m_AmmoEffects
Key: Ammo class name; Data: ParticleList ID.
Definition AmmoEffects.c:11
Definition EntityAI.c:95
proto native CGame GetGame()

Перекрестные ссылки GetGame() и m_AmmoEffects.

Используется в PlayAmmoEffect().

◆ GetAmmoParticleID()

static int GetAmmoParticleID ( string ammoType)
inlinestaticprivate

Get the ParticleList ID for the particle for this ammoType.

22 {
23 int particleID;
24
25 // Search for it in the static map
27 {
28 // Load it in when we can't find it
29 string particleFileName;
30 GetGame().ConfigGetText(string.Format("cfgAmmo %1 particle", ammoType), particleFileName);
31
32 // If we found a valid entry, try looking for it in ParticleList
33 if ( particleFileName != "" )
34 {
36 }
37
38 // Store it for next search
40 }
41
42 return particleID;
43 }
static ref map< string, int > m_AmmoParticles
Key: Ammo class name; Data: ParticleList ID.
Definition AmmoEffects.c:8
Definition ParticleList.c:12
static int GetParticleIDByName(string name)
Returns particle's ID based on the filename (without .ptc suffix)
Definition ParticleList.c:415

Перекрестные ссылки GetGame(), ParticleList::GetParticleIDByName() и m_AmmoParticles.

Используется в PlayAmmoParticle().

◆ Init()

static void Init ( )
inlinestaticprivate

Initialize the containers: this is done this way, to have these not exist on server.

Перекрестные ссылки m_AmmoEffects и m_AmmoParticles.

Используется в CGame::CGame().

◆ PlayAmmoEffect()

static bool PlayAmmoEffect ( string ammoType,
vector pos )
inlinestaticprivate

Attempt to play the ammo effect at pos if found, returns true on success.

94 {
96
97 if ( typeName )
98 {
99 Effect eff = Effect.Cast(typeName.Spawn());
100
101 if ( eff )
102 {
103 eff.SetAutodestroy(true);
104 return SEffectManager.PlayInWorld( eff, pos );
105 }
106 }
107
108 return false;
109 }
static GetAmmoEffectTypename(string ammoType)
Get the typename for the effect for this ammoType.
Definition AmmoEffects.c:68
Manager class for managing Effect (EffectParticle, EffectSound)
Definition EffectManager.c:6
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
Definition EffectManager.c:43

Перекрестные ссылки GetAmmoEffectTypename() и SEffectManager::PlayInWorld().

Используется в IEntity::OnExplodeClient().

◆ PlayAmmoParticle()

static bool PlayAmmoParticle ( string ammoType,
vector pos )
inlinestaticprivate

Attempt to play the ammo particle at pos if found, returns true on success.

47 {
49
51 {
52 return ParticleManager.GetInstance().PlayInWorld(particleID, pos) != null;
53 }
54
55 return false;
56 }
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition ParticleManager.c:84
static int GetAmmoParticleID(string ammoType)
Get the ParticleList ID for the particle for this ammoType.
Definition AmmoEffects.c:21
static bool IsValidId(int id)
Purely checks for an invalid number, does NOT mean it is actually registered.
Definition ParticleList.c:385

Перекрестные ссылки GetAmmoParticleID(), ParticleList::IsValidId() и ParticleManager().

Используется в IEntity::OnExplodeClient().

Поля

◆ m_AmmoEffects

ref map<string, typename> m_AmmoEffects
staticprivate

Key: Ammo class name; Data: ParticleList ID.

Используется в GetAmmoEffectTypename() и Init().

◆ m_AmmoParticles

ref map<string, int> m_AmmoParticles
staticprivate

Key: Ammo class name; Data: ParticleList ID.

Используется в GetAmmoParticleID() и Init().


Объявления и описания членов класса находятся в файле: