diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java index 88de21981..d0386e31a 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java @@ -101,6 +101,10 @@ public class PlayConditions { return false; } + public static boolean canExertSelf(PhysicalCard self, LotroGame game) { + return canExert(self, game, Filters.sameCard(self)); + } + public static boolean canExert(PhysicalCard source, LotroGame game, Filter... filters) { return canExert(source, game.getGameState(), game.getModifiersQuerying(), filters); } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/rohan/Card4_281.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/rohan/Card4_281.java new file mode 100644 index 000000000..8fd523d54 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/rohan/Card4_281.java @@ -0,0 +1,74 @@ +package com.gempukku.lotro.cards.set4.rohan; + +import com.gempukku.lotro.cards.AbstractAlly; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect; +import com.gempukku.lotro.cards.effects.ExertCharactersEffect; +import com.gempukku.lotro.cards.modifiers.StrengthModifier; +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.effects.ChooseActiveCardEffect; +import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Two Towers + * Side: Free + * Culture: Rohan + * Twilight Cost: 1 + * Type: Ally • Home 4T • Man + * Strength: 4 + * Vitality: 2 + * Site: 4T + * Game Text: Villager. Discard Hlafwine if an opponent controls his home site. Skirmish: Exert Hlafwine to make + * a [ROHAN] Man strength +2. + */ +public class Card4_281 extends AbstractAlly { + public Card4_281() { + super(1, Block.TWO_TOWERS, 4, 4, 2, Race.MAN, Culture.ROHAN, "Hlafwine", true); + addKeyword(Keyword.VILLAGER); + } + + @Override + protected List getExtraInPlayPhaseActions(String playerId, LotroGame game, final PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.SKIRMISH, self) + && PlayConditions.canExertSelf(self, game)) { + final ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new ExertCharactersEffect(self, self)); + action.appendEffect( + new ChooseActiveCardEffect(self, playerId, "Choose ROHAN Man", Filters.culture(Culture.ROHAN), Filters.race(Race.MAN)) { + @Override + protected void cardSelected(PhysicalCard card) { + action.insertEffect( + new AddUntilEndOfPhaseModifierEffect( + new StrengthModifier(self, Filters.sameCard(card), 2), Phase.SKIRMISH)); + } + }); + return Collections.singletonList(action); + } + return null; + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(), + Filters.siteControlledByShadowPlayer(self.getOwner()), + Filters.siteNumber(4), + Filters.siteBlock(Block.TWO_TOWERS)) > 0) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect( + new DiscardCardsFromPlayEffect(self, self)); + return Collections.singletonList(action); + } + return null; + } +}