From e4c0c239245031463116db577dc4a19e72bfa6c7 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Mon, 10 Oct 2011 18:51:40 +0000 Subject: [PATCH] "Rohan Is Mine" --- .../lotro/cards/set4/isengard/Card4_172.java | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_172.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_172.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_172.java new file mode 100644 index 000000000..3a93be160 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_172.java @@ -0,0 +1,60 @@ +package com.gempukku.lotro.cards.set4.isengard; + +import com.gempukku.lotro.cards.AbstractAttachable; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.ExertCharactersEffect; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Race; +import com.gempukku.lotro.common.Side; +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.RequiredTriggerAction; +import com.gempukku.lotro.logic.timing.EffectResult; +import com.gempukku.lotro.logic.timing.results.AssignmentResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Two Towers + * Side: Shadow + * Culture: Isengard + * Twilight Cost: 0 + * Type: Condition + * Game Text: To play, spot Saruman or an [ISENGARD] Man. Plays on a Free Peoples Man. Each time the Free Peoples + * player assigns bearer to a skirmish, exert each ally. + */ +public class Card4_172 extends AbstractAttachable { + public Card4_172() { + super(Side.SHADOW, CardType.CONDITION, 0, Culture.ISENGARD, null, "Rohan Is Mine"); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, additionalAttachmentFilter, twilightModifier) + && PlayConditions.canSpot(game, Filters.or(Filters.name("Saruman"), Filters.and(Filters.culture(Culture.ISENGARD), Filters.race(Race.MAN)))); + } + + @Override + protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { + return Filters.and(Filters.side(Side.FREE_PEOPLE), Filters.race(Race.MAN)); + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (effectResult.getType() == EffectResult.Type.ASSIGNMENT) { + AssignmentResult assignmentResult = (AssignmentResult) effectResult; + if (assignmentResult.getPlayerId().equals(game.getGameState().getCurrentPlayerId()) + && assignmentResult.getAssignments().keySet().contains(self.getAttachedTo())) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect( + new ExertCharactersEffect(self, Filters.type(CardType.ALLY))); + return Collections.singletonList(action); + } + } + return null; + } +}