Set 2 Gondor cards

This commit is contained in:
marcin.sciesinski
2020-03-02 03:28:32 -08:00
parent a9630f5943
commit aa4294d4d9
10 changed files with 447 additions and 427 deletions

View File

@@ -0,0 +1,244 @@
{
"2_31": {
"side": "free_people",
"cost": 2,
"culture": "Gondor",
"title": "Blood of Numenor",
"type": "condition",
"keyword": "Support Area",
"effects": [
{
"type": "extraCost",
"cost": {
"type": "exert",
"filter": "choose(culture(gondor),companion)"
}
},
{
"type": "trigger",
"trigger": {
"type": "played",
"filter": "culture(sauron),orc",
"memorize": "playedOrc"
},
"effect": {
"type": "exhaust",
"filter": "memory(playedOrc)"
}
},
{
"type": "modifier",
"modifier": {
"type": "skipPhase",
"phase": "archery"
}
},
{
"type": "trigger",
"trigger": {
"type": "startOfPhase",
"phase": "regroup"
},
"effect": {
"type": "discard",
"filter": "self"
}
}
]
},
"2_32": {
"side": "free_people",
"cost": 0,
"strength": 1,
"culture": "Gondor",
"possession": "Hand Weapon",
"title": "Flaming Brand",
"type": "possession",
"target": "man",
"effects": [
{
"type": "extrapossessionclass"
},
{
"type": "modifier",
"modifier": {
"type": "modifyStrength",
"filter": "bearer,inSkirmishAgainst(Nazgul)",
"amount": 2
}
},
{
"type": "modifier",
"modifier": {
"type": "addKeyword",
"filter": "bearer,inSkirmishAgainst(Nazgul)",
"keyword": "damage+1"
}
}
]
},
"2_33": {
"side": "free_people",
"cost": 0,
"culture": "Gondor",
"title": "Flee in Terror",
"type": "event",
"keyword": "Response",
"effects": {
"type": "responseEvent",
"trigger": {
"type": "winsSkirmish",
"filter": "culture(gondor),companion"
},
"effect": [
{
"type": "chooseActiveCards",
"filter": "choose(exhausted,orc)",
"memorize": "chosenOrc",
"text": "Choose exhausted Orc"
},
{
"type": "preventable",
"player": "ownerFromMemory(chosenOrc)",
"cost": {
"type": "removeTwilight",
"amount": 3
},
"text": "Remove (3) to prevent discarding exhausted {chosenOrc}",
"effect": {
"type": "discard",
"filter": "memory(chosenOrc)"
}
}
]
}
},
"2_34": {
"side": "free_people",
"cost": 0,
"culture": "Gondor",
"title": "Gondor Will See It Done",
"type": "event",
"keyword": "Response",
"effects": {
"type": "responseEvent",
"trigger": {
"type": "aboutToTakeWound",
"filter": "companion"
},
"cost": {
"type": "exert",
"filter": "choose(culture(gondor),companion)"
},
"effect": {
"type": "preventWound",
"filter": "choose(companion)"
}
}
},
"2_35": {
"side": "free_people",
"cost": 1,
"culture": "Gondor",
"title": "Natural Cover",
"type": "condition",
"keyword": "Support Area",
"condition": {
"type": "canSpot",
"filter": "ranger"
},
"effects": {
"type": "modifier",
"modifier": {
"type": "modifyArcheryTotal",
"condition": {
"type": "location",
"filter": "forest"
},
"side": "shadow",
"amount": -2
}
}
},
"2_36": {
"side": "free_people",
"cost": 0,
"culture": "Gondor",
"title": "No Mere Ranger",
"type": "event",
"keyword": "Skirmish",
"effects": {
"type": "event",
"cost": {
"type": "exert",
"filter": "choose(name(Aragorn))"
},
"effect": {
"type": "modifyStrength",
"filter": "choose(companion,not(name(Aragorn)))",
"memorize": "chosenCompanion",
"amount": {
"type": "condition",
"condition": {
"type": "memoryMatches",
"memory": "chosenCompanion",
"filter": "signet(aragorn)"
},
"true": 3,
"false": 2
}
}
}
},
"2_37": {
"side": "free_people",
"cost": 0,
"culture": "Gondor",
"title": "Sentinels of Numenor",
"type": "event",
"keyword": "Skirmish",
"effects": {
"type": "event",
"effect": {
"type": "modifyStrength",
"filter": "choose(culture(gondor),companion)",
"memorize": "chosenCompanion",
"amount": {
"type": "condition",
"condition": {
"type": "fierceSkirmish"
},
"true": 4,
"false": 2
}
}
}
},
"2_38": {
"side": "free_people",
"cost": 1,
"culture": "Gondor",
"possession": "Shield",
"title": "*Shield of Boromir",
"type": "possession",
"target": "culture(gondor),companion",
"effects": [
{
"type": "modifier",
"modifier": {
"type": "modifyArcheryTotal",
"side": "shadow",
"amount": -1
}
},
{
"type": "modifier",
"modifier": {
"type": "cancelStrengthBonusTo",
"filter": "minion,inSkirmishAgainst(bearer,name(Boromir))",
"from": "weapon"
}
}
]
}
}

View File

@@ -0,0 +1,203 @@
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.CardSets;
import com.gempukku.lotro.game.LotroCardBlueprint;
import com.gempukku.lotro.game.packs.SetDefinition;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.*;
public class CreateCardTemplates {
private static String[] _packageNames =
new String[]{
"", ".dwarven", ".dunland", ".elven", ".fallenRealms", ".gandalf", ".gollum", ".gondor", ".isengard", ".men", ".orc",
".raider", ".rohan", ".moria", ".wraith", ".sauron", ".shire", ".site", ".uruk_hai",
//Additional Hobbit Draft packages
".esgaroth", ".gundabad", ".smaug", ".spider", ".troll"
};
public static void main(String[] args) {
int set = 2;
final String property = System.getProperty("user.dir");
String projectRoot = new File(property).getAbsolutePath();
File path = new File(projectRoot + "/gemp-lotr-async/src/main/web/cards");
File setPath = new File(path, "set" + set);
CardSets cardSets = new CardSets();
Map<String, Map<String, LotroCardBlueprint>> cardsByFileName = new HashMap<>();
SetDefinition setDefinition = cardSets.getSetDefinitions().get("" + set);
if (setDefinition.hasFlag("needsLoading")) {
final Set<String> allCards = setDefinition.getAllCards();
for (String blueprintId : allCards) {
blueprintId = stripBlueprintModifiers(blueprintId);
try {
// Ensure it's loaded
LotroCardBlueprint cardBlueprint = getBlueprint(blueprintId);
String key = getKey(cardBlueprint);
Map<String, LotroCardBlueprint> list = cardsByFileName.computeIfAbsent(key, k -> new LinkedHashMap<>());
list.put(blueprintId, cardBlueprint);
} catch (CardNotFoundException exp) {
// Ignore card that is not defined
}
}
}
for (Map.Entry<String, Map<String, LotroCardBlueprint>> cardsOfType : cardsByFileName.entrySet()) {
String type = cardsOfType.getKey();
File typePath = new File(setPath, "set" + set + "-" + type + ".json");
if (!typePath.exists()) {
JSONObject jsonObject = new JSONObject();
Map<String, LotroCardBlueprint> cards = cardsOfType.getValue();
for (Map.Entry<String, LotroCardBlueprint> cardEntry : cards.entrySet()) {
String blueprintId = cardEntry.getKey();
LotroCardBlueprint card = cardEntry.getValue();
JSONObject cardJson = new JSONObject();
cardJson.put("title", (card.isUnique() ? "*" : "") + card.getTitle());
if (card.getSubtitle() != null)
cardJson.put("subtitle", card.getSubtitle());
if (card.getSide() != null)
cardJson.put("side", card.getSide().name().toLowerCase());
if (card.getCulture() != null)
cardJson.put("culture", card.getCulture().getHumanReadable());
cardJson.put("cost", card.getTwilightCost());
cardJson.put("type", card.getCardType().name().toLowerCase());
if (card.getRace() != null)
cardJson.put("race", card.getRace().getHumanReadable());
if (card.getPossessionClasses() != null) {
JSONArray array = new JSONArray();
for (PossessionClass possessionClass : card.getPossessionClasses()) {
array.add(possessionClass.getHumanReadable());
}
if (array.size() == 1)
cardJson.put("possession", array.get(0));
else
cardJson.put("possession", array);
}
if (card.getSignet() != null)
cardJson.put("signet", card.getSignet().name().toLowerCase());
if (card.getStrength() != 0)
cardJson.put("strength", card.getStrength());
if (card.getVitality() != 0)
cardJson.put("vitality", card.getVitality());
if (card.getResistance() != 0)
cardJson.put("resistance", card.getResistance());
if (card.getCardType() == CardType.ALLY) {
if (card.getAllyHomeSiteBlock() != null) {
String home = card.getAllyHomeSiteBlock().getHumanReadable();
for (int allyHomeSiteNumber : card.getAllyHomeSiteNumbers()) {
home += "," + allyHomeSiteNumber;
}
cardJson.put("allyHome", home);
}
}
if (card.getCardType() == CardType.SITE)
cardJson.put("block", card.getSiteBlock().getHumanReadable());
if (card.getSiteNumber() != 0)
cardJson.put("site", card.getSiteNumber());
if (card.getCardType() == CardType.SITE)
cardJson.put("direction", card.getSiteDirection().name().toLowerCase());
// Keywords handling
JSONArray keywords = new JSONArray();
for (Keyword keyword : Keyword.values()) {
if (card.hasKeyword(keyword)) {
int count = card.getKeywordCount(keyword);
if (count > 1)
keywords.add(keyword.getHumanReadable() + "+" + count);
else
keywords.add(keyword.getHumanReadable());
}
}
if (keywords.size() == 1)
cardJson.put("keyword", keywords.get(0));
if (keywords.size() > 1)
cardJson.put("keyword", keywords);
jsonObject.put(blueprintId, cardJson);
}
//Write JSON file
try (FileWriter file = new FileWriter(typePath)) {
file.write(jsonObject.toJSONString());
file.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
private static String getKey(LotroCardBlueprint cardBlueprint) {
if (cardBlueprint.getCulture() != null)
return cardBlueprint.getCulture().getHumanReadable().toLowerCase();
if (cardBlueprint.getCardType() == CardType.SITE)
return "site";
return "ring";
}
public static String stripBlueprintModifiers(String blueprintId) {
if (blueprintId.endsWith("*"))
blueprintId = blueprintId.substring(0, blueprintId.length() - 1);
if (blueprintId.endsWith("T"))
blueprintId = blueprintId.substring(0, blueprintId.length() - 1);
return blueprintId;
}
private static LotroCardBlueprint getBlueprint(String blueprintId) throws CardNotFoundException {
String[] blueprintParts = blueprintId.split("_");
String setNumber = blueprintParts[0];
String cardNumber = blueprintParts[1];
for (String packageName : _packageNames) {
LotroCardBlueprint blueprint = null;
try {
blueprint = tryLoadingFromPackage(packageName, setNumber, cardNumber);
} catch (IllegalAccessException | InstantiationException e) {
throw new CardNotFoundException(blueprintId);
}
if (blueprint != null)
return blueprint;
}
throw new CardNotFoundException(blueprintId);
}
private static LotroCardBlueprint tryLoadingFromPackage(String packageName, String setNumber, String cardNumber) throws IllegalAccessException, InstantiationException {
try {
Class clazz = Class.forName("com.gempukku.lotro.cards.set" + setNumber + packageName + ".Card" + setNumber + "_" + normalizeId(cardNumber));
return (LotroCardBlueprint) clazz.newInstance();
} catch (ClassNotFoundException e) {
// Ignore
return null;
}
}
private static String normalizeId(String blueprintPart) {
int id = Integer.parseInt(blueprintPart);
if (id < 10)
return "00" + id;
else if (id < 100)
return "0" + id;
else
return String.valueOf(id);
}
}

View File

@@ -1,65 +0,0 @@
package com.gempukku.lotro.cards.set2.gondor;
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.RequiredTriggerAction;
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
import com.gempukku.lotro.logic.effects.ExhaustCharacterEffect;
import com.gempukku.lotro.logic.effects.SelfDiscardEffect;
import com.gempukku.lotro.logic.modifiers.AbstractExtraPlayCostModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.ShouldSkipPhaseModifier;
import com.gempukku.lotro.logic.modifiers.cost.ExertExtraPlayCostModifier;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import com.gempukku.lotro.logic.timing.results.PlayCardResult;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* Set: Mines of Moria
* Side: Free
* Culture: Gondor
* Twilight Cost: 2
* Type: Condition
* Game Text: To play, exert a [GONDOR] companion. Plays to your support area. Each [SAURON] Orc comes into play
* exhausted. Skip the archery phase. Discard this condition during the regroup phase.
*/
public class Card2_031 extends AbstractPermanent {
public Card2_031() {
super(Side.FREE_PEOPLE, 2, CardType.CONDITION, Culture.GONDOR, "Blood of Numenor");
}
@Override
public List<? extends AbstractExtraPlayCostModifier> getExtraCostToPlay(LotroGame game, PhysicalCard self) {
return Collections.singletonList(
new ExertExtraPlayCostModifier(self, self, null, Culture.GONDOR, CardType.COMPANION));
}
@Override
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
return Arrays.asList(
new ShouldSkipPhaseModifier(self, Phase.ARCHERY));
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, Filters.and(Culture.SAURON, Race.ORC, CardType.MINION))) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new ExhaustCharacterEffect(self, action, ((PlayCardResult) effectResult).getPlayedCard()));
return Collections.singletonList(action);
}
if (TriggerConditions.startOfPhase(game, effectResult, Phase.REGROUP)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new SelfDiscardEffect(self));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -1,59 +0,0 @@
package com.gempukku.lotro.cards.set2.gondor;
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.cardtype.AbstractAttachableFPPossession;
import com.gempukku.lotro.logic.modifiers.Condition;
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Mines of Moria
* Side: Free
* Culture: Gondor
* Twilight Cost: 0
* Type: Possession • Hand Weapon
* Strength: +1
* Game Text: Bearer must be a Man. This weapon may be borne in addition to 1 other hand weapon. Bearer is strength +2
* and damage +1 while skirmishing a Nazgul.
*/
public class Card2_032 extends AbstractAttachableFPPossession {
public Card2_032() {
super(0, 1, 0, Culture.GONDOR, PossessionClass.HAND_WEAPON, "Flaming Brand");
}
@Override
public Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Race.MAN;
}
@Override
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self, PhysicalCard attachedTo) {
return true;
}
@Override
public List<? extends Modifier> getInPlayModifiers(LotroGame game, final PhysicalCard self) {
Condition condition = new Condition() {
@Override
public boolean isFullfilled(LotroGame game) {
return game.getGameState().getSkirmish() != null
&& game.getGameState().getSkirmish().getFellowshipCharacter() == self.getAttachedTo()
&& Filters.filter(game.getGameState().getSkirmish().getShadowCharacters(), game, Race.NAZGUL).size() > 0;
}
};
List<Modifier> modifiers = new LinkedList<Modifier>();
modifiers.add(
new StrengthModifier(self, Filters.hasAttached(self), condition, 2));
modifiers.add(
new KeywordModifier(self, Filters.hasAttached(self), condition, Keyword.DAMAGE, 1));
return modifiers;
}
}

View File

@@ -1,64 +0,0 @@
package com.gempukku.lotro.cards.set2.gondor;
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.PlayUtils;
import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.actions.PlayEventAction;
import com.gempukku.lotro.logic.cardtype.AbstractResponseEvent;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.effects.PreventableEffect;
import com.gempukku.lotro.logic.effects.RemoveTwilightEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.PlayConditions;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import java.util.Collections;
import java.util.List;
/**
* Set: Mines of Moria
* Side: Free
* Culture: Gondor
* Twilight Cost: 0
* Type: Event
* Game Text: Response: If a [GONDOR] companion wins a skirmish, discard an exhausted Orc. That minion's owner may
* remove (3) to prevent this.
*/
public class Card2_033 extends AbstractResponseEvent {
public Card2_033() {
super(Side.FREE_PEOPLE, 0, Culture.GONDOR, "Flee in Terror");
}
@Override
public List<PlayEventAction> getPlayResponseEventAfterActions(final String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (PlayConditions.canPlayCardDuringPhase(game, (Phase) null, self)
&& TriggerConditions.winsSkirmish(game, effectResult, Filters.and(Culture.GONDOR, CardType.COMPANION))
&& PlayUtils.checkPlayRequirements(game, self, Filters.any, 0, 0, false, false)) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a minion", Race.ORC, Filters.exhausted) {
@Override
protected void cardSelected(LotroGame game, final PhysicalCard orc) {
action.insertEffect(
new PreventableEffect(action,
new DiscardCardsFromPlayEffect(playerId, self, orc),
Collections.singletonList(orc.getOwner()),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(CostToEffectAction subAction, String playerId) {
return new RemoveTwilightEffect(3);
}
}
));
}
});
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -1,53 +0,0 @@
package com.gempukku.lotro.cards.set2.gondor;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.PlayUtils;
import com.gempukku.lotro.logic.actions.PlayEventAction;
import com.gempukku.lotro.logic.cardtype.AbstractResponseEvent;
import com.gempukku.lotro.logic.effects.PreventableCardEffect;
import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseAndPreventCardEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.PlayConditions;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Set: Mines of Moria
* Side: Free
* Culture: Gondor
* Twilight Cost: 0
* Type: Event
* Game Text: Response: If a companion is about to take a wound, exert a [GONDOR] companion to prevent that wound.
*/
public class Card2_034 extends AbstractResponseEvent {
public Card2_034() {
super(Side.FREE_PEOPLE, 0, Culture.GONDOR, "Gondor Will See It Done");
}
@Override
public List<PlayEventAction> getPlayResponseEventBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (TriggerConditions.isGettingWounded(effect, game, CardType.COMPANION)
&& PlayConditions.canExert(self, game, Culture.GONDOR, CardType.COMPANION)
&& PlayUtils.checkPlayRequirements(game, self, Filters.any, 0, 0, false, false)) {
final WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect;
Collection<PhysicalCard> woundedCards = woundEffect.getAffectedCardsMinusPrevented(game);
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Culture.GONDOR, CardType.COMPANION));
action.appendEffect(
new ChooseAndPreventCardEffect(self, (PreventableCardEffect) effect, playerId, "Choose companion", CardType.COMPANION));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -1,41 +0,0 @@
package com.gempukku.lotro.cards.set2.gondor;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
import com.gempukku.lotro.logic.modifiers.ArcheryTotalModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.condition.LocationCondition;
import java.util.Collections;
import java.util.List;
/**
* Set: Mines of Moria
* Side: Free
* Culture: Gondor
* Twilight Cost: 1
* Type: Condition
* Game Text: To play, spot a ranger. Plays to your support area. While the fellowship is at a forest, the minion
* archery total is -2.
*/
public class Card2_035 extends AbstractPermanent {
public Card2_035() {
super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.GONDOR, "Natural Cover");
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return Filters.canSpot(game, Keyword.RANGER);
}
@Override
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
return Collections.singletonList(new ArcheryTotalModifier(self, Side.SHADOW, new LocationCondition(Keyword.FOREST), -2));
}
}

