"Horn of Gondor"

This commit is contained in:
marcins78
2013-01-29 16:32:51 +00:00
parent cd87217e69
commit 689251d3ef
2 changed files with 59 additions and 1 deletions

View File

@@ -0,0 +1,58 @@
package com.gempukku.lotro.cards.set20.gondor;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ReplaceInSkirmishEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
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.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* 0
* •Horn of Gondor
* Gondor Possession • Horn
* Bearer must be a [Gondor] companion.
* Skirmish: Exert bearer twice to have another companion replace this companion in this skirmish.
*/
public class Card20_196 extends AbstractAttachableFPPossession {
public Card20_196() {
super(0, 0, 0, Culture.GONDOR, PossessionClass.HORN, "Horn of Gondor", null, true);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.and(Culture.GONDOR, CardType.COMPANION);
}
@Override
protected List<? extends Action> getExtraInPlayPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.canExert(self, game, 2, Filters.hasAttached(self))) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, 2, Filters.hasAttached(self)) {
@Override
protected void forEachCardExertedCallback(final PhysicalCard bearer) {
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose companion", CardType.COMPANION, Filters.not(bearer)) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard anotherCompanion) {
action.appendEffect(
new ReplaceInSkirmishEffect(anotherCompanion, bearer));
}
});
}
});
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.common;
public enum PossessionClass implements Filterable {
HAND_WEAPON("Hand Weapon"), ARMOR("Armor"), HELM("Helm"), MOUNT("Mount"), RANGED_WEAPON("Ranged Weapon"),
CLOAK("Cloak"), PIPE("Pipe"), PIPEWEED("Pipeweed"), SHIELD("Shield"), BRACERS("Bracers"), STAFF("Staff"), RING("Ring"),
BROOCH("Brooch"), GAUNTLETS("Gauntlets"), BOX("Box"), PALANTIR("Palantir"), PHIAL("Phial");
BROOCH("Brooch"), GAUNTLETS("Gauntlets"), BOX("Box"), PALANTIR("Palantir"), PHIAL("Phial"), HORN("Horn");
private String _humanReadable;