Differentiation between cards to be discarded callbacks and actual cards that were discarded callback.
This commit is contained in:
@@ -33,7 +33,12 @@ public class ChooseAndDiscardCardsFromPlayEffect extends ChooseActiveCardsEffect
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> cards) {
|
||||
_resultSubAction = new SubAction(_action);
|
||||
_resultSubAction.appendEffect(new DiscardCardsFromPlayEffect(_playerId, _action.getActionSource(), Filters.in(cards)));
|
||||
_resultSubAction.appendEffect(new DiscardCardsFromPlayEffect(_playerId, _action.getActionSource(), Filters.in(cards)) {
|
||||
@Override
|
||||
protected void forEachDiscardedByEffectCallback(Collection<PhysicalCard> discardedCards) {
|
||||
ChooseAndDiscardCardsFromPlayEffect.this.forEachDiscardedByEffectCallback(discardedCards);
|
||||
}
|
||||
});
|
||||
game.getActionsEnvironment().addActionToStack(_resultSubAction);
|
||||
cardsToBeDiscardedCallback(cards);
|
||||
}
|
||||
@@ -42,6 +47,10 @@ public class ChooseAndDiscardCardsFromPlayEffect extends ChooseActiveCardsEffect
|
||||
|
||||
}
|
||||
|
||||
protected void forEachDiscardedByEffectCallback(Collection<PhysicalCard> cards) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wasCarriedOut() {
|
||||
return super.wasCarriedOut() && _resultSubAction != null && _resultSubAction.wasCarriedOut();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Card13_111 extends AbstractEvent {
|
||||
action.appendCost(
|
||||
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 0, Integer.MAX_VALUE, Filters.owner(playerId), Culture.ORC, CardType.MINION) {
|
||||
@Override
|
||||
protected void cardsToBeDiscardedCallback(Collection<PhysicalCard> cards) {
|
||||
protected void forEachDiscardedByEffectCallback(Collection<PhysicalCard> cards) {
|
||||
if (cards.size() > 0)
|
||||
action.appendEffect(
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 3 * cards.size(), Culture.ORC, CardType.MINION));
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Card7_054 extends AbstractEvent {
|
||||
action.appendCost(
|
||||
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 0, Integer.MAX_VALUE, Culture.GOLLUM, CardType.CONDITION) {
|
||||
@Override
|
||||
protected void cardsToBeDiscardedCallback(Collection<PhysicalCard> cards) {
|
||||
protected void forEachDiscardedByEffectCallback(Collection<PhysicalCard> cards) {
|
||||
int count = cards.size();
|
||||
game.getModifiersEnvironment().addUntilEndOfPhaseModifier(
|
||||
new StrengthModifier(self, Filters.smeagol, count * 3), Phase.SKIRMISH);
|
||||
|
||||
@@ -65,6 +65,10 @@ public class DiscardCardsFromPlayEffect extends AbstractPreventableCardEffect {
|
||||
return "Discard " + getAppendedTextNames(cards);
|
||||
}
|
||||
|
||||
protected void forEachDiscardedByEffectCallback(Collection<PhysicalCard> discardedCards) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void playoutEffectOn(LotroGame game, Collection<PhysicalCard> cards) {
|
||||
Set<PhysicalCard> discardedCards = new HashSet<PhysicalCard>();
|
||||
@@ -92,5 +96,7 @@ public class DiscardCardsFromPlayEffect extends AbstractPreventableCardEffect {
|
||||
|
||||
for (PhysicalCard discardedCard : discardedCards)
|
||||
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(_source, discardedCard));
|
||||
|
||||
forEachDiscardedByEffectCallback(cards);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user