Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/polar_sea_triggers.js
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | if (!firstAttacker) | ||||
continue; | continue; | ||||
let attackerPos = TriggerHelper.GetEntityPosition2D(firstAttacker); | let attackerPos = TriggerHelper.GetEntityPosition2D(firstAttacker); | ||||
if (!attackerPos) | if (!attackerPos) | ||||
continue; | continue; | ||||
// The returned entities are sorted by RangeManager already | // The returned entities are sorted by RangeManager already | ||||
// Only consider units implementing Health since wolves deal damage. | // Only consider units implementing Health since wolves deal damage. | ||||
let targets = PositionHelper.EntitiesNearPoint(attackerPos, 200, players, IID_Health).filter(ent => { | let targets = PositionHelper.EntitiesNearPoint(attackerPos, 0, 200, players, IID_Health).filter(ent => { | ||||
let cmpIdentity = Engine.QueryInterface(ent, IID_Identity); | let cmpIdentity = Engine.QueryInterface(ent, IID_Identity); | ||||
return cmpIdentity && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses); | return cmpIdentity && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses); | ||||
}); | }); | ||||
let goodTargets = targets.slice(0, targetCount); | let goodTargets = targets.slice(0, targetCount); | ||||
// Look through all targets if there aren't enough nearby ones | // Look through all targets if there aren't enough nearby ones | ||||
if (goodTargets.length < targetCount) | if (goodTargets.length < targetCount) | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator