Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/baseManager.js
Show First 20 Lines • Show All 644 Lines • ▼ Show 20 Lines | if (ent.hasClass("Worker")) | ||||
continue; | continue; | ||||
ent.setMetadata(PlayerID, "subrole", "gatherer"); | ent.setMetadata(PlayerID, "subrole", "gatherer"); | ||||
ent.setMetadata(PlayerID, "gather-type", needed.type); | ent.setMetadata(PlayerID, "gather-type", needed.type); | ||||
gameState.ai.HQ.AddTCResGatherer(needed.type); | gameState.ai.HQ.AddTCResGatherer(needed.type); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
else if (ent.hasClass("Cavalry")) | else if (PETRA.isFastMoving(ent)) | ||||
ent.setMetadata(PlayerID, "subrole", "hunter"); | ent.setMetadata(PlayerID, "subrole", "hunter"); | ||||
else if (ent.hasClass("FishingBoat")) | else if (ent.hasClass("FishingBoat")) | ||||
ent.setMetadata(PlayerID, "subrole", "fisher"); | ent.setMetadata(PlayerID, "subrole", "fisher"); | ||||
} | } | ||||
}; | }; | ||||
PETRA.BaseManager.prototype.workersBySubrole = function(gameState, subrole) | PETRA.BaseManager.prototype.workersBySubrole = function(gameState, subrole) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 445 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator