"Westfarthing"

This commit is contained in:
marcins78@gmail.com
2011-08-31 15:18:40 +00:00
parent 1f948ce926
commit 7ce1f599ce
3 changed files with 61 additions and 7 deletions

View File

@@ -6,12 +6,15 @@ import com.gempukku.lotro.cards.actions.PlayPermanentAction;
import com.gempukku.lotro.cards.effects.ExertCharacterEffect;
import com.gempukku.lotro.cards.effects.HealCharacterEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.LotroCardBlueprint;
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.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseAnyCardEffect;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.EffectResult;
@@ -38,7 +41,7 @@ public class Card1_045 extends AbstractAlly {
}
@Override
public List<? extends Action> getPlayablePhaseActions(String playerId, final LotroGame game, PhysicalCard self) {
public List<? extends Action> getPlayablePhaseActions(final String playerId, final LotroGame game, PhysicalCard self) {
List<Action> actions = new LinkedList<Action>();
appendPlayAllyActions(actions, game, self);
@@ -49,7 +52,14 @@ public class Card1_045 extends AbstractAlly {
CostToEffectAction action = new CostToEffectAction(self, "Exert Galadriel to play an Elf for free");
action.addCost(new ExertCharacterEffect(self));
action.addEffect(
new ChooseAnyCardEffect(playerId, "Choose an Elf to play", Filters.owner(playerId), Filters.zone(Zone.HAND), Filters.keyword(Keyword.ELF)) {
new ChooseAnyCardEffect(playerId, "Choose an Elf to play", Filters.owner(playerId), Filters.zone(Zone.HAND), Filters.keyword(Keyword.ELF),
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
List<? extends Action> playableActions = physicalCard.getBlueprint().getPlayablePhaseActions(playerId, game, physicalCard);
return (playableActions != null && playableActions.size() > 0);
}
}) {
@Override
protected void cardSelected(PhysicalCard card) {
LotroCardBlueprint blueprint = card.getBlueprint();

View File

@@ -3,7 +3,6 @@ package com.gempukku.lotro.cards.set1.site;
import com.gempukku.lotro.cards.AbstractSite;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.filters.Filters;
@@ -33,8 +32,7 @@ public class Card1_324 extends AbstractSite {
@Override
public List<? extends Action> getPlayablePhaseActions(final String playerId, final LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseSiteDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.HOBBIT), Filters.canExert())) {
if (PlayConditions.canUseSiteDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) {
final CostToEffectAction action = new CostToEffectAction(self, "Add a burder to play Aragorn from your draw deck.");
action.addCost(new AddBurdenEffect(playerId));

View File

@@ -1,10 +1,26 @@
package com.gempukku.lotro.cards.set1.site;
import com.gempukku.lotro.cards.AbstractSite;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
import com.gempukku.lotro.cards.effects.ExertCharacterEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.LotroCardBlueprint;
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.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.ChooseAnyCardEffect;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
@@ -19,8 +35,38 @@ public class Card1_326 extends AbstractSite {
}
@Override
public List<? extends Action> getPlayablePhaseActions(String playerId, LotroGame lotroGame, PhysicalCard self) {
// TODO Fellowship
public List<? extends Action> getPlayablePhaseActions(final String playerId, final LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseSiteDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.HOBBIT), Filters.canExert())) {
final CostToEffectAction action = new CostToEffectAction(self, "Exert a Hobbit to play a companion or ally; that character's twilight cost is -1.");
action.addCost(
new ChooseActiveCardEffect(playerId, "Choose a Hobbit", Filters.keyword(Keyword.HOBBIT), Filters.canExert()) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard hobbit) {
action.addCost(new ExertCharacterEffect(hobbit));
}
}
);
action.addEffect(
new ChooseAnyCardEffect(playerId, "Choose companion or ally to play", Filters.owner(playerId), Filters.zone(Zone.HAND), Filters.or(Filters.type(CardType.COMPANION), Filters.type(CardType.ALLY)),
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
List<? extends Action> playableActions = physicalCard.getBlueprint().getPlayablePhaseActions(playerId, game, physicalCard);
return (playableActions != null && playableActions.size() > 0);
}
}) {
@Override
protected void cardSelected(PhysicalCard card) {
LotroCardBlueprint blueprint = card.getBlueprint();
if (!blueprint.isUnique() || !Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.name(blueprint.getName()))) {
Zone zone = (blueprint.getCardType() == CardType.COMPANION) ? Zone.FREE_CHARACTERS : Zone.FREE_SUPPORT;
game.getActionsEnvironment().addActionToStack(new PlayPermanentAction(card, zone, -1));
}
}
});
return Collections.singletonList(action);
}
return null;
}
}