diff --git a/src/global.d.ts b/src/global.d.ts index f26cbe2..fda3e45 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -169,7 +169,7 @@ declare module "colyseus" { * @param source 0: 正常抽卡, 1: 技能 * @param fromplayer */ - addCard(dstplayer: string, count: number, max_count: number, source: number = 0, fromplayer?: string): boolean; + addCard(dstplayer: string, count: number, max_count: number, source?: number, fromplayer?: string): boolean; /** * 更新玩家血量 diff --git a/src/rooms/commands/NextTurnCommand.ts b/src/rooms/commands/NextTurnCommand.ts index 1ea9bd3..8634964 100644 --- a/src/rooms/commands/NextTurnCommand.ts +++ b/src/rooms/commands/NextTurnCommand.ts @@ -13,7 +13,7 @@ import {GameEnv} from "../../cfg/GameEnv"; */ export class NextTurnCommand extends Command { - async execute() { + async execute(){ this.state.gameState = GameStateConst.STATE_BEGIN_DRAW; const sessionIds = [...this.state.players.keys()]; if (!this.state.currentTurn) { diff --git a/src/rooms/commands/PartResultCommand.ts b/src/rooms/commands/PartResultCommand.ts index 5afc015..c47de9c 100644 --- a/src/rooms/commands/PartResultCommand.ts +++ b/src/rooms/commands/PartResultCommand.ts @@ -91,7 +91,7 @@ const comparePlayer = function (room: Room, p0: Player, p1: Player): CompareResu } export class PartResultCommand extends Command { - execute() { + execute() : Array | void { this.state.gameState = GameStateConst.STATE_ROUND_RESULT; const time = singleton(GameEnv).resultShowTime || 1; diff --git a/src/rooms/commands/TurnEndCommand.ts b/src/rooms/commands/TurnEndCommand.ts index 26638d4..cea183e 100644 --- a/src/rooms/commands/TurnEndCommand.ts +++ b/src/rooms/commands/TurnEndCommand.ts @@ -11,7 +11,7 @@ import {GameResultCommand} from "./GameResultCommand"; */ export class TurnEndCommand extends Command { - execute() { + execute() : Array | void{ // @ts-ignore const sessionIds = [...this.state.players.keys()]; if (this.state.currentTurn) {