DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ImpactMaterials

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

static ref map< string, typenamem_ImpactEffect
 
static int m_LastRegisteredMaterial = 0
 
static ref map< string, intm_IgnoredAmmo
 Map of ammo which will not spawn any impact effect.
 
static int m_LastRegisteredIgnoredAmmo = 0
 
Surface effects

Register all hit materials here! When modding, these can be unregistered with 'UnregisterSurface' if so desired

static int PLASTIC = RegisterSurface("Hit_Plastic")
 
static int SAND = RegisterSurface("Hit_Sand")
 
static int TEXTILE = RegisterSurface("Hit_Textile")
 
static int CONCRETE = RegisterSurface("Hit_Concrete")
 
static int GRAVEL = RegisterSurface("Hit_Gravel")
 
static int DIRT = RegisterSurface("Hit_Dirt")
 
static int FOLIAGE = RegisterSurface("Hit_Foliage")
 
static int GRASS = RegisterSurface("Hit_Grass")
 
static int WOOD = RegisterSurface("Hit_Wood")
 
static int METAL = RegisterSurface("Hit_Metal")
 
static int GLASS = RegisterSurface("Hit_Glass")
 
static int GLASS_THIN = RegisterSurface("Hit_Glass_Thin")
 
static int WATER = RegisterSurface("Hit_Water")
 
static int RUBBER = RegisterSurface("Hit_Rubber")
 
static int PLASTER = RegisterSurface("Hit_Plaster")
 
static int ICE = RegisterSurface("Hit_Ice")
 
static int SNOW = RegisterSurface("Hit_Snow")
 
static int MEATBONES = RegisterSurface("Hit_MeatBones")
 
static int MEATBONES_SHOVEL = RegisterSurface("Hit_MeatBones_MeleeShovel")
 
static int MEATBONES_PIPEWRENCH = RegisterSurface("Hit_MeatBones_MeleePipeWrench")
 
static int MEATBONES_WRENCH = RegisterSurface("Hit_MeatBones_MeleeWrench")
 
static int MEATBONES_FIST = RegisterSurface("Hit_MeatBones_MeleeFist")
 
static int UNDEFINED = RegisterSurface("Hit_Undefined")
 
static int ERROR_NO_MATERIAL = RegisterSurface("Hit_ErrorNoMaterial")
 

Ignored ammo

Register ammo which will not spawn impact effects here When modding, these can be unregistered with 'UnregisterIgnoredAmmo' if so desired

static int FIST = RegisterIgnoredAmmo("MeleeFist")
 
static int FIST_HEAVY = RegisterIgnoredAmmo("MeleeFist_Heavy")
 
static int SOFT = RegisterIgnoredAmmo("MeleeSoft")
 
static int SOFT_HEAVY = RegisterIgnoredAmmo("MeleeSoft_Heavy")
 
static int DUMMY = RegisterIgnoredAmmo("Dummy_Light")
 
static int DUMMY_HEAVY = RegisterIgnoredAmmo("Dummy_Heavy")
 
static int RegisterSurface (string surface)
 
static bool UnregisterSurface (string surface)
 
static int RegisterIgnoredAmmo (string ammo)
 
static bool UnregisterIgnoredAmmo (string ammo)
 
static GetImpactEffect (string surface, string ammoType)
 
static void EvaluateImpactEffectEx (ImpactEffectsData pData)
 
static void EvaluateImpactEffect (Object directHit, int componentIndex, string surface, vector pos, int impact_type, vector surfNormal, vector exitPos, vector inSpeed, vector outSpeed, bool deflected, string ammoType, bool isWater)
 

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

Методы

◆ EvaluateImpactEffect()

static void EvaluateImpactEffect ( Object directHit,
int componentIndex,
string surface,
vector pos,
int impact_type,
vector surfNormal,
vector exitPos,
vector inSpeed,
vector outSpeed,
bool deflected,
string ammoType,
bool isWater )
inlinestaticprivate
143 {
144 // No impact effects wanted for this ammo
145 if (m_IgnoredAmmo.Contains(ammoType))
146 return;
147
148 if (impact_type == ImpactTypes.UNKNOWN)
150
151 if (deflected)
152 impact_type = ImpactTypes.RICOCHET;
153 else if (outSpeed)
154 impact_type = ImpactTypes.PENETRATE;
155
156 if (isWater)
157 surface = "Hit_Water";
158
160
161 if ( !eff && surface == "" ) // handle undefined surface
162 {
163 eff = EffBulletImpactBase.Cast( surface.ToType().Spawn() );
164
165 if (eff)
166 {
167 RegisterSurface(surface);
168 ErrorEx(string.Format("Unregistered surface for bullet impact effect (%1). Register this surface in ImpactMaterials (Script) for better performance.", surface), ErrorExSeverity.WARNING);
169 }
170 else
171 {
172 if (directHit)
173 {
174 string object_type = directHit.GetType();
175
176 if ( object_type == "" )
177 object_type = "OBJECT_WITHOUT_CONFIG_CLASS";
178
179 ErrorEx(string.Format("Object '%1' with model file: %2 has undefined 'Hit_...' material! Cannot play impact effect.", object_type, directHit.GetShapeName()));
180 eff = EffBulletImpactBase.Cast(GetImpactEffect("Hit_ErrorNoMaterial", ammoType).Spawn());
181 }
182 }
183 }
184
185 if ( !eff && surface != "" )
186 {
187 ErrorEx(string.Format("Unregistered surface impact material <%1>! Register this surface in ImpactMaterials (Script).", surface));
188 eff = EffBulletImpactBase.Cast(GetImpactEffect("Hit_Undefined", ammoType).Spawn());
189 }
190
191 if (eff)
192 {
194 eff.SetAutodestroy(true);
196 }
197 }
void Spawn()
spawn damage trigger
Definition AreaDamageManager.c:70
ImpactTypes
Definition ImpactEffects.c:2
Definition BulletImpactBase.c:2
static ref map< string, int > m_IgnoredAmmo
Map of ammo which will not spawn any impact effect.
Definition ImpactEffects.c:34
static int RegisterSurface(string surface)
Definition ImpactEffects.c:81
static GetImpactEffect(string surface, string ammoType)
Definition ImpactEffects.c:125
Definition EntityAI.c:95
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:47
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx
proto native ToType()
Returns internal type representation. Can be used in runtime, or cached in variables and used for fas...

Перекрестные ссылки ErrorEx, GetImpactEffect(), m_IgnoredAmmo, SEffectManager::PlayInWorld(), RegisterSurface(), Spawn() и string::ToType().

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

◆ EvaluateImpactEffectEx()

static void EvaluateImpactEffectEx ( ImpactEffectsData pData)
inlinestaticprivate
138 {
139 EvaluateImpactEffect(pData.m_DirectHit, pData.m_ComponentIndex, pData.m_Surface, pData.m_Position, pData.m_ImpactType, pData.m_SurfaceNormal, pData.m_ExitPosition, pData.m_InSpeed, pData.m_OutSpeed, pData.m_IsDeflected, pData.m_AmmoType, pData.m_IsWater);
140 }
static void EvaluateImpactEffect(Object directHit, int componentIndex, string surface, vector pos, int impact_type, vector surfNormal, vector exitPos, vector inSpeed, vector outSpeed, bool deflected, string ammoType, bool isWater)
Definition ImpactEffects.c:142

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

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

◆ GetImpactEffect()

static GetImpactEffect ( string surface,
string ammoType )
inlinestaticprivate
126 {
127 string key = string.Format("%1_%2", surface, ammoType);
128
129 typename eff_type = m_ImpactEffect[key];
130
131 if (eff_type)
132 return eff_type;
133 else
134 return m_ImpactEffect[surface];
135 }
static ref map< string, typename > m_ImpactEffect
Definition ImpactEffects.c:30

Перекрестные ссылки m_ImpactEffect.

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

◆ RegisterIgnoredAmmo()

static int RegisterIgnoredAmmo ( string ammo)
inlinestaticprivate
103 {
104 if (!m_IgnoredAmmo)
106
108
110
112 }
static int m_LastRegisteredIgnoredAmmo
Definition ImpactEffects.c:35

Перекрестные ссылки m_IgnoredAmmo и m_LastRegisteredIgnoredAmmo.

◆ RegisterSurface()

static int RegisterSurface ( string surface)
inlinestaticprivate
82 {
83 if (!m_ImpactEffect)
85
86 m_ImpactEffect.Insert(surface, surface.ToType());
87
89 }
static int m_LastRegisteredMaterial
Definition ImpactEffects.c:31

Перекрестные ссылки m_ImpactEffect, m_LastRegisteredMaterial и string::ToType().

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

◆ UnregisterIgnoredAmmo()

static bool UnregisterIgnoredAmmo ( string ammo)
inlinestaticprivate
115 {
116 if (m_IgnoredAmmo)
117 {
118 m_IgnoredAmmo.Remove(ammo);
119 return !m_IgnoredAmmo.Contains(ammo);
120 }
121
122 return false;
123 }

