3542 {
3543 #ifndef SERVER
3544 ImpactEffectsData impactEffectsData = new ImpactEffectsData();
3545 impactEffectsData.m_DirectHit = directHit;
3546 impactEffectsData.m_ComponentIndex = componentIndex;
3547 impactEffectsData.m_Surface = surface;
3548 impactEffectsData.m_Position = pos;
3549 impactEffectsData.m_ImpactType =
ImpactTypes.UNKNOWN;
3550 impactEffectsData.m_SurfaceNormal = surfNormal;
3551 impactEffectsData.m_ExitPosition = exitPos;
3552 impactEffectsData.m_InSpeed = inSpeed;
3553 impactEffectsData.m_OutSpeed = outSpeed;
3554 impactEffectsData.m_IsDeflected = deflected;
3555 impactEffectsData.m_AmmoType = ammoType;
3556 impactEffectsData.m_IsWater = isWater;
3557
3558 if (directHit)
3559 {
3560 directHit.OnReceivedHit(impactEffectsData);
3561 }
3562
3563 ImpactMaterials.EvaluateImpactEffectEx(impactEffectsData);
3564 #endif
3565
3566
3568 {
3569 if (source && source.ShootsExplosiveAmmo() && !deflected && outSpeed == vector.Zero)
3570 {
3571 if (ammoType == "Bullet_40mm_ChemGas")
3572 {
3574 }
3575 else if (ammoType == "Bullet_40mm_Explosive")
3576 {
3577 DamageSystem.ExplosionDamage(
EntityAI.Cast(source), null,
"Explosion_40mm_Ammo", pos,
DamageType.EXPLOSION);
3578 }
3579 }
3580
3581
3582 m_NoiseParams.LoadFromPath(
"cfgAmmo " + ammoType +
" NoiseHit");
3583
3585 float coefAdjusted = surfaceCoef * inSpeed.
Length() /
ConfigGetFloat(
"cfgAmmo " + ammoType +
" initSpeed");
3586 if (coefAdjusted == 0)
3587 coefAdjusted = 1;
3588
3590 }
3591 }
DamageType
exposed from C++ (do not change)
proto native NoiseSystem GetNoiseSystem()
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native Object CreateObject(string type, vector pos, bool create_local=false, bool init_ai=false, bool create_physics=true)
Creates object of certain type.
static ref NoiseParams m_NoiseParams
proto native bool IsServer()
proto native Weather GetWeather()
Returns weather controller object.
proto native float SurfaceGetNoiseMultiplier(Object directHit, vector pos, int componentIndex)
proto void AddNoiseTarget(vector pos, float lifetime, NoiseParams noise_params, float external_strength_multiplier=1.0)
Will make a noise at that position which the AI will "see" for the duration of 'lifetime'.
proto native float Length()
Returns length of vector (magnitude)
proto native CGame GetGame()