- Fixed the cost "discard your hand" not allowing to order the cards going to graveyard when and if needed.

This commit is contained in:
Agetian
2018-01-24 16:41:12 +03:00
parent b3f1bad6b7
commit bfef8b125c
2 changed files with 7 additions and 1 deletions

View File

@@ -63,8 +63,8 @@ public class AiCostDecision extends CostDecisionMakerBase {
@Override @Override
public PaymentDecision visit(CostDiscard cost) { public PaymentDecision visit(CostDiscard cost) {
final String type = cost.getType(); final String type = cost.getType();
CardCollectionView hand = player.getCardsIn(ZoneType.Hand);
final CardCollectionView hand = player.getCardsIn(ZoneType.Hand);
if (type.equals("LastDrawn")) { if (type.equals("LastDrawn")) {
if (!hand.contains(player.getLastDrawnCard())) { if (!hand.contains(player.getLastDrawnCard())) {
return null; return null;
@@ -79,6 +79,9 @@ public class AiCostDecision extends CostDecisionMakerBase {
return PaymentDecision.card(source); return PaymentDecision.card(source);
} }
else if (type.equals("Hand")) { else if (type.equals("Hand")) {
if (ability.getActivatingPlayer() != null) {
hand = ability.getActivatingPlayer().getController().orderMoveToZoneList(hand, ZoneType.Graveyard);
}
return PaymentDecision.card(hand); return PaymentDecision.card(hand);
} }

View File

@@ -91,6 +91,9 @@ public class HumanCostDecision extends CostDecisionMakerBase {
} }
if (discardType.equals("Hand")) { if (discardType.equals("Hand")) {
if (ability.getActivatingPlayer() != null) {
hand = ability.getActivatingPlayer().getController().orderMoveToZoneList(hand, ZoneType.Graveyard);
}
return PaymentDecision.card(hand); return PaymentDecision.card(hand);
} }