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