修正系统卡数量字段读取错误的bug

This commit is contained in:
zhl 2021-02-26 14:15:37 +08:00
parent 94ac572a64
commit c77f930f02
2 changed files with 5 additions and 5 deletions

View File

@ -7,8 +7,8 @@ export class SystemCardCfg implements Cfg {
public point: number; public point: number;
public weight: string; public weight: string;
public weightArr: number[][]; public weightArr: number[][];
public primaryaccess: number; public primarycount: number;
public intermediateaccess: number; public intermediatecount: number;
public decode(data: any) { public decode(data: any) {
this.id = data.id; this.id = data.id;
this.type_id = data.type_id; this.type_id = data.type_id;
@ -21,7 +21,7 @@ export class SystemCardCfg implements Cfg {
let subArr = str.split(':'); let subArr = str.split(':');
this.weightArr.push([parseInt(subArr[0]), parseInt(subArr[1])]); this.weightArr.push([parseInt(subArr[0]), parseInt(subArr[1])]);
} }
this.primaryaccess = data.primaryaccess this.primarycount = data.primarycount
this.intermediateaccess = data.intermediateaccess this.intermediatecount = data.intermediatecount
} }
} }

View File

@ -24,7 +24,7 @@ let gameUtil = {
let countMap: Map<number, number> = new Map() let countMap: Map<number, number> = new Map()
let localId = beginNum let localId = beginNum
for (let [, cfg] of numCfgMap) { for (let [, cfg] of numCfgMap) {
let count = advMode ? cfg.intermediateaccess : cfg.primaryaccess let count = advMode ? cfg.intermediatecount : cfg.primarycount
for (let i = 0; i < count; i++) { for (let i = 0; i < count; i++) {
let [effid, effType] = this.getRandomEffect(cfg.weightArr, effCfgMap, countMap, advMode) let [effid, effType] = this.getRandomEffect(cfg.weightArr, effCfgMap, countMap, advMode)