更新配表的字段名
This commit is contained in:
parent
12cfa01e29
commit
b3fceda525
@ -2,6 +2,7 @@
|
||||
{
|
||||
"id": 20011,
|
||||
"type_id": 1,
|
||||
"count": 20,
|
||||
"eff1_id": 41011,
|
||||
"eff2_id": 0,
|
||||
"eff3_id": 0,
|
||||
@ -11,6 +12,7 @@
|
||||
{
|
||||
"id": 20021,
|
||||
"type_id": 1,
|
||||
"count": 20,
|
||||
"eff1_id": 41021,
|
||||
"eff2_id": 40131,
|
||||
"eff3_id": 0,
|
||||
@ -20,6 +22,7 @@
|
||||
{
|
||||
"id": 20031,
|
||||
"type_id": 1,
|
||||
"count": 15,
|
||||
"eff1_id": 41031,
|
||||
"eff2_id": 0,
|
||||
"eff3_id": 0,
|
||||
@ -29,6 +32,7 @@
|
||||
{
|
||||
"id": 20041,
|
||||
"type_id": 1,
|
||||
"count": 25,
|
||||
"eff1_id": 41041,
|
||||
"eff2_id": 40151,
|
||||
"eff3_id": 40161,
|
||||
@ -38,6 +42,7 @@
|
||||
{
|
||||
"id": 20051,
|
||||
"type_id": 1,
|
||||
"count": 25,
|
||||
"eff1_id": 41051,
|
||||
"eff2_id": 40171,
|
||||
"eff3_id": 0,
|
||||
@ -47,6 +52,7 @@
|
||||
{
|
||||
"id": 20061,
|
||||
"type_id": 1,
|
||||
"count": 20,
|
||||
"eff1_id": 41061,
|
||||
"eff2_id": 40181,
|
||||
"eff3_id": 0,
|
||||
@ -56,6 +62,7 @@
|
||||
{
|
||||
"id": 20071,
|
||||
"type_id": 2,
|
||||
"count": 20,
|
||||
"eff1_id": 40191,
|
||||
"eff2_id": 0,
|
||||
"eff3_id": 0,
|
||||
@ -65,10 +72,11 @@
|
||||
{
|
||||
"id": 20081,
|
||||
"type_id": 2,
|
||||
"count": 15,
|
||||
"eff1_id": 40201,
|
||||
"eff2_id": 0,
|
||||
"eff3_id": 0,
|
||||
"eff4_id": 0,
|
||||
"eff5_id": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -13,12 +13,12 @@ export class BaseCfg implements Cfg{
|
||||
/**
|
||||
* 数值类型
|
||||
*/
|
||||
public valueType: number;
|
||||
public type_id: number;
|
||||
|
||||
public decode(data: any) {
|
||||
this.id = data.id;
|
||||
this.value = data.value;
|
||||
this.valueType = data.type_id;
|
||||
this.type_id = data.type_id;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ import {Cfg} from "../../common/DataParser";
|
||||
|
||||
export class EffectCardCfg implements Cfg{
|
||||
public id: number;
|
||||
public maxCount: number;
|
||||
public count: number;
|
||||
public type_id: number;
|
||||
public eff1_id: number;
|
||||
public eff2_id: number;
|
||||
@ -19,6 +19,6 @@ export class EffectCardCfg implements Cfg{
|
||||
this.eff3_id = data.eff3_id;
|
||||
this.eff4_id = data.eff4_id;
|
||||
this.eff5_id = data.eff5_id;
|
||||
this.maxCount = 20;
|
||||
this.count = data.count;
|
||||
}
|
||||
}
|
||||
|
@ -2,14 +2,14 @@ import {Cfg} from "../../common/DataParser";
|
||||
|
||||
export class SystemCardCfg implements Cfg {
|
||||
public id: number;
|
||||
public typeId: number;
|
||||
public type_id: number;
|
||||
public count: number;
|
||||
public point: number;
|
||||
public weight: string;
|
||||
public weightArr: number[][];
|
||||
public decode(data: any) {
|
||||
this.id = data.id;
|
||||
this.typeId = data.type_id;
|
||||
this.type_id = data.type_id;
|
||||
this.point = data.point;
|
||||
this.count = data.count;
|
||||
this.weight = data.weight;
|
||||
|
@ -19,12 +19,12 @@ let gameUtil = {
|
||||
let localId = 1;
|
||||
for (let [id, cfg] of numCfgMap) {
|
||||
for (let i = 0; i < cfg.count; i++) {
|
||||
if (cfg.typeId == 1) {
|
||||
if (cfg.type_id == 1) {
|
||||
let effid = this.getRandomEffect(cfg.weightArr, effCfgMap, countMap);
|
||||
let card = new Card(localId ++, cfg.point, cfg.typeId, effid);
|
||||
let card = new Card(localId ++, cfg.point, cfg.type_id, effid);
|
||||
cards.push(card);
|
||||
} else {
|
||||
let card = new Card(localId ++, cfg.point, cfg.typeId, 0);
|
||||
let card = new Card(localId ++, cfg.point, cfg.type_id, 0);
|
||||
cards.push(card);
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ let gameUtil = {
|
||||
for (let data of tmpArr) {
|
||||
if (data[1] >= num ) {
|
||||
let count = countMap.has(data[0]) ? countMap.get(data[0]) : 0;
|
||||
if (count < effCfgMap.get(data[0]).maxCount) {
|
||||
if (count < effCfgMap.get(data[0]).count) {
|
||||
effid = effCfgMap.get(data[0]).id;
|
||||
countMap.set(effid, count + 1);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user