Fixed Borne Far Away (and other "exchange card in hand for X" effects) permitting the exchange with no actual valid target in hand, resulting in a free transfer to hand.
This commit is contained in:
@@ -50,6 +50,13 @@ public class ExchangeCardsInHandWithCardsInDeadPile implements EffectAppenderPro
|
||||
return new AbstractEffect() {
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
|
||||
int hand = countHand.getEvaluator(actionContext).evaluateExpression(game, null);
|
||||
if(handCards.size() < hand) {
|
||||
game.getGameState().sendMessage(performingPlayer + " did not have " + hand + " card in hand to exchange.");
|
||||
return new FullEffectResult(false);
|
||||
}
|
||||
|
||||
Set<PhysicalCard> cardsToRemove = new HashSet<>();
|
||||
cardsToRemove.addAll(handCards);
|
||||
cardsToRemove.addAll(deadPileCards);
|
||||
@@ -66,7 +73,8 @@ public class ExchangeCardsInHandWithCardsInDeadPile implements EffectAppenderPro
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return true;
|
||||
int hand = countHand.getEvaluator(actionContext).evaluateExpression(game, null);
|
||||
return handCards.size() >= hand;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -48,6 +48,12 @@ public class ExchangeCardsInHandWithCardsInDiscard implements EffectAppenderProd
|
||||
return new AbstractEffect() {
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
int hand = countHand.getEvaluator(actionContext).evaluateExpression(game, null);
|
||||
if(handCards.size() < hand) {
|
||||
game.getGameState().sendMessage(performingPlayer + " did not have " + hand + " card in hand to exchange.");
|
||||
return new FullEffectResult(false);
|
||||
}
|
||||
|
||||
Set<PhysicalCard> cardsToRemove = new HashSet<>();
|
||||
cardsToRemove.addAll(handCards);
|
||||
cardsToRemove.addAll(discardCards);
|
||||
@@ -64,7 +70,8 @@ public class ExchangeCardsInHandWithCardsInDiscard implements EffectAppenderProd
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return true;
|
||||
int hand = countHand.getEvaluator(actionContext).evaluateExpression(game, null);
|
||||
return handCards.size() >= hand;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -53,6 +53,12 @@ public class ExchangeCardsInHandWithCardsStacked implements EffectAppenderProduc
|
||||
return new AbstractEffect() {
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
int hand = countHand.getEvaluator(actionContext).evaluateExpression(game, null);
|
||||
if(handCards.size() < hand) {
|
||||
game.getGameState().sendMessage(performingPlayer + " did not have " + hand + " card in hand to exchange.");
|
||||
return new FullEffectResult(false);
|
||||
}
|
||||
|
||||
Set<PhysicalCard> cardsToRemove = new HashSet<>();
|
||||
cardsToRemove.addAll(handCards);
|
||||
cardsToRemove.addAll(stackedCards);
|
||||
@@ -69,7 +75,8 @@ public class ExchangeCardsInHandWithCardsStacked implements EffectAppenderProduc
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return true;
|
||||
int hand = countHand.getEvaluator(actionContext).evaluateExpression(game, null);
|
||||
return handCards.size() >= hand;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user