Перекрестные ссылки m_IgnoredAmmo.

◆ UnregisterSurface()

static bool UnregisterSurface ( string surface)
inlinestaticprivate
92 {
94 {
95 m_ImpactEffect.Remove(surface);
96 return !m_ImpactEffect.Contains(surface);
97 }
98
99 return false;
100 }

Перекрестные ссылки m_ImpactEffect.

Поля

◆ CONCRETE

int CONCRETE = RegisterSurface("Hit_Concrete")
staticprivate

◆ DIRT

int DIRT = RegisterSurface("Hit_Dirt")
staticprivate

◆ DUMMY

int DUMMY = RegisterIgnoredAmmo("Dummy_Light")
staticprivate

◆ DUMMY_HEAVY

int DUMMY_HEAVY = RegisterIgnoredAmmo("Dummy_Heavy")
staticprivate

◆ ERROR_NO_MATERIAL

int ERROR_NO_MATERIAL = RegisterSurface("Hit_ErrorNoMaterial")
staticprivate

◆ FIST

int FIST = RegisterIgnoredAmmo("MeleeFist")
staticprivate

◆ FIST_HEAVY

int FIST_HEAVY = RegisterIgnoredAmmo("MeleeFist_Heavy")
staticprivate

◆ FOLIAGE

int FOLIAGE = RegisterSurface("Hit_Foliage")
staticprivate

◆ GLASS

int GLASS = RegisterSurface("Hit_Glass")
staticprivate

◆ GLASS_THIN

int GLASS_THIN = RegisterSurface("Hit_Glass_Thin")
staticprivate

◆ GRASS

int GRASS = RegisterSurface("Hit_Grass")
staticprivate

◆ GRAVEL

int GRAVEL = RegisterSurface("Hit_Gravel")
staticprivate

◆ ICE

int ICE = RegisterSurface("Hit_Ice")
staticprivate

◆ m_IgnoredAmmo

ref map<string, int> m_IgnoredAmmo
staticprivate

Map of ammo which will not spawn any impact effect.

Используется в EvaluateImpactEffect(), RegisterIgnoredAmmo() и UnregisterIgnoredAmmo().

◆ m_ImpactEffect

ref map<string, typename> m_ImpactEffect
staticprivate

Используется в GetImpactEffect(), RegisterSurface() и UnregisterSurface().

◆ m_LastRegisteredIgnoredAmmo

int m_LastRegisteredIgnoredAmmo = 0
staticprivate

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

◆ m_LastRegisteredMaterial

int m_LastRegisteredMaterial = 0
staticprivate

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

◆ MEATBONES

int MEATBONES = RegisterSurface("Hit_MeatBones")
staticprivate

◆ MEATBONES_FIST

int MEATBONES_FIST = RegisterSurface("Hit_MeatBones_MeleeFist")
staticprivate

◆ MEATBONES_PIPEWRENCH

int MEATBONES_PIPEWRENCH = RegisterSurface("Hit_MeatBones_MeleePipeWrench")
staticprivate

◆ MEATBONES_SHOVEL

int MEATBONES_SHOVEL = RegisterSurface("Hit_MeatBones_MeleeShovel")
staticprivate

◆ MEATBONES_WRENCH

int MEATBONES_WRENCH = RegisterSurface("Hit_MeatBones_MeleeWrench")
staticprivate

◆ METAL

int METAL = RegisterSurface("Hit_Metal")
staticprivate

◆ PLASTER

int PLASTER = RegisterSurface("Hit_Plaster")
staticprivate

◆ PLASTIC

int PLASTIC = RegisterSurface("Hit_Plastic")
staticprivate

◆ RUBBER

int RUBBER = RegisterSurface("Hit_Rubber")
staticprivate

◆ SAND

int SAND = RegisterSurface("Hit_Sand")
staticprivate

◆ SNOW

int SNOW = RegisterSurface("Hit_Snow")
staticprivate

◆ SOFT

int SOFT = RegisterIgnoredAmmo("MeleeSoft")
staticprivate

◆ SOFT_HEAVY

int SOFT_HEAVY = RegisterIgnoredAmmo("MeleeSoft_Heavy")
staticprivate

◆ TEXTILE

int TEXTILE = RegisterSurface("Hit_Textile")
staticprivate

◆ UNDEFINED

int UNDEFINED = RegisterSurface("Hit_Undefined")
staticprivate

◆ WATER

int WATER = RegisterSurface("Hit_Water")
staticprivate

◆ WOOD

int WOOD = RegisterSurface("Hit_Wood")
staticprivate

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