效果卡和点数翻倍卡也带上效果id

This commit is contained in:
zhl 2020-12-10 20:40:04 +08:00
parent 2275361655
commit de583e3351
2 changed files with 13 additions and 10 deletions

View File

@ -40,5 +40,5 @@ gameServer.define('general_room', GeneralRoom);
// register colyseus monitor AFTER registering your room handlers
app.use("/colyseus", monitor());
gameServer.listen(port);
gameServer.listen(port).then(()=>{});
console.log(`Listening on ws://localhost:${ port }`)

View File

@ -19,16 +19,19 @@ let gameUtil = {
let countMap: Map<number, number> = new Map();
let localId = 1;
for (let [id, cfg] of numCfgMap) {
for (let [, cfg] of numCfgMap) {
for (let i = 0; i < cfg.count; i++) {
if (cfg.type_id == 1) {
let effid = this.getRandomEffect(cfg.weightArr, effCfgMap, countMap);
let card = new Card(localId ++, cfg.point, cfg.type_id, effid);
cards.push(card);
} else {
let card = new Card(localId ++, cfg.point, cfg.type_id, 0);
cards.push(card);
}
let effid = this.getRandomEffect(cfg.weightArr, effCfgMap, countMap);
let card = new Card(localId ++, cfg.point, cfg.type_id, effid);
cards.push(card);
// if (cfg.type_id == 1) {
// let effid = this.getRandomEffect(cfg.weightArr, effCfgMap, countMap);
// let card = new Card(localId ++, cfg.point, cfg.type_id, effid);
// cards.push(card);
// } else {
// let card = new Card(localId ++, cfg.point, cfg.type_id, 0);
// cards.push(card);
// }
}
}