- Attached cards to sites (played on) are now discarded when a site is liberated.

This commit is contained in:
marcins78@gmail.com
2011-11-08 20:19:26 +00:00
parent 066552479e
commit 27b0a65751
2 changed files with 17 additions and 4 deletions

View File

@@ -6,8 +6,12 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.timing.AbstractEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.results.DiscardCardsFromPlayResult;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class LiberateASiteEffect extends AbstractEffect {
private PhysicalCard _source;
@@ -50,15 +54,23 @@ public class LiberateASiteEffect extends AbstractEffect {
protected FullEffectResult playEffectReturningResult(LotroGame game) {
PhysicalCard siteToLiberate = getSiteToLiberate(game);
if (siteToLiberate != null) {
Set<PhysicalCard> cardsToRemove = new HashSet<PhysicalCard>();
Set<PhysicalCard> discardedCards = new HashSet<PhysicalCard>();
List<PhysicalCard> stackedCards = game.getGameState().getStackedCards(siteToLiberate);
game.getGameState().removeCardsFromZone(_source.getOwner(), stackedCards);
for (PhysicalCard stackedCard : stackedCards)
game.getGameState().addCardToZone(game, stackedCard, Zone.DISCARD);
cardsToRemove.addAll(stackedCards);
List<PhysicalCard> attachedCards = game.getGameState().getAttachedCards(siteToLiberate);
cardsToRemove.addAll(attachedCards);
discardedCards.addAll(attachedCards);
game.getGameState().removeCardsFromZone(_source.getOwner(), cardsToRemove);
for (PhysicalCard removedCard : cardsToRemove)
game.getGameState().addCardToZone(game, removedCard, Zone.DISCARD);
game.getGameState().loseControlOfCard(siteToLiberate, Zone.ADVENTURE_PATH);
return new FullEffectResult(null, true, true);
return new FullEffectResult(Collections.singleton(new DiscardCardsFromPlayResult(discardedCards)), true, true);
}
return new FullEffectResult(null, false, false);
}

View File

@@ -2,6 +2,7 @@
<b>8 Nov. 2011</b>
- "Gathering to the Summons" adds burden instead of twilight now.
- "Rohirrim Village" will only not allow the Dunland Man to take wounds only in Archery phase.
- Attached cards to sites (played on) are now discarded when a site is liberated.
<b>7 Nov. 2011</b>
- "My Axe Is Notched" and "Final Count" should properly grant their strength bonuses now.