Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Guard.js
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
let index = this.entities.indexOf(oldent); | let index = this.entities.indexOf(oldent); | ||||
if (index != -1) | if (index != -1) | ||||
this.entities[index] = newent; | this.entities[index] = newent; | ||||
}; | }; | ||||
Guard.prototype.OnAttacked = function(msg) | Guard.prototype.OnAttacked = function(msg) | ||||
{ | { | ||||
for (let ent of this.entities) | if (this.entities.length) | ||||
Engine.PostMessage(ent, MT_GuardedAttacked, { "guarded": this.entity, "data": msg }); | Engine.DistributeMessage(this.entities, MT_GuardedAttacked, { "guarded": this.entity, "data": msg }); | ||||
Stan: Does this mean the player no longer receives the warning he has been attacked? | |||||
Done Inline ActionsNope, that is handled differently. Freagarach: Nope, that is handled differently. | |||||
}; | }; | ||||
/** | /** | ||||
* If an entity is captured, or about to be killed (so its owner | * If an entity is captured, or about to be killed (so its owner | ||||
* changes to '-1') or if diplomacy changed, update the guards list | * changes to '-1') or if diplomacy changed, update the guards list | ||||
*/ | */ | ||||
Guard.prototype.OnOwnershipChanged = function(msg) | Guard.prototype.OnOwnershipChanged = function(msg) | ||||
{ | { | ||||
Show All 29 Lines |
Wildfire Games · Phabricator
Does this mean the player no longer receives the warning he has been attacked?