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

◆ FirearmEffects()

void CGame::FirearmEffects ( Object source,
Object directHit,
int componentIndex,
string surface,
vector pos,
vector surfNormal,
vector exitPos,
vector inSpeed,
vector outSpeed,
bool isWater,
bool deflected,
string ammoType )
inlineprotected

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

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
3567 if (IsServer())
3568 {
3569 if (source && source.ShootsExplosiveAmmo() && !deflected && outSpeed == vector.Zero)
3570 {
3571 if (ammoType == "Bullet_40mm_ChemGas")
3572 {
3573 GetGame().CreateObject("ContaminatedArea_Local", pos);
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 // add hit noise
3582 m_NoiseParams.LoadFromPath("cfgAmmo " + ammoType + " NoiseHit");
3583
3584 float surfaceCoef = SurfaceGetNoiseMultiplier(directHit, pos, componentIndex);
3585 float coefAdjusted = surfaceCoef * inSpeed.Length() / ConfigGetFloat("cfgAmmo " + ammoType + " initSpeed");
3586 if (coefAdjusted == 0)
3587 coefAdjusted = 1;
3588
3589 GetNoiseSystem().AddNoiseTarget(pos, 10, m_NoiseParams, coefAdjusted * GetGame().GetWeather().GetNoiseReductionByWeather()); // Leave a ping for 5 seconds
3590 }
3591 }
class LogManager EntityAI
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
ImpactTypes
Определения ImpactEffects.c:2
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
Определения DayZGame.c:982
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()

Перекрестные ссылки NoiseSystem::AddNoiseTarget(), ConfigGetFloat(), CreateObject(), ImpactMaterials::EvaluateImpactEffectEx(), GetGame(), GetNoiseSystem(), GetWeather(), IsServer(), vector::Length(), m_NoiseParams, SurfaceGetNoiseMultiplier() и vector::Zero.