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

◆ EvaluateImpactEffect()

static void ImpactMaterials::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

См. определение в файле ImpactEffects.c строка 145

146 {
147 // No impact effects wanted for this ammo
148 if (m_IgnoredAmmo.Contains(ammoType))
149 return;
150
151 if (impact_type == ImpactTypes.UNKNOWN)
152 impact_type = ImpactTypes.STOP;
153
154 if (deflected)
155 impact_type = ImpactTypes.RICOCHET;
156 else if (outSpeed)
157 impact_type = ImpactTypes.PENETRATE;
158
159 if (isWater)
160 surface = "Hit_Water";
161
162 EffBulletImpactBase eff = EffBulletImpactBase.Cast(GetImpactEffect(surface, ammoType).Spawn());
163
164 if ( !eff && surface == "" ) // handle undefined surface
165 {
166 eff = EffBulletImpactBase.Cast( surface.ToType().Spawn() );
167
168 if (eff)
169 {
170 RegisterSurface(surface);
171 ErrorEx(string.Format("Unregistered surface for bullet impact effect (%1). Register this surface in ImpactMaterials (Script) for better performance.", surface), ErrorExSeverity.WARNING);
172 }
173 else
174 {
175 if (directHit)
176 {
177 string object_type = directHit.GetType();
178
179 if ( object_type == "" )
180 object_type = "OBJECT_WITHOUT_CONFIG_CLASS";
181
182 ErrorEx(string.Format("Object '%1' with model file: %2 has undefined 'Hit_...' material! Cannot play impact effect.", object_type, directHit.GetShapeName()));
183 eff = EffBulletImpactBase.Cast(GetImpactEffect("Hit_ErrorNoMaterial", ammoType).Spawn());
184 }
185 }
186 }
187
188 if ( !eff && surface != "" )
189 {
190 ErrorEx(string.Format("Unregistered surface impact material <%1>! Register this surface in ImpactMaterials (Script).", surface));
191 eff = EffBulletImpactBase.Cast(GetImpactEffect("Hit_Undefined", ammoType).Spawn());
192 }
193
194 if (eff)
195 {
196 eff.EvaluateEffect(directHit, componentIndex, pos, impact_type, surfNormal, exitPos, inSpeed, outSpeed, ammoType);
197 eff.SetAutodestroy(true);
198 SEffectManager.PlayInWorld(eff, pos);
199 }
200 }
void Spawn()
spawn damage trigger
Определения AreaDamageManager.c:70
ImpactTypes
Определения ImpactEffects.c:2
void EvaluateEffect(Object directHit, int componentIndex, vector pos, int impact_type, vector surfNormal, vector exitPos, vector inSpeed, vector outSpeed, string ammoType)
Определения BulletImpactBase.c:72
static int RegisterSurface(string surface)
Определения ImpactEffects.c:84
static GetImpactEffect(string surface, string ammoType)
Определения ImpactEffects.c:128
static ref map< string, int > m_IgnoredAmmo
Map of ammo which will not spawn any impact effect.
Определения ImpactEffects.c:34
ErrorExSeverity
Определения 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, EffBulletImpactBase::EvaluateEffect(), GetImpactEffect(), m_IgnoredAmmo, SEffectManager::PlayInWorld(), RegisterSurface(), Spawn() и string::ToType().

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