"Corsair Freebooter"

This commit is contained in:
marcins78@gmail.com
2011-11-14 12:03:50 +00:00
parent 92eeee51e4
commit c00aa8ad41
15 changed files with 93 additions and 30 deletions

View File

@@ -539,6 +539,10 @@ public class PlayConditions {
return Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(fromFilters, Filters.hasToken(token, count))).size() > 0;
}
public static boolean canRemoveAnyCultureTokens(LotroGame game, int count, Filterable... fromFilters) {
return Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(fromFilters, Filters.hasAnyCultureTokens(count))).size() > 0;
}
public static boolean canRemoveToken(GameState gameState, PhysicalCard from, Token token) {
return canRemoveToken(gameState, from, token, 1);
}

View File

@@ -8,11 +8,11 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
public class ChooseAndRemoveTokensFromCardEffect extends ChooseActiveCardEffect {
public class ChooseAndRemoveCultureTokensFromCardEffect extends ChooseActiveCardEffect {
private Token _token;
private int _count;
public ChooseAndRemoveTokensFromCardEffect(PhysicalCard source, String playerId, Token token, int count, Filterable... filters) {
public ChooseAndRemoveCultureTokensFromCardEffect(PhysicalCard source, String playerId, Token token, int count, Filterable... filters) {
super(source, playerId, "Choose card to remove tokens from", filters);
_token = token;
_count = count;
@@ -23,7 +23,7 @@ public class ChooseAndRemoveTokensFromCardEffect extends ChooseActiveCardEffect
if (_token != null)
return Filters.hasToken(_token, _count);
else
return Filters.hasAnyTokens(_count);
return Filters.hasAnyCultureTokens(_count);
}
@Override

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set5.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.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -61,7 +61,7 @@ public class Card5_045 extends AbstractMinion {
&& PlayConditions.canRemoveTokens(game, Token.ISENGARD, 3, Keyword.MACHINE)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.ISENGARD, 3, Keyword.MACHINE));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ISENGARD, 3, Keyword.MACHINE));
action.appendCost(
new ExertCharactersEffect(self, self));
action.appendCost(

View File

@@ -4,7 +4,7 @@ import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -61,7 +61,7 @@ public class Card5_046 extends AbstractMinion {
&& PlayConditions.canRemoveTokens(game, Token.ISENGARD, 4, Keyword.MACHINE)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.ISENGARD, 4, Keyword.MACHINE));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ISENGARD, 4, Keyword.MACHINE));
action.appendCost(
new ExertCharactersEffect(self, self));
action.appendCost(

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set5.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.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -61,7 +61,7 @@ public class Card5_047 extends AbstractMinion {
&& PlayConditions.canRemoveTokens(game, Token.ISENGARD, 5, Keyword.MACHINE)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.ISENGARD, 5, Keyword.MACHINE));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ISENGARD, 5, Keyword.MACHINE));
action.appendCost(
new ExertCharactersEffect(self, self));
action.appendCost(

View File

@@ -4,7 +4,7 @@ import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardFromDiscardIntoHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -39,7 +39,7 @@ public class Card5_079 extends AbstractPermanent {
ActivateCardAction action = new ActivateCardAction(self);
List<Effect> possibleEffects = new LinkedList<Effect>();
possibleEffects.add(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, null, 2, Keyword.MACHINE) {
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, null, 2, Keyword.MACHINE) {
@Override
public String getText(LotroGame game) {
return "Remove 2 tokens from a machine";

View File

@@ -4,7 +4,7 @@ import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.cards.modifiers.ArcheryTotalModifier;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.PhysicalCard;
@@ -40,7 +40,7 @@ public class Card5_087 extends AbstractPermanent {
ActivateCardAction action = new ActivateCardAction(self);
List<Effect> possibleEffects = new LinkedList<Effect>();
possibleEffects.add(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, null, 2, Keyword.MACHINE) {
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, null, 2, Keyword.MACHINE) {
@Override
public String getText(LotroGame game) {
return "Remove 2 tokens from a machine";

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set6.gondor;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -44,7 +44,7 @@ public class Card6_050 extends AbstractCompanion {
final ActivateCardAction action = new ActivateCardAction(self);
action.setText("Remove ELVEN token...");
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.ELVEN, 1, Filters.any));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ELVEN, 1, Filters.any));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a minion", CardType.MINION, Filters.inSkirmishAgainst(self)) {
@Override
@@ -61,7 +61,7 @@ public class Card6_050 extends AbstractCompanion {
final ActivateCardAction action = new ActivateCardAction(self);
action.setText("Remove DWARVEN token...");
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.DWARVEN, 1, Filters.any));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.DWARVEN, 1, Filters.any));
action.appendEffect(
new ChooseAndHealCharactersEffect(action, playerId, 1, 1, Race.DWARF));
actions.add(action);
@@ -71,7 +71,7 @@ public class Card6_050 extends AbstractCompanion {
&& PlayConditions.canRemoveTokens(game, Token.ROHAN, 1, Filters.any)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.ROHAN, 1, Filters.any));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ROHAN, 1, Filters.any));
action.appendEffect(
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, 2, CardType.MINION));
actions.add(action);

