"Swarthy Bree-lander"

This commit is contained in:
marcins78@gmail.com
2011-12-05 01:09:39 +00:00
parent e734a76144
commit 720da995f1

View File

@@ -0,0 +1,78 @@
package com.gempukku.lotro.cards.set11.men;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.TransferPermanentEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Shadows
* Side: Shadow
* Culture: Men
* Twilight Cost: 3
* Type: Minion • Man
* Strength: 8
* Vitality: 2
* Site: 4
* Game Text: At the start of the maneuver phase, you may remove (2) to transfer a condition borne by a character
* to another eligible bearer.
*/
public class Card11_101 extends AbstractMinion {
public Card11_101() {
super(3, 8, 2, 4, Race.MAN, Culture.MEN, "Swarthy Bree-lander");
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(final String playerId, final LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (TriggerConditions.startOfPhase(game, effectResult, Phase.MANEUVER)
&& game.getGameState().getTwilightPool() >= 2) {
final OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new RemoveTwilightEffect(2));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a condition", CardType.CONDITION, Filters.attachedTo(Filters.character),
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
if (!(physicalCard.getBlueprint() instanceof AbstractAttachable))
return false;
AbstractAttachable attachable = (AbstractAttachable) physicalCard.getBlueprint();
return Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), attachable.getFullValidTargetFilter(physicalCard.getOwner(), game, physicalCard), Filters.not(physicalCard.getAttachedTo()));
}
}) {
@Override
protected void cardSelected(LotroGame game, final PhysicalCard attachment) {
AbstractAttachable attachable = (AbstractAttachable) attachment.getBlueprint();
action.insertEffect(
new ChooseActiveCardEffect(self, playerId, "Choose new eligible bearer", attachable.getFullValidTargetFilter(attachment.getOwner(), game, attachment), Filters.not(attachment.getAttachedTo())) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard newBearer) {
action.insertEffect(
new TransferPermanentEffect(attachment, newBearer));
}
});
}
});
return Collections.singletonList(action);
}
return null;
}
}