"Othanc Champion"

This commit is contained in:
marcins78@gmail.com
2011-10-10 16:30:02 +00:00
parent b44c61720e
commit b404adf75b
2 changed files with 76 additions and 2 deletions

View File

@@ -0,0 +1,60 @@
package com.gempukku.lotro.cards.set4.isengard;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
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.AssignmentEffect;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: The Two Towers
* Side: Shadow
* Culture: Isengard
* Twilight Cost: 5
* Type: Minion • Uruk-Hai
* Strength: 12
* Vitality: 2
* Site: 5
* Game Text: Damage +1. Assignment: Exert Orthanc Champion to assign it to an unbound companion. That companion
* may exert to prevent this.
*/
public class Card4_164 extends AbstractMinion {
public Card4_164() {
super(5, 12, 2, 5, Race.URUK_HAI, Culture.ISENGARD, "Othanc Champion", true);
addKeyword(Keyword.DAMAGE);
}
@Override
protected List<? extends Action> getExtraPhaseActions(final String playerId, final LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.ASSIGNMENT, self, 0)
&& PlayConditions.canExert(self, game, Filters.sameCard(self))
&& Filters.canBeAssignedToSkirmish(Side.SHADOW).accepts(game.getGameState(), game.getModifiersQuerying(), self)) {
final ActivateCardAction action = new ActivateCardAction(self, Keyword.ASSIGNMENT);
action.appendCost(
new ExertCharactersEffect(self, self));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose unbound companion", Filters.unboundCompanion(), Filters.canBeAssignedToSkirmish(Side.SHADOW)) {
@Override
protected void cardSelected(PhysicalCard companion) {
action.insertEffect(
new PreventableEffect(action,
new AssignmentEffect(playerId, companion, Collections.singletonList(self), "assigned by card effect"),
game.getGameState().getCurrentPlayerId(),
new ExertCharactersEffect(self, companion)));
}
});
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -102,7 +102,14 @@ public class DefaultActionsEnvironment implements ActionsEnvironment {
_lotroGame.getGameState().iterateActivableCards(playerId, gatherActions);
return gatherActions.getActions();
List<Action> result = new LinkedList<Action>();
for (Action action : gatherActions.getActions()) {
if (_lotroGame.getModifiersQuerying().canPlayAction(_lotroGame.getGameState(), playerId, action))
result.add(action);
}
return result;
}
@Override
@@ -139,7 +146,14 @@ public class DefaultActionsEnvironment implements ActionsEnvironment {
_lotroGame.getGameState().iterateActivableCards(playerId, gatherAfterActions);
return gatherAfterActions.getActions();
List<Action> result = new LinkedList<Action>();
for (Action action : gatherAfterActions.getActions()) {
if (_lotroGame.getModifiersQuerying().canPlayAction(_lotroGame.getGameState(), playerId, action))
result.add(action);
}
return result;
}
@Override