"Cast From the Hall"

This commit is contained in:
marcins78@gmail.com
2012-03-08 14:31:59 +00:00
parent c0e6fe5b77
commit af89b1b575

View File

@@ -0,0 +1,72 @@
package com.gempukku.lotro.cards.set18.rohan;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.AddTokenEffect;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.RemoveTokenEffect;
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.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Treachery & Deceit
* Side: Free
* Culture: Rohan
* Twilight Cost: 0
* Type: Condition • Support Area
* Game Text: Each time you play a [ROHAN] possession from hand, add a [ROHAN] token here. Skirmish: Remove 3 [ROHAN]
* tokens from here to make a [ROHAN] companion strength +1 and damage +1.
*/
public class Card18_094 extends AbstractPermanent {
public Card18_094() {
super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.ROHAN, Zone.SUPPORT, "Cast From the Hall");
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, Filters.owner(self.getOwner()), Culture.ROHAN, CardType.POSSESSION)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new AddTokenEffect(self, self, Token.ROHAN));
return Collections.singletonList(action);
}
return null;
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.canRemoveTokens(game, self, Token.ROHAN, 3)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new RemoveTokenEffect(self, self, Token.ROHAN, 3));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a ROHAN companion", CardType.COMPANION, Culture.ROHAN) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, card, 1), Phase.SKIRMISH));
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new KeywordModifier(self, card, Keyword.DAMAGE, 1), Phase.SKIRMISH));
}
});
return Collections.singletonList(action);
}
return null;
}
}