"Hlafwine"

This commit is contained in:
marcins78@gmail.com
2011-10-14 15:30:56 +00:00
parent 535bb3f134
commit eb42979eb2
2 changed files with 78 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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<? extends Action> 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<RequiredTriggerAction> 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;
}
}