Differential D2150 Diff 17818 ps/trunk/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
Show First 20 Lines • Show All 720 Lines • ▼ Show 20 Lines | for (let trainable of allTrainable) | ||||
if (this.isTemplateDisabled(trainable)) | if (this.isTemplateDisabled(trainable)) | ||||
continue; | continue; | ||||
let template = this.getTemplate(trainable); | let template = this.getTemplate(trainable); | ||||
if (!template || !template.available(this)) | if (!template || !template.available(this)) | ||||
continue; | continue; | ||||
let limit = template.matchLimit(); | let limit = template.matchLimit(); | ||||
if (matchCounts && limit && matchCounts[trainable] >= limit) | if (matchCounts && limit && matchCounts[trainable] >= limit) | ||||
continue; | continue; | ||||
if (classes.some(c => !template.hasClass(c))) | if (!template.hasClasses(classes) || template.hasClasses(anticlasses)) | ||||
continue; | |||||
if (anticlasses.some(c => template.hasClass(c))) | |||||
continue; | continue; | ||||
let category = template.trainingCategory(); | let category = template.trainingCategory(); | ||||
if (category && limits[category] && current[category] >= limits[category]) | if (category && limits[category] && current[category] >= limits[category]) | ||||
continue; | continue; | ||||
ret.push([trainable, template]); | ret.push([trainable, template]); | ||||
} | } | ||||
return ret; | return ret; | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator