"Subterranean Homestead"

This commit is contained in:
marcins78@gmail.com
2011-12-15 14:12:26 +00:00
parent 39e0678c49
commit f1aecc6f18
2 changed files with 91 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ public class RemoveTokenEffect extends AbstractEffect {
@Override
public String getText(LotroGame game) {
return null;
return "Remove " + _count + " " + _token.getCulture().getHumanReadable() + " token" + (_count > 1 ? "s" : "");
}
@Override

View File

@@ -0,0 +1,90 @@
package com.gempukku.lotro.cards.set13.dwarven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
import com.gempukku.lotro.cards.effects.*;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.common.*;
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.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Bloodlines
* Side: Free
* Culture: Dwarven
* Twilight Cost: 2
* Type: Condition • Support Area
* Game Text: To play, exert 2 Dwarves. When you play this, add a [DWARVEN] token here for each mountain site and each
* underground site on the adventure path. Skirmish: Discard this from play or remove 2 tokens from here to make
* a Shadow player discard the top card of his or her draw deck.
*/
public class Card13_008 extends AbstractPermanent {
public Card13_008() {
super(Side.FREE_PEOPLE, 2, CardType.CONDITION, Culture.DWARVEN, Zone.SUPPORT, "Subterranean Homestead", true);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) {
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile)
&& PlayConditions.canExert(self, game, 1, 2, Race.DWARF);
}
@Override
public PlayPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayPermanentAction action = super.getPlayCardAction(playerId, game, self, twilightModifier, ignoreRoamingPenalty);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 2, 2, Race.DWARF));
return action;
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, self)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
int count = Filters.countActive(game.getGameState(), game.getModifiersQuerying(), CardType.SITE, Zone.ADVENTURE_PATH, Filters.or(Keyword.MOUNTAIN, Keyword.UNDERGROUND));
if (count > 0)
action.appendEffect(
new AddTokenEffect(self, self, Token.DWARVEN, count));
return Collections.singletonList(action);
}
return null;
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& (PlayConditions.canRemoveTokens(game, self, Token.DWARVEN, 2) || PlayConditions.canSelfDiscard(self, game))) {
final ActivateCardAction action = new ActivateCardAction(self);
List<Effect> possibleCosts = new LinkedList<Effect>();
possibleCosts.add(
new RemoveTokenEffect(self, self, Token.DWARVEN, 2));
possibleCosts.add(
new SelfDiscardEffect(self));
action.appendCost(
new ChoiceEffect(action, playerId, possibleCosts));
action.appendEffect(
new ChooseOpponentEffect(playerId) {
@Override
protected void opponentChosen(String opponentId) {
action.appendEffect(
new DiscardTopCardFromDeckEffect(self, opponentId, true));
}
});
return Collections.singletonList(action);
}
return null;
}
}