3 const float FX_RANGE_MAX_MULT = 1.0;
7 super.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
13 vector headPos = player.GetDamageZonePos(
"Head");
14 float ammoRangeKill =
GetGame().
ConfigGetFloat(
string.Format(
"CfgAmmo %1 indirectHitRange", ammoType));
15 float ammoRangeMaxMult = 4.0;
17 string indirectHitRangeMultiplier =
string.Format(
"CfgAmmo %1 indirectHitRangeMultiplier", ammoType);
18 if (
GetGame().ConfigIsExisting(indirectHitRangeMultiplier))
21 ammoRangeMaxMult =
Math.
Clamp(
GetGame().ConfigGetFloat(indirectHitRangeMultiplier), 1.0,
float.
MAX);
24 float ammoRangeMax = ammoRangeKill * ammoRangeMaxMult;
25 ammoRangeMax =
Math.
Clamp(ammoRangeMax * FX_RANGE_MAX_MULT, ammoRangeKill, ammoRangeMax);
31 if (distSq <= radiusMaxSq)
35 EntityAI parent = invItem.GetHierarchyParent();
38 if (!parent || !parent.IsFireplace())
41 excluded.Insert(parent);
44 excluded.Insert(
this);
53 for (
int i = 0; i < results.Count(); i++)
55 if (results[i].obj && !results[i].obj.IsInherited(
ItemBase))
57 hitObjects.Insert(results[i].obj);
62 if (hitObjects.Count() &&
PlayerBase.Cast(hitObjects[0]))
65 if (ammoRangeMax == ammoRangeKill)
69 effectCoef = 1 - ((dist - ammoRangeKill) / (ammoRangeMax - ammoRangeKill));
70 effectCoef =
Math.
Clamp(effectCoef, 0.1, 100.0);
72 player.OnPlayerReceiveFlashbangHitStart(MiscGameplayFunctions.IsPlayerOrientedTowardPos(player, pos, 60));
73 player.GetFlashbangEffect().SetupFlashbangValues(effectCoef, effectCoef, effectCoef);
protected ExplosiveLight m_Light
light
void SetParticleExplosion(int particle)
void SetAmmoType(string pAmmoType)
class JsonUndergroundAreaTriggerData GetPosition
proto native float ConfigGetFloat(string path)
Get float value from config on path.
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
void SetGrenadeType(EGrenadeType type)
protected override void CreateLight()
void SetFuseDelay(float delay)
static const int GRENADE_M84
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto native CGame GetGame()
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float SqrFloat(float f)
Returns squared value.