弃牌重新加入牌组
This commit is contained in:
@@ -1793,6 +1793,7 @@ namespace TcgEngine.Gameplay
|
||||
}
|
||||
}
|
||||
|
||||
// 换牌
|
||||
public virtual void Mulligan(Player player, string[] cards)
|
||||
{
|
||||
if (game_data.phase == GamePhase.Mulligan && !player.ready)
|
||||
@@ -1808,14 +1809,24 @@ namespace TcgEngine.Gameplay
|
||||
}
|
||||
}
|
||||
|
||||
// 将换掉的卡牌临时存储,不放入弃牌堆
|
||||
List<Card> mulligan_cards = new List<Card>();
|
||||
foreach (Card card in remove_list)
|
||||
{
|
||||
player.RemoveCardFromAllGroups(card);
|
||||
player.cards_discard.Add(card);
|
||||
mulligan_cards.Add(card);
|
||||
}
|
||||
|
||||
player.ready = true;
|
||||
DrawCard(player, count);
|
||||
|
||||
// 将换掉的卡牌重新加入牌组并洗牌
|
||||
foreach (Card card in mulligan_cards)
|
||||
{
|
||||
player.cards_deck.Add(card);
|
||||
}
|
||||
ShuffleDeck(player.cards_deck);
|
||||
|
||||
RefreshData();
|
||||
|
||||
if (game_data.AreAllPlayersReady())
|
||||
|
||||
Reference in New Issue
Block a user