Merge branch 'second' of http://git.kingsome.cn/node/card_svr into second
This commit is contained in:
commit
c8ca529141
25
src/cfg/enums/CardType.ts
Normal file
25
src/cfg/enums/CardType.ts
Normal file
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* 卡牌类型
|
||||
*/
|
||||
export const enum CardType {
|
||||
/**
|
||||
* 普通的点数卡
|
||||
*/
|
||||
general = 1,
|
||||
/**
|
||||
* 效果翻倍
|
||||
*/
|
||||
double_effect = 2,
|
||||
/**
|
||||
* 点数翻倍
|
||||
*/
|
||||
double_point = 3,
|
||||
/**
|
||||
* 万能点数
|
||||
*/
|
||||
variable_point = 4,
|
||||
/**
|
||||
* 可变随从
|
||||
*/
|
||||
variable_unit = 11,
|
||||
}
|
30
src/cfg/enums/EffectType.ts
Normal file
30
src/cfg/enums/EffectType.ts
Normal 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,
|
||||
|
||||
}
|
@ -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});
|
||||
|
@ -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){
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user