DayZ 1.29
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 строка 3614

3616 {
3617 #ifndef SERVER
3618 ImpactEffectsData impactEffectsData = new ImpactEffectsData();
3619 impactEffectsData.m_DirectHit = directHit;
3620 impactEffectsData.m_ComponentIndex = componentIndex;
3621 impactEffectsData.m_Surface = surface;
3622 impactEffectsData.m_Position = pos;
3623 impactEffectsData.m_ImpactType = ImpactTypes.UNKNOWN;
3624 impactEffectsData.m_SurfaceNormal = surfNormal;
3625 impactEffectsData.m_ExitPosition = exitPos;
3626 impactEffectsData.m_InSpeed = inSpeed;
3627 impactEffectsData.m_OutSpeed = outSpeed;
3628 impactEffectsData.m_IsDeflected = deflected;
3629 impactEffectsData.m_AmmoType = ammoType;
3630 impactEffectsData.m_IsWater = isWater;
3631
3632 if (directHit)
3633 {
3634 directHit.OnReceivedHit(impactEffectsData);
3635 }
3636
3637 ImpactMaterials.EvaluateImpactEffectEx(impactEffectsData);
3638 #endif
3639
3640
3641 if (IsServer())
3642 {
3643 if (source && source.ShootsExplosiveAmmo() && !deflected && outSpeed == vector.Zero)
3644 {
3645 if (ammoType == "Bullet_40mm_ChemGas")
3646 {
3647 g_Game.CreateObject("ContaminatedArea_Local", pos);
3648 }
3649 else if (ammoType == "Bullet_40mm_Explosive")
3650 {
3651 DamageSystem.ExplosionDamage(EntityAI.Cast(source), null, "Explosion_40mm_Ammo", pos, DamageType.EXPLOSION);
3652 }
3653 }
3654
3655 // add hit noise
3656 m_NoiseParams.LoadFromPath("cfgAmmo " + ammoType + " NoiseHit");
3657
3658 float surfaceCoef = SurfaceGetNoiseMultiplier(directHit, pos, componentIndex);
3659 float coefAdjusted = surfaceCoef * inSpeed.Length() / ConfigGetFloat("cfgAmmo " + ammoType + " initSpeed");
3660 if (coefAdjusted == 0)
3661 coefAdjusted = 1;
3662
3663 GetNoiseSystem().AddNoiseTarget(pos, 10, m_NoiseParams, coefAdjusted * g_Game.GetWeather().GetNoiseReductionByWeather()); // Leave a ping for 5 seconds
3664 }
3665 }
class LogManager EntityAI
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
DayZGame g_Game
Определения DayZGame.c:3942
ImpactTypes
Определения ImpactEffects.c:2
proto native NoiseSystem GetNoiseSystem()
proto native float ConfigGetFloat(string path)
Get float value from config on path.
static ref NoiseParams m_NoiseParams
Определения DayZGame.c:984
proto native bool IsServer()
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)

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