Merge branch 'second' of http://git.kingsome.cn/node/card_svr into second

This commit is contained in:
yuexin 2020-12-23 11:34:21 +08:00
commit c8ca529141
5 changed files with 62 additions and 5 deletions

25
src/cfg/enums/CardType.ts Normal file
View File

@ -0,0 +1,25 @@
/**
*
*/
export const enum CardType {
/**
*
*/
general = 1,
/**
*
*/
double_effect = 2,
/**
*
*/
double_point = 3,
/**
*
*/
variable_point = 4,
/**
*
*/
variable_unit = 11,
}

View File

@ -0,0 +1,30 @@
/**
*
*/
export const enum EffectType {
/**
*
*/
unit = 1,
/**
*
*/
skill = 2,
/**
*
*/
double_effect = 3,
/**
*
*/
double_point = 4,
/**
*
*/
variable_point = 5,
/**
*
*/
variable_unit = 11,
}

View File

@ -112,7 +112,7 @@ Object.defineProperties(Room.prototype, {
if (player.state === PlayerStateConst.PLAYER_DEAD) {
return 0;
} else {
let dstHp = player.hp + hp;
let dstHp = player.hp + (hp | 0);
if (dstHp <= 0) {
dstHp = 0;
this.dispatcher.dispatch(new PlayDeadCommand(), {player: player});

View File

@ -26,11 +26,11 @@ export class SelectPetCommand extends Command<CardGameState, {client: Client,
let eff_cnt = 0; // 效果卡数量
let dbpt_cnt = 0; // 点数翻倍卡数量
let transCount = 0;
for (let cardId of effCards) {
if (!player.cards.has(cardId + '')) {
for (let eCardId of effCards) {
if (!player.cards.has(eCardId + '')) {
continue;
}
let card = player.cards.get(cardId + '');
let card = player.cards.get(eCardId + '');
if (card.type === 3) {
dbpt_cnt ++;
} else if (card.type === 2){

View File

@ -7,6 +7,7 @@ import CfgMan from "../rooms/logic/CfgMan";
import {CardGameState} from "../rooms/schema/CardGameState";
import {Player} from "../rooms/schema/Player";
import {HeroCfg} from "../cfg/parsers/HeroCfg";
import {EffectType} from "../cfg/enums/EffectType";
let assistantUtil = {
@ -150,7 +151,8 @@ let assistantUtil = {
// 优先取随从
for (let card of cards) {
let effect = effectMap.get(card.effect);
if (effect.type_id == 1 && dstPlayer.unitCfgs.has(card.effect + '')) {
// if (effect.type_id == EffectType.unit && dstPlayer.unitCfgs.has(card.effect + '')) {
if (effect.type_id == EffectType.unit) {
result = card;
break;
} else if (card.type == 1) {