"Pressing On"

This commit is contained in:
marcins78@gmail.com
2011-11-10 17:41:06 +00:00
parent 1f634068ba
commit dd0ed52f18

View File

@@ -0,0 +1,81 @@
package com.gempukku.lotro.cards.set7.shire;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
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.AddThreatsEffect;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.effects.PlaySiteEffect;
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: The Return of the King
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Condition • Support Area
* Game Text: To play, spot 2 Hobbits. Each time the fellowship moves, add a threat or discard this condition.
* Regroup: Discard this condition and exert a Hobbit companion to play the fellowship's next site (replacing opponent's
* site if necessary).
*/
public class Card7_325 extends AbstractPermanent {
public Card7_325() {
super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.SHIRE, Zone.SUPPORT, "Pressing On");
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier, ignoreRoamingPenalty)
&& PlayConditions.canSpot(game, 2, Race.HOBBIT);
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.WHEN_FELLOWSHIP_MOVES) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
List<Effect> possibleEffects = new LinkedList<Effect>();
possibleEffects.add(
new AddThreatsEffect(self.getOwner(), self, 1));
possibleEffects.add(
new DiscardCardsFromPlayEffect(self, self) {
@Override
public String getText(LotroGame game) {
return "Discard this condition";
}
});
action.appendEffect(
new ChoiceEffect(action, self.getOwner(), possibleEffects));
return Collections.singletonList(action);
}
return null;
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)
&& PlayConditions.canSelfDiscard(self, game)
&& PlayConditions.canExert(self, game, CardType.COMPANION, Race.HOBBIT)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new DiscardCardsFromPlayEffect(self, self));
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, CardType.COMPANION, Race.HOBBIT));
action.appendEffect(
new PlaySiteEffect(playerId, null, game.getGameState().getCurrentSiteNumber() + 1));
return Collections.singletonList(action);
}
return null;
}
}