Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/AttackDetection.js
Show All 16 Lines | |||||
{ | { | ||||
this.suppressionTime = +this.template.SuppressionTime; | this.suppressionTime = +this.template.SuppressionTime; | ||||
// Use squared distance to avoid sqrts | // Use squared distance to avoid sqrts | ||||
this.suppressionTransferRangeSquared = +this.template.SuppressionTransferRange * +this.template.SuppressionTransferRange; | this.suppressionTransferRangeSquared = +this.template.SuppressionTransferRange * +this.template.SuppressionTransferRange; | ||||
this.suppressionRangeSquared = +this.template.SuppressionRange * +this.template.SuppressionRange; | this.suppressionRangeSquared = +this.template.SuppressionRange * +this.template.SuppressionRange; | ||||
this.suppressedList = []; | this.suppressedList = []; | ||||
}; | }; | ||||
AttackDetection.prototype.Update = function(newTemplate) | |||||
{ | |||||
this.template = newTemplate; | |||||
this.Init(); | |||||
}; | |||||
AttackDetection.prototype.ActivateTimer = function() | AttackDetection.prototype.ActivateTimer = function() | ||||
{ | { | ||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer).SetTimeout(this.entity, IID_AttackDetection, "HandleTimeout", this.suppressionTime); | Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer).SetTimeout(this.entity, IID_AttackDetection, "HandleTimeout", this.suppressionTime); | ||||
}; | }; | ||||
AttackDetection.prototype.AddSuppression = function(event) | AttackDetection.prototype.AddSuppression = function(event) | ||||
{ | { | ||||
this.suppressedList.push(event); | this.suppressedList.push(event); | ||||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator