This commit is contained in:
yuexin 2020-12-10 13:30:54 +08:00
commit 5e7e2ed27a
2 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import {singleton} from "../../common/Singleton";
import {GameEnv} from "../../cfg/GameEnv";
import {debugRoom} from "../../common/Debug";
import {TurnEndCommand} from "./TurnEndCommand";
import {Card} from "../schema/Card";
/**
*
@ -72,6 +73,8 @@ export class DiscardCommand extends Command<CardGameState, { client: Client, car
if (cards.length === 1) {
return [new NextSubCommand()];
} else {
let cardArr: Card[] = [...this.state.cards.values()];
this.room.battleMan.onCardLinkOver(player, cardArr);
this.state.gameState = GameStateConst.STATE_PICK_PET;
let self = this;
let time = singleton(GameEnv).playerActTime * 1000 + player.extraTime;

View File

@ -11,7 +11,7 @@ export class PlayReadyCommand extends Command<CardGameState, {
client: Client
}> {
execute({client}: { client: Client }) {
async execute({client}: { client: Client }) {
this.state.players.get(client.sessionId).state = PlayerStateConst.PLAYER_READY;
this.room.broadcast("player_ready_s2c", {player: client.sessionId}, {except: client});
let readyCount = 0;
@ -24,6 +24,7 @@ export class PlayReadyCommand extends Command<CardGameState, {
if (readyCount >= this.room.maxClients) {
// 比大小, 确定先手
// return [new PrepareCommand()];
await this.room.setPrivate(true);
this.room.state.gameState = GameStateConst.CHANGE_HERO;
}