View File

@@ -1,51 +0,0 @@
package com.gempukku.lotro.cards.set2.gondor;
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.PlayEventAction;
import com.gempukku.lotro.logic.cardtype.AbstractEvent;
import com.gempukku.lotro.logic.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.PlayConditions;
/**
* Set: Mines of Moria
* Side: Free
* Culture: Gondor
* Twilight Cost: 0
* Type: Event
* Game Text: Skirmish: Exert Aragorn to make another companion strength +2 (or +3 if that companion has the Aragorn
* signet).
*/
public class Card2_036 extends AbstractEvent {
public Card2_036() {
super(Side.FREE_PEOPLE, 0, Culture.GONDOR, "No Mere Ranger", Phase.SKIRMISH);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return PlayConditions.canExert(self, game, Filters.aragorn);
}
@Override
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, final PhysicalCard self) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.aragorn));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose another companion", CardType.COMPANION, Filters.not(Filters.aragorn)) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
int bonus = (card.getBlueprint().getSignet() == Signet.ARAGORN) ? 3 : 2;
action.insertEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(card), bonus)));
}
});
return action;
}
}

View File

@@ -1,44 +0,0 @@
package com.gempukku.lotro.cards.set2.gondor;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
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.PlayEventAction;
import com.gempukku.lotro.logic.cardtype.AbstractEvent;
import com.gempukku.lotro.logic.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
/**
* Set: Mines of Moria
* Side: Free
* Culture: Gondor
* Twilight Cost: 0
* Type: Event
* Game Text: Skirmish: Make a [GONDOR] companion strength +2 (or +4 if in a fierce skirmish).
*/
public class Card2_037 extends AbstractEvent {
public Card2_037() {
super(Side.FREE_PEOPLE, 0, Culture.GONDOR, "Sentinels of Numenor", Phase.SKIRMISH);
}
@Override
public PlayEventAction getPlayEventCardAction(String playerId, final LotroGame game, final PhysicalCard self) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose GONDOR companion", Culture.GONDOR, CardType.COMPANION) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
int bonus = (game.getGameState().isFierceSkirmishes()) ? 4 : 2;
action.insertEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(card), bonus)));
}
});
return action;
}
}

