修改机器人出牌逻辑

This commit is contained in:
zhl 2020-12-23 11:36:17 +08:00
parent 7660a88d86
commit 7476613fbb

View File

@ -8,6 +8,7 @@ import {CardGameState} from "../rooms/schema/CardGameState";
import {Player} from "../rooms/schema/Player";
import {HeroCfg} from "../cfg/parsers/HeroCfg";
import {EffectType} from "../cfg/enums/EffectType";
import {CardType} from "../cfg/enums/CardType";
let assistantUtil = {
@ -21,7 +22,7 @@ let assistantUtil = {
let pointMap: Map<number, Card[]> = new Map();
let cardIdSet: Set<number> = new Set();
for (let c of cardArr) {
if (c.type !== 1) {
if (!(c.type == CardType.general || c.type == CardType.variable_unit)) {
continue;
}
if (pointMap.has(c.number)) {
@ -155,7 +156,7 @@ let assistantUtil = {
if (effect.type_id == EffectType.unit) {
result = card;
break;
} else if (card.type == 1) {
} else if (effect.type_id == EffectType.skill) {
spellCards.push(card);
}
}
@ -205,7 +206,7 @@ let assistantUtil = {
//TODO: 增加效果卡
let effCards: number[] = [];
for (let card of cards) {
if (card.type == 2 || card.type == 3) {
if (card.type == CardType.double_effect || card.type == CardType.double_point) {
effCards.push(card.id);
}
}