Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/UnitAI.js
Show First 20 Lines • Show All 4,678 Lines • ▼ Show 20 Lines | |||||
UnitAI.prototype.GetBestAttackAgainst = function(target, allowCapture) | UnitAI.prototype.GetBestAttackAgainst = function(target, allowCapture) | ||||
{ | { | ||||
var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); | var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); | ||||
if (!cmpAttack) | if (!cmpAttack) | ||||
return undefined; | return undefined; | ||||
return cmpAttack.GetBestAttackAgainst(target, allowCapture); | return cmpAttack.GetBestAttackAgainst(target, allowCapture); | ||||
}; | }; | ||||
UnitAI.prototype.GetAttackBonus = function(type, target) | |||||
{ | |||||
var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); | |||||
if (!cmpAttack) | |||||
return 1; | |||||
return cmpAttack.GetAttackBonus(type, target); | |||||
}; | |||||
elexis: Agree that it's useless. Confirming that it's currently unused as well (so it could be nuked in… | |||||
/** | /** | ||||
* Try to find one of the given entities which can be attacked, | * Try to find one of the given entities which can be attacked, | ||||
* and start attacking it. | * and start attacking it. | ||||
* Returns true if it found something to attack. | * Returns true if it found something to attack. | ||||
*/ | */ | ||||
UnitAI.prototype.AttackVisibleEntity = function(ents, forceResponse) | UnitAI.prototype.AttackVisibleEntity = function(ents, forceResponse) | ||||
{ | { | ||||
var target = ents.find(target => this.CanAttack(target, forceResponse)); | var target = ents.find(target => this.CanAttack(target, forceResponse)); | ||||
▲ Show 20 Lines • Show All 1,437 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Agree that it's useless. Confirming that it's currently unused as well (so it could be nuked in a separate commit if one feels like it)