From 68da2ad6e10d36529435171972d869a5e4383d1b Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sat, 10 Sep 2011 21:04:39 +0000 Subject: [PATCH] "Orc Chieftain" --- .../cards/actions/AttachPermanentAction.java | 3 +- .../lotro/cards/set1/sauron/Card1_266.java | 64 +++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_266.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java index c4f9a9a8f..0d600acb0 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java @@ -63,8 +63,7 @@ public class AttachPermanentAction implements CostToEffectAction { _preCostIterator = preCostEffects.iterator(); - _playCardEffect = new TriggeringEffect(new PlayCardResult(card)); - + _playCardEffect = new TriggeringEffect(new PlayCardResult(card, target)); } }; _discardCardEffect = new PutCardIntoDiscardEffect(card); diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_266.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_266.java new file mode 100644 index 000000000..516bfc4f9 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_266.java @@ -0,0 +1,64 @@ +package com.gempukku.lotro.cards.set1.sauron; + +import com.gempukku.lotro.cards.AbstractMinion; +import com.gempukku.lotro.cards.effects.AddTwilightEffect; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.actions.DefaultCostToEffectAction; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.EffectResult; +import com.gempukku.lotro.logic.timing.UnrespondableEffect; +import com.gempukku.lotro.logic.timing.results.PlayCardResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Fellowship of the Ring + * Side: Shadow + * Culture: Sauron + * Twilight Cost: 2 + * Type: Minion • Orc + * Strength: 7 + * Vitality: 2 + * Site: 6 + * Game Text: When you play a weapon on this minion, add (2) (limit once per turn). + */ +public class Card1_266 extends AbstractMinion { + public Card1_266() { + super(2, 7, 2, 6, Keyword.ORC, Culture.SAURON, "Orc Chieftain"); + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, final PhysicalCard self) { + if (effectResult.getType() == EffectResult.Type.PLAY) { + PlayCardResult playCardResult = (PlayCardResult) effectResult; + PhysicalCard playedCard = playCardResult.getPlayedCard(); + if (playCardResult.getAttachedTo() == self + && self.getData() == null + && ( + game.getModifiersQuerying().hasKeyword(game.getGameState(), playedCard, Keyword.HAND_WEAPON) + || game.getModifiersQuerying().hasKeyword(game.getGameState(), playedCard, Keyword.RANGED_WEAPON)) + ) { + DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, null, "Add (2)"); + action.addEffect( + new AddTwilightEffect(2)); + action.addEffect( + new UnrespondableEffect() { + @Override + public void playEffect(LotroGame game) { + self.storeData(new Object()); + } + }); + return Collections.singletonList(action); + } + } + if (effectResult.getType() == EffectResult.Type.END_OF_TURN) + self.removeData(); + return null; + } + + +}