DayZ 1.27
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 строка 144

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