This commit is contained in:
marcins78@gmail.com
2011-11-06 23:09:40 +00:00
parent e8d9e553e4
commit 4ef1013499
2 changed files with 52 additions and 0 deletions

View File

@@ -64,6 +64,10 @@ public class PlayConditions {
return (phase == null || gameState.getCurrentPhase() == phase) && (self.getZone() == Zone.SUPPORT || self.getZone() == Zone.FREE_CHARACTERS || self.getZone() == Zone.ATTACHED);
}
public static boolean canUseFPCardDuringPhase(LotroGame game, Phase phase, PhysicalCard self) {
return (phase == null || game.getGameState().getCurrentPhase() == phase) && (self.getZone() == Zone.SUPPORT || self.getZone() == Zone.FREE_CHARACTERS || self.getZone() == Zone.ATTACHED);
}
public static boolean canUseShadowCardDuringPhase(GameState gameState, Phase phase, PhysicalCard self, int twilightCost) {
return (phase == null || gameState.getCurrentPhase() == phase) && (self.getZone() == Zone.SUPPORT || self.getZone() == Zone.SHADOW_CHARACTERS || self.getZone() == Zone.ATTACHED)
&& twilightCost <= gameState.getTwilightPool();

View File

@@ -0,0 +1,48 @@
package com.gempukku.lotro.cards.set7.rohan;
import com.gempukku.lotro.cards.AbstractAlly;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromHandEffect;
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.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: The Return of the King
* Side: Free
* Culture: Rohan
* Twilight Cost: 1
* Type: Ally • Home 3T • Man
* Strength: 4
* Vitality: 2
* Site: 3T
* Game Text: Villager. Skirmish: If you have initiative, discard a card from hand to make a [ROHAN] Man strength +1.
*/
public class Card7_222 extends AbstractAlly {
public Card7_222() {
super(1, Block.TWO_TOWERS, 3, 4, 2, Race.MAN, Culture.ROHAN, "Deor", true);
addKeyword(Keyword.VILLAGER);
}
@Override
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.hasInitiative(game, Side.FREE_PEOPLE)
&& PlayConditions.canDiscardFromHand(game, playerId, 1, Filters.any)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndDiscardCardsFromHandEffect(action, playerId, false, 1));
action.appendEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 1, Culture.ROHAN, Race.MAN));
return Collections.singletonList(action);
}
return null;
}
}