吃牌后删除目标玩家的出牌队列
This commit is contained in:
parent
cc48656536
commit
1dd88339c1
@ -133,7 +133,7 @@ Object.defineProperties(Room.prototype, {
|
|||||||
sourceP.statData.inc(StateTypeEnum.DMG, Math.min(-hp, player.hp));
|
sourceP.statData.inc(StateTypeEnum.DMG, Math.min(-hp, player.hp));
|
||||||
player.statData.inc(StateTypeEnum.TDMG, Math.min(-hp, player.hp));
|
player.statData.inc(StateTypeEnum.TDMG, Math.min(-hp, player.hp));
|
||||||
}
|
}
|
||||||
debugRoom(`更新血量: ${player.id} ${player.hp} -> ${hp}, reason: ${reason}`);
|
debugRoom(`更新血量: ${player.id} ${player.hp} -> ${hp}, reason: ${reason}, from: ${fromplayer}`);
|
||||||
if (dstHp <= 0) {
|
if (dstHp <= 0) {
|
||||||
dstHp = 0;
|
dstHp = 0;
|
||||||
this.dispatcher.dispatch(new PlayDeadCommand(), {player: player});
|
this.dispatcher.dispatch(new PlayDeadCommand(), {player: player});
|
||||||
|
@ -57,7 +57,10 @@ export class DiscardCommand extends Command<CardGameState, { client: Client, car
|
|||||||
this.room.send(client,'discard_card_s2c', {errcode: 5, errmsg: '找不到要吃的牌'});
|
this.room.send(client,'discard_card_s2c', {errcode: 5, errmsg: '找不到要吃的牌'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tmpCards = tmpCards.concat(...this.state.cards.values())
|
let targetCard = this.state.cards.values().next().value.clone()
|
||||||
|
let targetPlayer = this.state.players.get(targetCard.owner)
|
||||||
|
targetPlayer?.cardQueue.clear()
|
||||||
|
tmpCards.push(targetCard)
|
||||||
if (!gameUtil.checkDiscard(tmpCards, new GameEnv().otherEatCount)) {
|
if (!gameUtil.checkDiscard(tmpCards, new GameEnv().otherEatCount)) {
|
||||||
this.room.send(client,'discard_card_s2c', {errcode: 4, errmsg: '出牌不符合规则'});
|
this.room.send(client,'discard_card_s2c', {errcode: 4, errmsg: '出牌不符合规则'});
|
||||||
return;
|
return;
|
||||||
|
@ -178,7 +178,9 @@ let assistantUtil = {
|
|||||||
|
|
||||||
for (let card of cards) {
|
for (let card of cards) {
|
||||||
if (card.type == CardType.variable_unit) {
|
if (card.type == CardType.variable_unit) {
|
||||||
|
if (dstPlayer.unitCfgs.has(card.effect + '')) {
|
||||||
petCards.push(card);
|
petCards.push(card);
|
||||||
|
}
|
||||||
} else if (card.type == CardType.general) {
|
} else if (card.type == CardType.general) {
|
||||||
spellCards.push(card);
|
spellCards.push(card);
|
||||||
}
|
}
|
||||||
|
@ -239,6 +239,7 @@ let gameUtil = {
|
|||||||
if (card.type == CardType.variable_unit && effectMap.get(card.effect).type_id == EffectType.variable_unit) {
|
if (card.type == CardType.variable_unit && effectMap.get(card.effect).type_id == EffectType.variable_unit) {
|
||||||
card.effect = this.getRandomServant(player);
|
card.effect = this.getRandomServant(player);
|
||||||
}
|
}
|
||||||
|
card.owner = player.id
|
||||||
realCards.push(card)
|
realCards.push(card)
|
||||||
player.cards.set(card.id + '', card);
|
player.cards.set(card.id + '', card);
|
||||||
player.cardSet.add(card.id + '');
|
player.cardSet.add(card.id + '');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user