From cc15c95ca35c3047139a21197c27d15eb01c25da Mon Sep 17 00:00:00 2001 From: zhl Date: Mon, 22 Feb 2021 11:09:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=83=E7=89=8C=E6=88=90=E5=8A=9F=E5=90=8E,?= =?UTF-8?q?=E5=B9=BF=E6=92=AD=E5=90=83=E7=89=8C=E6=88=90=E5=8A=9F=E6=B6=88?= =?UTF-8?q?=E6=81=AF,=20=E5=B9=B6=E5=A2=9E=E5=8A=A0=E8=A2=AB=E5=90=83?= =?UTF-8?q?=E7=9A=84=E7=8E=A9=E5=AE=B6=E7=9A=84id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/commands/DiscardCommand.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/rooms/commands/DiscardCommand.ts b/src/rooms/commands/DiscardCommand.ts index afd3ad6..a02e25c 100644 --- a/src/rooms/commands/DiscardCommand.ts +++ b/src/rooms/commands/DiscardCommand.ts @@ -48,6 +48,7 @@ export class DiscardCommand extends Command 1) { this.room.send(client,'discard_card_s2c', {errcode: 6, errmsg: '不符合吃牌规则'}); @@ -57,7 +58,7 @@ export class DiscardCommand extends Command o.id) let self = this; - this.room.send(client,'eat_card_s2c', {player: player.id, errcode: 0, errmsg: '', cards: cards}); + let cardMsg: any = {player: player.id, errcode: 0, errmsg: ''} + if (targetCard) { + cardMsg.target = targetCard.owner + } + this.room.broadcast('eat_card_s2c', cardMsg, {except: client}); + cardMsg.cards = cards; + this.room.send(client,'eat_card_s2c', cardMsg); let delay = this.room.battleMan.onCardLinkOver(player, cardArr); player.statData.inc(StateTypeEnum.EATCOUNT, 1); await this.delay(delay);