Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Auras.js
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | Auras.prototype.Clean = function() | ||||
} | } | ||||
}; | }; | ||||
Auras.prototype.GiveMembersWithValidClass = function(auraName, entityList) | Auras.prototype.GiveMembersWithValidClass = function(auraName, entityList) | ||||
{ | { | ||||
var match = this.GetClasses(auraName); | var match = this.GetClasses(auraName); | ||||
return entityList.filter(ent => { | return entityList.filter(ent => { | ||||
let cmpIdentity = Engine.QueryInterface(ent, IID_Identity); | let cmpIdentity = Engine.QueryInterface(ent, IID_Identity); | ||||
return cmpIdentity && MatchesClassList(cmpIdentity.GetClassesList(), match); | // Don't apply or remove bonus for units which are destroyed. | ||||
let cmpOwnership = Engine.QueryInterface(ent, IID_Ownership); | |||||
return cmpIdentity && MatchesClassList(cmpIdentity.GetClassesList(), match) && | |||||
!(cmpOwnership && cmpOwnership.GetOwner() == -1); | |||||
fatherbushido: units -> entities | |||||
}); | }); | ||||
}; | }; | ||||
Auras.prototype.OnRangeUpdate = function(msg) | Auras.prototype.OnRangeUpdate = function(msg) | ||||
{ | { | ||||
for (let name of this.GetAuraNames().filter(n => this[n] && msg.tag == this[n].rangeQuery)) | for (let name of this.GetAuraNames().filter(n => this[n] && msg.tag == this[n].rangeQuery)) | ||||
{ | { | ||||
this.ApplyBonus(name, msg.added); | this.ApplyBonus(name, msg.added); | ||||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
units -> entities