远征:模板计算

This commit is contained in:
luying
2021-09-13 15:57:02 +08:00
parent 217f9b6368
commit 63d28d1233
3 changed files with 14 additions and 8 deletions
+7 -1
View File
@@ -45,7 +45,8 @@ export interface DicWarJson {
readonly enemyType: number;
// 召唤技能的召唤物
readonly callSkillData: string;
// 敌军数量
readonly enemyCount: number;
}
export const dicWarJson = new Map<number, Array<DicWarJson>>();
@@ -54,9 +55,14 @@ export function loadWarJson() {
let warjson = new Array<DicWarJson>();
let warid = 0;
let enemyCount = 0;
arr.forEach(o => {
o.attribute = parseAttribute(o.attribute);
if(o.warId) warid = o.warId;
if(o.relation == 2) enemyCount++;
});
arr.forEach(o => {
o.enemyCount = enemyCount;
warjson.push(o);
});
dicWarJson.set(warid, warjson);