"Might of the Maiar"

This commit is contained in:
marcins78
2013-01-25 11:02:00 +00:00
parent 2b8f2c2564
commit 8018b706db

View File

@@ -0,0 +1,64 @@
package com.gempukku.lotro.cards.set20.gandalf;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfTurnModifierEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
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.RequiredTriggerAction;
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
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.LinkedList;
import java.util.List;
/**
* 1
* •Might of the Maiar
* Gandalf Condition • Companion
* 1
* Spell.
* Bearer must be Gandalf. He is damage +1.
* If you lose initiative, discard this condition and make Gandalf strength -2 until the end of turn.
*/
public class Card20_165 extends AbstractAttachable {
public Card20_165() {
super(Side.FREE_PEOPLE, CardType.CONDITION, 1, Culture.GANDALF, null, "Might of the Maiar", null, true);
addKeyword(Keyword.SPELL);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.gandalf;
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
List<Modifier> modifiers = new LinkedList<Modifier>();
modifiers.add(
new StrengthModifier(self, Filters.hasAttached(self), 1));
modifiers.add(
new KeywordModifier(self, Filters.hasAttached(self), Keyword.DAMAGE, 1));
return modifiers;
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.losesInitiative(effectResult, Side.FREE_PEOPLE)) {
RequiredTriggerAction action =new RequiredTriggerAction(self);
action.appendEffect(
new SelfDiscardEffect(self));
action.appendEffect(
new AddUntilEndOfTurnModifierEffect(
new StrengthModifier(self, Filters.gandalf, -2)));
return Collections.singletonList(action);
}
return null;
}
}