pvp: 更改pvpdefense结构

This commit is contained in:
luying
2021-10-26 11:23:08 +08:00
parent 4a5e23969b
commit e39b120af4
31 changed files with 1542 additions and 1137 deletions

View File

@@ -1,23 +0,0 @@
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicGkPvp {
readonly war_id: number;
readonly dispatchJsonId: number;
readonly bg_img_id: number;
readonly warType: number;
}
export const dicGkPvp = new Map<number, DicGkPvp>();
export const dicGkPvps = new Array<number>();
export function loadGkPvp() {
dicGkPvp.clear();
dicGkPvps.splice(0, dicGkPvps.length);
let arr = readFileAndParse(FILENAME.DIC_GK_PVP);
arr.forEach(o => {
dicGkPvp.set(o.war_id, o);
dicGkPvps.push(o.war_id);
});
arr = undefined;
}

View File

@@ -1,5 +1,5 @@
// 关卡表
import {decodeArrayListStr, readWarJsonFileAndParse} from '../util'
import {decodeArrayListStr, parseNumberList, readWarJsonFileAndParse} from '../util'
export interface DicWarJson {
@@ -47,6 +47,8 @@ export interface DicWarJson {
readonly callSkillData: string;
// 敌军数量
readonly enemyCount: number;
// pvp中随机敌军
readonly randomEnemy: number[];
}
export const dicWarJson = new Map<number, Array<DicWarJson>>();
@@ -63,6 +65,7 @@ export function loadWarJson() {
if(o.relation == 2) enemyCount++;
});
arr.forEach(o => {
o.randomEnemy = parseNumberList(o.randomEnemy);
o.enemyCount = enemyCount;
warjson.push(o);
});