View File

@@ -1,50 +0,0 @@
package com.gempukku.lotro.cards.set2.gondor;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.cardtype.AbstractAttachableFPPossession;
import com.gempukku.lotro.logic.modifiers.ArcheryTotalModifier;
import com.gempukku.lotro.logic.modifiers.CancelStrengthBonusTargetModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.SpotCondition;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Mines of Moria
* Side: Free
* Culture: Gondor
* Twilight Cost: 1
* Type: Possession • Shield
* Game Text: Bearer must be a [GONDOR] companion. The minion archery total is -1. If bearer is Boromir, each minion
* skirmishing him does not gain strength bonuses from weapons.
*/
public class Card2_038 extends AbstractAttachableFPPossession {
public Card2_038() {
super(1, 0, 0, Culture.GONDOR, PossessionClass.SHIELD, "Shield of Boromir", null, true);
}
@Override
public Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.and(Culture.GONDOR, CardType.COMPANION);
}
@Override
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
List<Modifier> modifiers = new LinkedList<Modifier>();
modifiers.add(new ArcheryTotalModifier(self, Side.SHADOW, -1));
modifiers.add(
new CancelStrengthBonusTargetModifier(self,
new SpotCondition(Filters.boromir, Filters.hasAttached(self)),
Filters.and(CardType.MINION, Filters.inSkirmishAgainst(Filters.boromir)),
Filters.weapon));
return modifiers;
}
}