Add troopers training

This commit is contained in:
2020-04-19 16:26:49 +03:00
parent 2bad0e1b5d
commit 500e266517
10 changed files with 189 additions and 116 deletions

View File

@ -10,11 +10,18 @@ import { path } from '../utils';
export class TrainTroopTask extends TaskController {
async run(task: Task) {
const args: Args = { ...task.args, taskId: task.id };
const pathArgs = {
newdid: args.villageId,
gid: args.buildTypeId || undefined,
id: args.buildId || undefined,
s: args.tabId,
};
const pagePath = path('/build.php', pathArgs);
this.scheduler.scheduleActions([
new Command(GoToPageAction.name, {
...args,
path: path('/build.php', { newdid: args.villageId, id: args.buildId }),
}),
new Command(GoToPageAction.name, { ...args, path: pagePath }),
new Command(TrainTrooperAction.name, args),
new Command(CompleteTaskAction.name, args),
]);