1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-08 01:01:04 -09:00

[BBD] Khorvath's Fury - fixed game error on empty hand (possible fix of )

This commit is contained in:
Oleg Agafonov 2023-04-19 18:30:11 +04:00
parent bca2711535
commit 491fc560e8
4 changed files with 9 additions and 6 deletions

View file

@ -62,8 +62,8 @@ class DarkDealEffect extends OneShotEffect {
Player player = game.getPlayer(playerId);
if (player != null) {
int cardsInHand = player.getHand().size();
player.discard(cardsInHand, false, false, source, game);
if (cardsInHand > 1) {
player.discard(cardsInHand, false, false, source, game);
cardsToDraw.put(playerId, cardsInHand - 1);
}
}

View file

@ -66,8 +66,10 @@ class ForgottenCreationEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int cardsInHand = controller.getHand().size();
controller.discard(cardsInHand, false, false, source, game);
controller.drawCards(cardsInHand, source, game);
if (cardsInHand > 0) {
controller.discard(cardsInHand, false, false, source, game);
controller.drawCards(cardsInHand, source, game);
}
return true;
}
return false;

View file

@ -83,8 +83,8 @@ class IncendiaryCommandDrawEffect extends OneShotEffect {
Player player = game.getPlayer(playerId);
if (player != null) {
int cardsInHand = player.getHand().size();
player.discard(cardsInHand, false, false, source, game);
if (cardsInHand > 0) {
player.discard(cardsInHand, false, false, source, game);
cardsToDraw.put(playerId, cardsInHand);
}
}

View file

@ -67,15 +67,16 @@ class KhorvathsFuryEffect extends OneShotEffect {
for (Player player : choice.getFriends()) {
if (player != null) {
int cardsInHand = player.getHand().size();
player.discard(cardsInHand, false, false, source, game);
if (cardsInHand > 0) {
player.discard(cardsInHand, false, false, source, game);
cardsToDraw.put(player.getId(), cardsInHand);
}
}
}
for (Player player : choice.getFriends()) {
if (player != null) {
player.drawCards(cardsToDraw.get(player.getId()) + 1, source, game);
// If a friend has zero cards in hand, that player discards nothing and draws one card. (2018-06-08)
player.drawCards(cardsToDraw.getOrDefault(player.getId(), 0) + 1, source, game);
}
}
for (Player player : choice.getFoes()) {