View File

@@ -37,7 +37,7 @@ public class Card6_055 extends AbstractAttachableFPPossession {
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.START_OF_TURN) {
final Set<Culture> cultureTokens = new HashSet<Culture>();
for (PhysicalCard physicalCard : Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.hasAnyTokens(1))) {
for (PhysicalCard physicalCard : Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.hasAnyCultureTokens(1))) {
Map<Token, Integer> tokens = game.getGameState().getTokens(physicalCard);
for (Map.Entry<Token, Integer> tokenIntegerEntry : tokens.entrySet()) {
if (tokenIntegerEntry.getValue() > 0) {

View File

@@ -5,7 +5,7 @@ import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilStartOfPhaseActionProxyEffect;
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
import com.gempukku.lotro.cards.effects.PreventAllWoundsActionProxy;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -63,7 +63,7 @@ public class Card6_060 extends AbstractMinion {
&& PlayConditions.canExert(self, game, 2, self)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.ISENGARD, 1, Keyword.MACHINE));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ISENGARD, 1, Keyword.MACHINE));
action.appendCost(
new ExertCharactersEffect(self, self));
action.appendCost(

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set7.gondor;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -41,7 +41,7 @@ public class Card7_107 extends AbstractCompanion {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.GONDOR, 1, Filters.owner(playerId), CardType.CONDITION));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GONDOR, 1, Filters.owner(playerId), CardType.CONDITION));
int twilight = game.getGameState().getTwilightPool();
if (twilight >= 1)
action.appendEffect(

View File

@@ -6,7 +6,7 @@ import com.gempukku.lotro.cards.effects.AddTokenEffect;
import com.gempukku.lotro.cards.effects.CheckLimitEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -46,7 +46,7 @@ public class Card7_281 extends AbstractPermanent {
&& PlayConditions.canRemoveTokens(game, Token.SAURON, 1, CardType.CONDITION)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.SAURON, 1, CardType.CONDITION));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.SAURON, 1, CardType.CONDITION));
action.appendEffect(
new CheckLimitEffect(action, self, 2, Phase.SKIRMISH,
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 1, Culture.SAURON, Race.ORC)));

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set8.raider;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveTokensFromCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -40,7 +40,7 @@ public class Card8_049 extends AbstractMinion {
&& PlayConditions.canRemoveTokens(game, Token.RAIDER, 1, Filters.any)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndRemoveTokensFromCardEffect(self, playerId, Token.RAIDER, 1, Filters.any));
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.RAIDER, 1, Filters.any));
action.appendEffect(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.POSSESSION, Filters.attachedTo(Filters.inSkirmishAgainst(self))));
return Collections.singletonList(action);

View File

@@ -0,0 +1,58 @@
package com.gempukku.lotro.cards.set8.raider;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddTokenEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Token;
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.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Siege of Gondor
* Side: Shadow
* Culture: Raider
* Twilight Cost: 3
* Type: Minion • Man
* Strength: 8
* Vitality: 2
* Site: 4
* Game Text: Corsair. When you play this minion, you may remove 2 culture tokens to add 2 [RAIDER] tokens to a card
* that already has a [RAIDER] token on it.
*/
public class Card8_054 extends AbstractMinion {
public Card8_054() {
super(3, 8, 2, 4, Race.MAN, Culture.RAIDER, "Corsair Freebooter");
addKeyword(Keyword.CORSAIR);
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (PlayConditions.played(game, effectResult, self)
&& PlayConditions.canRemoveAnyCultureTokens(game, 2, Filters.any)) {
final OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, null, 2, Filters.any));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a card to add tokens to", Filters.hasToken(Token.RAIDER)) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
action.insertEffect(
new AddTokenEffect(self, self, Token.RAIDER, 2));
}
});
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -85,14 +85,15 @@ public class Filters {
};
}
public static Filter hasAnyTokens(final int count) {
public static Filter hasAnyCultureTokens(final int count) {
return new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
Map<Token, Integer> tokens = gameState.getTokens(physicalCard);
for (Integer integer : tokens.values()) {
if (integer >= count)
return true;
for (Map.Entry<Token, Integer> tokenCount : tokens.entrySet()) {
if (tokenCount.getKey().getCulture() != null)
if (tokenCount.getValue() >= count)
return true;
}
return false;
}