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

3745 {
3746 #ifndef SERVER
3747 ImpactEffectsData impactEffectsData = new ImpactEffectsData();
3748 impactEffectsData.m_DirectHit = directHit;
3749 impactEffectsData.m_ComponentIndex = componentIndex;
3750 impactEffectsData.m_Surface = surface;
3751 impactEffectsData.m_Position = pos;
3752 impactEffectsData.m_ImpactType = ImpactTypes.UNKNOWN;
3753 impactEffectsData.m_SurfaceNormal = surfNormal;
3754 impactEffectsData.m_ExitPosition = exitPos;
3755 impactEffectsData.m_InSpeed = inSpeed;
3756 impactEffectsData.m_OutSpeed = outSpeed;
3757 impactEffectsData.m_IsDeflected = deflected;
3758 impactEffectsData.m_AmmoType = ammoType;
3759 impactEffectsData.m_IsWater = isWater;
3760
3761 if (directHit)
3762 {
3763 directHit.OnReceivedHit(impactEffectsData);
3764 }
3765
3766 #ifndef NO_GUI
3767 ImpactMaterials.EvaluateImpactEffectEx(impactEffectsData);
3768 #endif
3769 #endif
3770
3771 if (IsServer())
3772 {
3773 if (source && source.ShootsExplosiveAmmo() && !deflected && outSpeed == vector.Zero)
3774 {
3775 if (ammoType == "Bullet_40mm_ChemGas")
3776 {
3777 g_Game.CreateObject("ContaminatedArea_Local", pos);
3778 }
3779 else if (ammoType == "Bullet_40mm_Explosive")
3780 {
3781 DamageSystem.ExplosionDamage(EntityAI.Cast(source), null, "Explosion_40mm_Ammo", pos, DamageType.EXPLOSION);
3782 }
3783 }
3784
3785 // add hit noise
3786 m_NoiseParams.LoadFromPath("cfgAmmo " + ammoType + " NoiseHit");
3787
3788 float surfaceCoef = SurfaceGetNoiseMultiplier(directHit, pos, componentIndex);
3789 float coefAdjusted = surfaceCoef * inSpeed.Length() / ConfigGetFloat("cfgAmmo " + ammoType + " initSpeed");
3790 if (coefAdjusted == 0)
3791 coefAdjusted = 1;
3792
3793 GetNoiseSystem().AddNoiseTarget(pos, 10, m_NoiseParams, coefAdjusted); // Leave a ping for 5 seconds
3794 }
3795 }
class LogManager EntityAI
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
DayZGame g_Game
Определения DayZGame.c:4074
string ammoType
Определения DustKickupEffects.c:24
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:1005
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(), ammoType, ConfigGetFloat(), ImpactMaterials::EvaluateImpactEffectEx(), g_Game, GetNoiseSystem(), IsServer(), vector::Length(), m_NoiseParams, SurfaceGetNoiseMultiplier() и vector::Zero.