"Morannon Plains"
This commit is contained in:
@@ -19,7 +19,7 @@ public class ReinforceTokenEffect extends ChooseActiveCardEffect {
|
||||
}
|
||||
|
||||
public ReinforceTokenEffect(PhysicalCard source, String playerId, Token token, int count) {
|
||||
super(source, playerId, "Choose card to reinforce", Filters.owner(playerId), Filters.hasToken(token),
|
||||
super(source, playerId, "Choose card to reinforce", Filters.owner(playerId), (token != null) ? Filters.hasToken(token) : Filters.hasAnyCultureTokens(1),
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
@@ -32,11 +32,19 @@ public class ReinforceTokenEffect extends ChooseActiveCardEffect {
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return "Reinforce " + _count + " " + _token.getCulture().getHumanReadable() + " token" + (_count > 1 ? "s" : "");
|
||||
if (_token != null)
|
||||
return "Reinforce " + _count + " " + _token.getCulture().getHumanReadable() + " token" + (_count > 1 ? "s" : "");
|
||||
else
|
||||
return "Reinforce " + _count + " culture token" + (_count > 1 ? "s" : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard card) {
|
||||
game.getGameState().addTokens(card, _token, _count);
|
||||
if (_token != null)
|
||||
game.getGameState().addTokens(card, _token, _count);
|
||||
else
|
||||
for (Token token : game.getGameState().getTokens(card).keySet())
|
||||
if (token.getCulture() != null)
|
||||
game.getGameState().addTokens(card, token, _count);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.gempukku.lotro.cards.set18.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractNewSite;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.cards.effects.OptionalEffect;
|
||||
import com.gempukku.lotro.cards.effects.ReinforceTokenEffect;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.PlayOrder;
|
||||
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Treachery & Deceit
|
||||
* Twilight Cost: 1
|
||||
* Type: Site
|
||||
* Game Text: Battleground. Plains. When the fellowship moves to this site, each player may reinforce a culture token.
|
||||
*/
|
||||
public class Card18_137 extends AbstractNewSite {
|
||||
public Card18_137() {
|
||||
super("Morannon Plains", 1, Direction.RIGHT);
|
||||
addKeyword(Keyword.BATTLEGROUND);
|
||||
addKeyword(Keyword.PLAINS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.movesTo(game, effectResult, self)) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
final PlayOrder counterClockwisePlayOrder = game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(game.getGameState().getCurrentPlayerId(), false);
|
||||
String playerId;
|
||||
while ((playerId = counterClockwisePlayOrder.getNextPlayer()) != null) {
|
||||
action.appendEffect(
|
||||
new OptionalEffect(
|
||||
action, playerId,
|
||||
new ReinforceTokenEffect(self, playerId, null)));
|
||||
}
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user