72 int nrOfCachedResults = m_RaycastSources.Count();
73 for (
int c = 0; c < nrOfCachedResults; ++c )
76 if ( cachedRes.obj == victim )
77 return victim.GetDamageZoneNameByComponentIndex(cachedRes.component);
80 int nrOfSources = m_RaycastSources.Count();
88 params.type = ObjIntersectIFire;
91 for (
int i = m_RaycastCachedIndex + 1; i < nrOfSources; ++i )
93 m_RaycastCachedIndex = i;
95 params.begPos = trigger.ModelToWorld( m_RaycastSources[i] );
96 params.endPos = params.begPos + m_RaycastEndOffset;
100 for (
int j = 0; j < victims.Count(); ++j )
104 if (res.obj == victim)
105 hitzone = victim.GetDamageZoneNameByComponentIndex(res.component);
107 if (res.obj.IsAnyInherited(m_DamageableTypes))
108 m_RaycastCache.Insert(res);
111 if ( !( hitzone ==
"") )
123 Error(
string.Format(
"[WARNING] :: [%1] :: [AreaDamageComponentRaycasted] :: No proper HitZone found for damaging %2, using fallback.",
130 if (
Math.RandomIntInclusive(0, 1) == 1 )
137 victim.GetDamageZones(damageZones);
139 int nrOfDmgZones = damageZones.Count();
141 if (nrOfDmgZones > 0)
143 for (
int z = 0; z < nrOfDmgZones; ++z)
145 if ( damageZones[z].Contains(
"Foot") || damageZones[z].Contains(
"Leg") )
146 return damageZones[z];
149 return damageZones.GetRandomElement();