"Ring of Asperity"

This commit is contained in:
marcins78@gmail.com
2011-11-20 02:58:57 +00:00
parent 7ae7ae5806
commit dfdab881db
4 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
package com.gempukku.lotro.cards.set9.wraith;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.effects.ReturnCardsToHandEffect;
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.modifiers.Modifier;
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: Reflections
* Side: Shadow
* Culture: Wraith
* Twilight Cost: 0
* Type: Artifact • Ring
* Strength: +1
* Game Text: Bearer must be a Nazgul. When you play this artifact, you may wound an unwounded companion.
* Response: If a player reconciles, return bearer to his owner's hand.
*/
public class Card9_042 extends AbstractAttachable {
public Card9_042() {
super(Side.SHADOW, CardType.ARTIFACT, 0, Culture.WRAITH, PossessionClass.RING, "Ring of Asperity", true);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Race.NAZGUL;
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
return Collections.singletonList(
new StrengthModifier(self, Filters.hasAttached(self), 1));
}
@Override
public List<? extends Action> getOptionalInPlayAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.RECONCILE) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
new ReturnCardsToHandEffect(self, self.getAttachedTo()));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -16,6 +16,8 @@ public abstract class EffectResult {
START_OF_TURN,
END_OF_TURN,
RECONCILE,
PLAY, ACTIVATE, DRAW_CARD_OR_PUT_INTO_HAND,
PUT_ON_THE_ONE_RING, REMOVE_BURDEN, ADD_BURDEN, ADD_THREAT,

View File

@@ -9,8 +9,10 @@ import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.effects.DiscardCardsFromHandEffect;
import com.gempukku.lotro.logic.effects.DrawCardEffect;
import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect;
import com.gempukku.lotro.logic.effects.TriggeringResultEffect;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.results.ReconcileResult;
import java.util.HashSet;
import java.util.LinkedList;
@@ -84,6 +86,8 @@ public class PlayerReconcilesAction implements Action {
public void decisionMade(String result) throws DecisionResultInvalidException {
Set<PhysicalCard> cards = getSelectedCardsByResponse(result);
_effectQueue.add(new DiscardCardsFromHandEffect(null, _playerId, cards, false));
_effectQueue.add(
new TriggeringResultEffect(new ReconcileResult(), "Player reconciled"));
}
}));
} else if (cardsInHand.size() > 0) {
@@ -99,10 +103,14 @@ public class PlayerReconcilesAction implements Action {
if (cardsInHandAfterDiscard < 8) {
_effectQueue.add(new DrawCardEffect(_playerId, 8 - cardsInHandAfterDiscard));
}
_effectQueue.add(
new TriggeringResultEffect(new ReconcileResult(), "Player reconciled"));
}
}));
} else {
_effectQueue.add(new DrawCardEffect(_playerId, 8));
_effectQueue.add(
new TriggeringResultEffect(new ReconcileResult(), "Player reconciled"));
}
}

View File

@@ -0,0 +1,9 @@
package com.gempukku.lotro.logic.timing.results;
import com.gempukku.lotro.logic.timing.EffectResult;
public class ReconcileResult extends EffectResult {
public ReconcileResult() {
super(EffectResult.Type.RECONCILE);
}
}