DayZ 1.30
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 строка 146

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

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

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