"Thror's Map"
This commit is contained in:
@@ -7,11 +7,11 @@ import com.gempukku.lotro.game.state.GameState;
|
|||||||
import com.gempukku.lotro.game.state.LotroGame;
|
import com.gempukku.lotro.game.state.LotroGame;
|
||||||
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
||||||
|
|
||||||
public class ReplaceOpponentSiteEffect extends UnrespondableEffect {
|
public class PlaySiteEffect extends UnrespondableEffect {
|
||||||
private String _playerId;
|
private String _playerId;
|
||||||
private int _siteNumber;
|
private int _siteNumber;
|
||||||
|
|
||||||
public ReplaceOpponentSiteEffect(String playerId, int siteNumber) {
|
public PlaySiteEffect(String playerId, int siteNumber) {
|
||||||
_playerId = playerId;
|
_playerId = playerId;
|
||||||
_siteNumber = siteNumber;
|
_siteNumber = siteNumber;
|
||||||
}
|
}
|
||||||
@@ -20,9 +20,11 @@ public class ReplaceOpponentSiteEffect extends UnrespondableEffect {
|
|||||||
public void playEffect(LotroGame game) {
|
public void playEffect(LotroGame game) {
|
||||||
GameState gameState = game.getGameState();
|
GameState gameState = game.getGameState();
|
||||||
PhysicalCard card = gameState.getSite(_siteNumber);
|
PhysicalCard card = gameState.getSite(_siteNumber);
|
||||||
gameState.stopAffecting(card);
|
if (card != null) {
|
||||||
gameState.removeCardFromZone(card);
|
gameState.stopAffecting(card);
|
||||||
gameState.addCardToZone(card, Zone.DECK);
|
gameState.removeCardFromZone(card);
|
||||||
|
gameState.addCardToZone(card, Zone.DECK);
|
||||||
|
}
|
||||||
PhysicalCard newSite = Filters.filter(gameState.getAdventureDeck(_playerId), game.getGameState(), game.getModifiersQuerying(), Filters.siteNumber(_siteNumber)).get(0);
|
PhysicalCard newSite = Filters.filter(gameState.getAdventureDeck(_playerId), game.getGameState(), game.getModifiersQuerying(), Filters.siteNumber(_siteNumber)).get(0);
|
||||||
gameState.addCardToZone(newSite, Zone.ADVENTURE_PATH);
|
gameState.addCardToZone(newSite, Zone.ADVENTURE_PATH);
|
||||||
gameState.startAffecting(newSite, game.getModifiersEnvironment());
|
gameState.startAffecting(newSite, game.getModifiersEnvironment());
|
||||||
@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set1.shire;
|
|||||||
import com.gempukku.lotro.cards.AbstractAlly;
|
import com.gempukku.lotro.cards.AbstractAlly;
|
||||||
import com.gempukku.lotro.cards.PlayConditions;
|
import com.gempukku.lotro.cards.PlayConditions;
|
||||||
import com.gempukku.lotro.cards.effects.ExertCharacterEffect;
|
import com.gempukku.lotro.cards.effects.ExertCharacterEffect;
|
||||||
import com.gempukku.lotro.cards.effects.ReplaceOpponentSiteEffect;
|
import com.gempukku.lotro.cards.effects.PlaySiteEffect;
|
||||||
import com.gempukku.lotro.cards.modifiers.ProxyingModifier;
|
import com.gempukku.lotro.cards.modifiers.ProxyingModifier;
|
||||||
import com.gempukku.lotro.common.CardType;
|
import com.gempukku.lotro.common.CardType;
|
||||||
import com.gempukku.lotro.common.Culture;
|
import com.gempukku.lotro.common.Culture;
|
||||||
@@ -97,7 +97,7 @@ public class Card1_295 extends AbstractAlly {
|
|||||||
&& PlayConditions.canExert(game.getGameState(), game.getModifiersQuerying(), self)) {
|
&& PlayConditions.canExert(game.getGameState(), game.getModifiersQuerying(), self)) {
|
||||||
DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, Keyword.FELLOWSHIP, "Exert this ally and to replace opponent's site 1 with your site 1.");
|
DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, Keyword.FELLOWSHIP, "Exert this ally and to replace opponent's site 1 with your site 1.");
|
||||||
action.addCost(new ExertCharacterEffect(self));
|
action.addCost(new ExertCharacterEffect(self));
|
||||||
action.addEffect(new ReplaceOpponentSiteEffect(playerId, 1));
|
action.addEffect(new PlaySiteEffect(playerId, 1));
|
||||||
actions.add(action);
|
actions.add(action);
|
||||||
}
|
}
|
||||||
LotroCardBlueprint copied = getCopied(game, self);
|
LotroCardBlueprint copied = getCopied(game, self);
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ import com.gempukku.lotro.logic.modifiers.ModifierEffect;
|
|||||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||||
import com.gempukku.lotro.logic.timing.Action;
|
import com.gempukku.lotro.logic.timing.Action;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set: The Fellowship of the Ring
|
* Set: The Fellowship of the Ring
|
||||||
* Side: Free
|
* Side: Free
|
||||||
@@ -49,6 +52,15 @@ public class Card1_316 extends AbstractLotroCardBlueprint {
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<? extends Action> getPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||||
|
if (PlayConditions.canPlayFPCardDuringPhase(game, Phase.FELLOWSHIP, self)
|
||||||
|
&& checkPlayRequirements(playerId, game, self)) {
|
||||||
|
return Collections.singletonList(getPlayCardAction(playerId, game, self, 0));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Modifier getAlwaysOnEffect(PhysicalCard self) {
|
public Modifier getAlwaysOnEffect(PhysicalCard self) {
|
||||||
return new AbstractModifier(self, "Spot 2 Hobbit companions to make the shadow number -1 (or spot 4 to make it -2)",
|
return new AbstractModifier(self, "Spot 2 Hobbit companions to make the shadow number -1 (or spot 4 to make it -2)",
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.gempukku.lotro.cards.set1.shire;
|
||||||
|
|
||||||
|
import com.gempukku.lotro.cards.AbstractLotroCardBlueprint;
|
||||||
|
import com.gempukku.lotro.cards.PlayConditions;
|
||||||
|
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
|
||||||
|
import com.gempukku.lotro.cards.effects.ExertCharacterEffect;
|
||||||
|
import com.gempukku.lotro.cards.effects.PlaySiteEffect;
|
||||||
|
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.DefaultCostToEffectAction;
|
||||||
|
import com.gempukku.lotro.logic.effects.ChooseActiveCardsEffect;
|
||||||
|
import com.gempukku.lotro.logic.effects.DiscardCardFromPlayEffect;
|
||||||
|
import com.gempukku.lotro.logic.timing.Action;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set: The Fellowship of the Ring
|
||||||
|
* Side: Free
|
||||||
|
* Culture: Shire
|
||||||
|
* Twilight Cost: 0
|
||||||
|
* Type: Possession
|
||||||
|
* Game Text: Plays to your support area. Fellowship or Regroup: Exert 2 Hobbits and discard Thror's Map to play the
|
||||||
|
* fellowship's next site (replacing opponent's site if necessary).
|
||||||
|
*/
|
||||||
|
public class Card1_318 extends AbstractLotroCardBlueprint {
|
||||||
|
public Card1_318() {
|
||||||
|
super(Side.FREE_PEOPLE, CardType.POSSESSION, Culture.SHIRE, "Thror's Map", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTwilightCost() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self) {
|
||||||
|
return PlayConditions.checkUniqueness(game.getGameState(), game.getModifiersQuerying(), self);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Action getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||||
|
return new PlayPermanentAction(self, Zone.FREE_SUPPORT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<? extends Action> getPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||||
|
if (PlayConditions.canPlayFPCardDuringPhase(game, Phase.FELLOWSHIP, self)
|
||||||
|
&& checkPlayRequirements(playerId, game, self)) {
|
||||||
|
return Collections.singletonList(getPlayCardAction(playerId, game, self, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)
|
||||||
|
|| PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.REGROUP, self))
|
||||||
|
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.HOBBIT), Filters.canExert()) >= 2) {
|
||||||
|
Keyword phaseKeyword = (game.getGameState().getCurrentPhase() == Phase.FELLOWSHIP) ? Keyword.FELLOWSHIP : Keyword.REGROUP;
|
||||||
|
final DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, phaseKeyword, "Exert 2 Hobbits and discard Thror's Map to play the fellowship's next site (replacing opponent's site if necessary)");
|
||||||
|
action.addCost(
|
||||||
|
new ChooseActiveCardsEffect(playerId, "Choose Hobbit", 2, 2, Filters.keyword(Keyword.HOBBIT), Filters.canExert()) {
|
||||||
|
@Override
|
||||||
|
protected void cardsSelected(List<PhysicalCard> cards) {
|
||||||
|
action.addCost(new ExertCharacterEffect(cards.get(0)));
|
||||||
|
action.addCost(new ExertCharacterEffect(cards.get(1)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
action.addCost(new DiscardCardFromPlayEffect(self, self));
|
||||||
|
action.addEffect(new PlaySiteEffect(playerId, game.getGameState().getCurrentSiteNumber() + 1));
|
||||||
|
return Collections.singletonList(action);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user