"Windows in a Stone Wall"

This commit is contained in:
marcins78@gmail.com
2011-10-08 01:29:43 +00:00
parent e2cf4d8d6e
commit a2e053166b
5 changed files with 112 additions and 4 deletions

View File

@@ -38,6 +38,8 @@ public class AttachPermanentAction extends AbstractCostToEffectAction {
private Effect _discardCardEffect;
private boolean _cardDiscarded;
private boolean _exertTarget;
public AttachPermanentAction(final LotroGame game, final PhysicalCard card, Filter filter, final Map<Filter, Integer> attachCostModifiers, final int twilightModifier) {
_source = card;
@@ -47,6 +49,11 @@ public class AttachPermanentAction extends AbstractCostToEffectAction {
new ChooseActiveCardEffect(null, card.getOwner(), "Attach " + card.getBlueprint().getName() + ". Choose target to attach to", filter) {
@Override
protected void cardSelected(PhysicalCard target) {
if (_exertTarget) {
appendCost(
new ExertCharactersEffect(target, target));
}
_putCardIntoPlayEffect = new AttachCardEffect(_source, target);
int modifier = twilightModifier;
@@ -68,6 +75,10 @@ public class AttachPermanentAction extends AbstractCostToEffectAction {
_discardCardEffect = new PutCardIntoDiscardEffect(card);
}
public void setExertTarget(boolean exertTarget) {
_exertTarget = exertTarget;
}
@Override
public PhysicalCard getActionSource() {
return _source;

View File

@@ -0,0 +1,97 @@
package com.gempukku.lotro.cards.set4.gandalf;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.AttachPermanentAction;
import com.gempukku.lotro.cards.effects.*;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.KillResult;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Set: The Two Towers
* Side: Free
* Culture: Gandalf
* Twilight Cost: 1
* Type: Condition
* Game Text: To play, exert an Ent. Plays on that Ent.
* Response: If an [ISENGARD] minion is killed, discard this condition to reveal the top 10 cards of an opponent's
* draw deck. Discard 1 Shadow card and 1 Free Peoples card revealed. Your opponent reshuffles that deck.
*/
public class Card4_107 extends AbstractAttachable {
public Card4_107() {
super(Side.FREE_PEOPLE, CardType.CONDITION, 1, Culture.GANDALF, null, "Windows in a Stone Wall");
}
@Override
protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.and(Filters.race(Race.ELF), Filters.canExert(self));
}
@Override
public AttachPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) {
AttachPermanentAction permanentAction = super.getPlayCardAction(playerId, game, self, additionalAttachmentFilter, twilightModifier);
permanentAction.setExertTarget(true);
return permanentAction;
}
@Override
public List<? extends Action> getOptionalAfterActions(final String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.KILL
&& PlayConditions.canUseFPCardDuringPhase(game.getGameState(), null, self)) {
KillResult killResult = (KillResult) effectResult;
if (Filters.filter(killResult.getKilledCards(), game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.MINION), Filters.culture(Culture.ISENGARD)).size() > 0) {
final ActivateCardAction action = new ActivateCardAction(self, Keyword.RESPONSE);
action.appendCost(
new DiscardCardsFromPlayEffect(self, self));
action.appendEffect(
new ChooseOpponentEffect(playerId) {
@Override
protected void opponentChosen(final String opponentId) {
action.insertEffect(
new RevealTopCardsOfDrawDeckEffect(opponentId, 10) {
@Override
protected void cardsRevealed(final List<PhysicalCard> cards) {
action.appendEffect(
new ChooseArbitraryCardsEffect(playerId, "Choose shadow card", cards, Filters.side(Side.SHADOW), 1, 1) {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.insertEffect(
new DiscardCardFromDeckEffect(playerId, selectedCard));
}
}
});
action.appendEffect(
new ChooseArbitraryCardsEffect(playerId, "Choose free people card", cards, Filters.side(Side.FREE_PEOPLE), 1, 1) {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.insertEffect(
new DiscardCardFromDeckEffect(playerId, selectedCard));
}
}
});
action.appendEffect(
new ShuffleDeckEffect(opponentId));
}
});
}
});
return Collections.singletonList(action);
}
}
return null;
}
}

View File

@@ -51,6 +51,7 @@ public class KillEffect extends AbstractSuccessfulEffect {
killedCards.add(card);
gameState.addCardToZone(card, Zone.DEAD);
} else {
killedCards.add(card);
discardedCards.add(card);
gameState.addCardToZone(card, Zone.DISCARD);
}

View File

@@ -1289,7 +1289,7 @@ button.ui-button-icons-only {
}
.ui-button-text-only .ui-button-text {
padding: .4em 1em;
padding: .2em .3em;
}
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text {
@@ -1345,8 +1345,8 @@ input.ui-button {
}
.ui-buttonset .ui-button {
margin-left: 0;
margin-right: -.3em;
margin-left: .2em;
margin-right: -.2em;
}
/* workarounds */

View File

@@ -38,7 +38,6 @@
.ui-button-text-only .ui-button-text {
font-size: 70%;
padding: .05em .05em;
}
#set {