"Stern Words"

This commit is contained in:
marcins78@gmail.com
2012-03-09 11:06:11 +00:00
parent 0808a647f5
commit 834d5cec1f

View File

@@ -0,0 +1,74 @@
package com.gempukku.lotro.cards.set19.gandalf;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.ReturnCardsToHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndTransferAttachableEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filter;
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.OptionalTriggerAction;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Ages End
* Side: Free
* Culture: Gandalf
* Twilight Cost: 2
* Type: Condition
* Strength: +2
* Game Text: To play, spot a [GANDALF] Wizard. Bearer must be a companion. Each time bearer wins a skirmish,
* you may transfer this condition to another companion. At the end of each turn, return this condition to hand.
*/
public class Card19_009 extends AbstractAttachable {
public Card19_009() {
super(Side.FREE_PEOPLE, CardType.CONDITION, 2, Culture.GANDALF, null, "Stern Words");
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, additionalAttachmentFilter, twilightModifier)
&& PlayConditions.canSpot(game, Culture.GANDALF, Race.WIZARD);
}
@Override
public Modifier getAlwaysOnModifier(PhysicalCard self) {
return new StrengthModifier(self, Filters.hasAttached(self), 2);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return CardType.COMPANION;
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.winsSkirmish(game, effectResult, self.getAttachedTo())) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new ChooseAndTransferAttachableEffect(action, playerId, self, null, CardType.COMPANION));
return Collections.singletonList(action);
}
return null;
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.END_OF_TURN) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new ReturnCardsToHandEffect(self, self));
return Collections.singletonList(action);
}
return null;
}
}