Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/entityExtend.js
/** returns true if this unit should be considered as a siege unit */ | /** returns true if this unit should be considered as a siege unit */ | ||||
PETRA.isSiegeUnit = function(ent) | PETRA.isSiegeUnit = function(ent) | ||||
{ | { | ||||
return ent.hasClass("Siege") || ent.hasClass("Elephant") && ent.hasClass("Melee") && ent.hasClass("Champion"); | return ent.hasClass("Siege") || ent.hasClass("Elephant") && ent.hasClass("Melee") && ent.hasClass("Champion"); | ||||
}; | }; | ||||
/** returns true if this unit should be considered as "fast". */ | |||||
PETRA.isFastMoving = function(ent) | |||||
{ | |||||
// TODO: use clever logic based on walkspeed comparisons. | |||||
return ent.hasClass("FastMoving"); | |||||
}; | |||||
/** returns some sort of DPS * health factor. If you specify a class, it'll use the modifiers against that class too. */ | /** returns some sort of DPS * health factor. If you specify a class, it'll use the modifiers against that class too. */ | ||||
PETRA.getMaxStrength = function(ent, debugLevel, DamageTypeImportance, againstClass) | PETRA.getMaxStrength = function(ent, debugLevel, DamageTypeImportance, againstClass) | ||||
{ | { | ||||
let strength = 0; | let strength = 0; | ||||
let attackTypes = ent.attackTypes(); | let attackTypes = ent.attackTypes(); | ||||
let damageTypes = Object.keys(DamageTypeImportance); | let damageTypes = Object.keys(DamageTypeImportance); | ||||
if (!attackTypes) | if (!attackTypes) | ||||
return strength; | return strength; | ||||
▲ Show 20 Lines • Show All 402 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator