Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/UnitAI.js
Show First 20 Lines • Show All 2,952 Lines • ▼ Show 20 Lines | "GARRISON": { | ||||
"leave": function() { | "leave": function() { | ||||
} | } | ||||
}, | }, | ||||
}, | }, | ||||
"CHEERING": { | "CHEERING": { | ||||
"enter": function() { | "enter": function() { | ||||
// Unit is invulnerable while cheering | // Unit is invulnerable while cheering | ||||
var cmpDamageReceiver = Engine.QueryInterface(this.entity, IID_DamageReceiver); | var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance); | ||||
Stan: Missing check ? I guess you can't use let here. | |||||
cmpDamageReceiver.SetInvulnerability(true); | cmpResistance.SetInvulnerability(true); | ||||
this.SelectAnimation("promotion"); | this.SelectAnimation("promotion"); | ||||
this.StartTimer(2800, 2800); | this.StartTimer(2800, 2800); | ||||
return false; | return false; | ||||
}, | }, | ||||
"leave": function() { | "leave": function() { | ||||
this.StopTimer(); | this.StopTimer(); | ||||
this.ResetAnimation(); | this.ResetAnimation(); | ||||
var cmpDamageReceiver = Engine.QueryInterface(this.entity, IID_DamageReceiver); | var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance); | ||||
StanUnsubmitted Not Done Inline ActionsMissing check ? Stan: Missing check ? | |||||
cmpDamageReceiver.SetInvulnerability(false); | cmpResistance.SetInvulnerability(false); | ||||
}, | }, | ||||
"Timer": function(msg) { | "Timer": function(msg) { | ||||
this.FinishOrder(); | this.FinishOrder(); | ||||
}, | }, | ||||
}, | }, | ||||
"PACKING": { | "PACKING": { | ||||
▲ Show 20 Lines • Show All 480 Lines • ▼ Show 20 Lines | UnitAI.prototype.SetupRangeQuery = function(enable = true) | ||||
if (!cmpPlayer) | if (!cmpPlayer) | ||||
return; | return; | ||||
// Exclude allies, and self | // Exclude allies, and self | ||||
// TODO: How to handle neutral players - Special query to attack military only? | // TODO: How to handle neutral players - Special query to attack military only? | ||||
var players = cmpPlayer.GetEnemies(); | var players = cmpPlayer.GetEnemies(); | ||||
var range = this.GetQueryRange(IID_Attack); | var range = this.GetQueryRange(IID_Attack); | ||||
this.losRangeQuery = cmpRangeManager.CreateActiveQuery(this.entity, range.min, range.max, players, IID_DamageReceiver, cmpRangeManager.GetEntityFlagMask("normal")); | this.losRangeQuery = cmpRangeManager.CreateActiveQuery(this.entity, range.min, range.max, players, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | ||||
if (enable) | if (enable) | ||||
cmpRangeManager.EnableActiveQuery(this.losRangeQuery); | cmpRangeManager.EnableActiveQuery(this.losRangeQuery); | ||||
}; | }; | ||||
// Set up a range query for all own or ally units within LOS range | // Set up a range query for all own or ally units within LOS range | ||||
// which can be healed. | // which can be healed. | ||||
// This should be called whenever our ownership changes. | // This should be called whenever our ownership changes. | ||||
▲ Show 20 Lines • Show All 2,558 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Missing check ? I guess you can't use let here.