Couple of Wraith cards

This commit is contained in:
marcin.sciesinski
2019-09-09 15:19:34 -07:00
parent 3cbaa43f0e
commit ec2c8e19e4
7 changed files with 128 additions and 226 deletions

View File

@@ -52,6 +52,125 @@
}
}
},
"40_185": {
"title": "Blade Tip",
"culture": "wraith",
"cost": 0,
"type": "condition",
"keyword": "support area",
"effects": [
{
"type": "activatedTrigger",
"trigger": {
"type": "winsSkirmish",
"filter": "nazgul",
"memorize": "winner"
},
"effect": {
"type": "transfer",
"filter": "choose(self,zone(support))",
"where": "choose(character,inSkirmishAgainst(memory(winner)),not(hasAttached(name(Blade Tip))))"
}
},
{
"type": "trigger",
"trigger": {
"type": "startOfPhase",
"phase": "fellowship"
},
"effect": [
{
"type": "wound",
"filter": "all(hasAttached(self),not(ring bearer))"
},
{
"type": "conditional",
"condition": {
"type": "canSpot",
"filter": "hasAttached(self),ring bearer"
},
"effect": {
"type": "addBurdens"
}
}
]
}
]
},
"40_186": {
"title": "Dark Whispers",
"culture": "wraith",
"cost": 0,
"type": "event",
"keyword": "skirmish",
"condition": {
"type": "canSpotBurdens",
"amount": 3
},
"effects": {
"type": "event",
"effect": [
{
"type": "modifyStrength",
"filter": "choose(nazgul)",
"amount": {
"type": "condition",
"condition": {
"type": "canSpotBurdens",
"amount": 6
},
"true": 3,
"false": 1
},
"memorize": "chosenNazgul"
},
{
"type": "addKeyword",
"filter": "memory(chosenNazgul)",
"keyword": "damage",
"amount": {
"type": "condition",
"condition": {
"type": "canSpotBurdens",
"amount": 6
},
"true": 2,
"false": 1
}
}
]
}
},
"40_187": {
"title": "DarklySwift",
"culture": "wraith",
"cost": 1,
"type": "event",
"keyword": "regroup",
"condition": {
"type": "canSpot",
"filter": "companion,resistanceLessThan(4)"
},
"effects": {
"type": "event",
"cost": {
"type": "discard",
"filter": "choose(nazgul)"
},
"effect": {
"type": "addBurdens",
"amount": {
"type": "condition",
"condition": {
"type": "canSpot",
"filter": "companion,resistanceLessThan(1)"
},
"true": 2,
"false": 1
}
}
}
},
"40_211": {
"title": "*The Witch-king",
"subtitle": "Greatest of the Nine",

View File

@@ -1,58 +0,0 @@
package com.gempukku.lotro.cards.set40.wraith;
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.ActivateCardAction;
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
import com.gempukku.lotro.logic.effects.TransferPermanentEffect;
import com.gempukku.lotro.logic.modifiers.CantHealModifier;
import com.gempukku.lotro.logic.modifiers.CantRemoveBurdensModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.SpotCondition;
import com.gempukku.lotro.logic.timing.PlayConditions;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Title: Black Breath
* Set: Second Edition
* Side: Shadow
* Culture: Ringwraith
* Twilight Cost: 1
* Type: Condition - Support Area
* Card Number: 1U183
* Game Text: Skirmish: Transfer this condition from your support area to a character skirmishing a Nazgul. Burdens and wounds may not be removed from bearer.
*/
public class Card40_183 extends AbstractPermanent {
public Card40_183() {
super(Side.SHADOW, 1, CardType.CONDITION, Culture.WRAITH, "Black Breath");
}
@Override
public List<? extends ActivateCardAction> getPhaseActionsInPlay(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SKIRMISH, self, 0)
&& self.getZone() == Zone.SUPPORT
&& Filters.filter(game.getGameState().getSkirmish().getShadowCharacters(), game, Race.NAZGUL).size() > 0
&& game.getGameState().getSkirmish().getFellowshipCharacter() != null) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
new TransferPermanentEffect(self, game.getGameState().getSkirmish().getFellowshipCharacter()));
return Collections.singletonList(action);
}
return null;
}
@Override
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
List<Modifier> modifiers = new LinkedList<Modifier>();
modifiers.add(
new CantHealModifier(self, Filters.hasAttached(self)));
modifiers.add(
new CantRemoveBurdensModifier(self, new SpotCondition(Filters.ringBearer, Filters.hasAttached(self)), Filters.any));
return modifiers;
}
}

View File

@@ -1,63 +0,0 @@
package com.gempukku.lotro.cards.set40.wraith;
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import com.gempukku.lotro.logic.effects.AddBurdenEffect;
import com.gempukku.lotro.logic.effects.TransferPermanentEffect;
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.ActivateCardAction;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Title: Blade Tip
* Set: Second Edition
* Side: Shadow
* Culture: Ringwraith
* Twilight Cost: 0
* Type: Condition - Support Area
* Card Number: 1U185
* Game Text: Response: If a Nazgul wins a skirmish, transfer this condition from your support area to the losing character. Limit 1 per character. Wound bearer at the start of each fellowship phase. (If bearer is the Ring-bearer, add a burden instead.)
*/
public class Card40_185 extends AbstractPermanent {
public Card40_185() {
super(Side.SHADOW, 0, CardType.CONDITION, Culture.WRAITH, "Blade Tip");
}
@Override
public List<? extends ActivateCardAction> getOptionalInPlayAfterActions(String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (TriggerConditions.winsSkirmish(game, effectResult, Filters.and(Filters.owner(self.getOwner()), Race.NAZGUL))
&& self.getZone() == Zone.SUPPORT
&& game.getGameState().getSkirmish() != null && game.getGameState().getSkirmish().getFellowshipCharacter() != null
&& Filters.canSpot(game, Filters.sameCard(game.getGameState().getSkirmish().getFellowshipCharacter()), Filters.not(Filters.hasAttached(Filters.name(getTitle()))))) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
new TransferPermanentEffect(self, game.getGameState().getSkirmish().getFellowshipCharacter()));
return Collections.singletonList(action);
}
return null;
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.startOfPhase(game, effectResult, Phase.FELLOWSHIP)
&& self.getZone() == Zone.ATTACHED) {
boolean ringBearer = game.getGameState().getRingBearer(game.getGameState().getCurrentPlayerId()) == self.getAttachedTo();
RequiredTriggerAction action = new RequiredTriggerAction(self);
if (ringBearer) {
action.appendEffect(new AddBurdenEffect(self.getOwner(), self, 1));
} else {
action.appendEffect(new WoundCharactersEffect(self, self.getAttachedTo()));
}
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -1,53 +0,0 @@
package com.gempukku.lotro.cards.set40.wraith;
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.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
/**
* Title: Dark Whispers
* Set: Second Edition
* Side: Shadow
* Culture: Ringwraith
* Twilight Cost: 0
* Type: Event - Skirmish
* Card Number: 1R186
* Game Text: Spot 3 burdens to make a Nazgul strength +1 and damage +1 or spot 6 burdens to make a Nazgul strength +3 and damage +2.
*/
public class Card40_186 extends AbstractEvent {
public Card40_186() {
super(Side.SHADOW, 0, Culture.WRAITH, "Dark Whispers", Phase.SKIRMISH);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return game.getGameState().getBurdens() >= 3;
}
@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 a Nazgul", Race.NAZGUL) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard nazgul) {
int burdens = game.getGameState().getBurdens();
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(nazgul), (burdens >= 6) ? 3 : 1)));
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new KeywordModifier(self, Filters.sameCard(nazgul), Keyword.DAMAGE, (burdens >= 6) ? 2 : 1)));
}
});
return action;
}
}

View File

@@ -1,44 +0,0 @@
package com.gempukku.lotro.cards.set40.wraith;
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.AddBurdenEffect;
import com.gempukku.lotro.logic.modifiers.SpotCondition;
import com.gempukku.lotro.logic.modifiers.evaluator.ConditionEvaluator;
import com.gempukku.lotro.logic.timing.PlayConditions;
/**
* Title: Darkly Swift
* Set: Second Edition
* Side: Shadow
* Culture: Ringwraith
* Twilight Cost: 1
* Type: Event - Regroup
* Card Number: 1U187
* Game Text: Discard a Nazgul and spot a companion with 3 or less resistance to add a burden (or two burdens
* if you can spot a companion with 0 or less resistance.)
*/
public class Card40_187 extends AbstractEvent {
public Card40_187() {
super(Side.SHADOW, 1, Culture.WRAITH, "Darkly Swift", Phase.REGROUP);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return PlayConditions.canDiscardFromPlay(self, game, Race.NAZGUL)
&& PlayConditions.canSpot(game, CardType.COMPANION, Filters.maxResistance(3));
}
@Override
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new AddBurdenEffect(playerId, self,
new ConditionEvaluator(1, 2, new SpotCondition(CardType.COMPANION, Filters.maxResistance(0)))));
return action;
}
}

View File

@@ -1,13 +1,11 @@
package com.gempukku.lotro.cards.build.field.effect.appender;
import com.gempukku.lotro.cards.build.ActionContext;
import com.gempukku.lotro.cards.build.CardGenerationEnvironment;
import com.gempukku.lotro.cards.build.InvalidCardDefinitionException;
import com.gempukku.lotro.cards.build.PlayerSource;
import com.gempukku.lotro.cards.build.*;
import com.gempukku.lotro.cards.build.field.FieldUtils;
import com.gempukku.lotro.cards.build.field.effect.EffectAppender;
import com.gempukku.lotro.cards.build.field.effect.EffectAppenderProducer;
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.PlayerResolver;
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.ValueResolver;
import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.AddBurdenEffect;
import com.gempukku.lotro.logic.timing.Effect;
@@ -19,7 +17,7 @@ public class AddBurdens implements EffectAppenderProducer {
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(effectObject, "amount", "player");
final int amount = FieldUtils.getInteger(effectObject.get("amount"), "amount", 1);
final ValueSource amountSource = ValueResolver.resolveEvaluator(effectObject.get("amount"), 1, environment);
final String player = FieldUtils.getString(effectObject.get("player"), "player", "you");
final PlayerSource playerSource = PlayerResolver.resolvePlayer(player, environment);
@@ -28,6 +26,7 @@ public class AddBurdens implements EffectAppenderProducer {
@Override
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
final String playerAddingBurden = playerSource.getPlayer(actionContext);
final int amount = amountSource.getEvaluator(actionContext).evaluateExpression(actionContext.getGame(), null);
return new AddBurdenEffect(playerAddingBurden, actionContext.getSource(), amount);
}

View File

@@ -24,7 +24,7 @@ import java.util.Collection;
public class AddKeyword implements EffectAppenderProducer {
@Override
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(effectObject, "count", "filter", "memorize", "keyword", "until");
FieldUtils.validateAllowedFields(effectObject, "count", "filter", "memorize", "keyword", "amount", "until");
final ValueSource valueSource = ValueResolver.resolveEvaluator(effectObject.get("count"), 1, environment);
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter");
@@ -37,7 +37,8 @@ public class AddKeyword implements EffectAppenderProducer {
int value = 1;
if (keywordSplit.length == 2)
value = Integer.parseInt(keywordSplit[1]);
final int keywordValue = value;
final ValueSource amount = ValueResolver.resolveEvaluator(effectObject.get("amount"), value, environment);
MultiEffectAppender result = new MultiEffectAppender();
@@ -48,8 +49,9 @@ public class AddKeyword implements EffectAppenderProducer {
@Override
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
final Collection<? extends PhysicalCard> cardsFromMemory = actionContext.getCardsFromMemory(memory);
final int keywordCount = amount.getEvaluator(actionContext).evaluateExpression(actionContext.getGame(), null);
return new AddUntilModifierEffect(
new KeywordModifier(actionContext.getSource(), Filters.in(cardsFromMemory), keyword, keywordValue), until);
new KeywordModifier(actionContext.getSource(), Filters.in(cardsFromMemory), keyword, keywordCount), until);
}
});