Couple of Gondor cards
This commit is contained in:
@@ -321,6 +321,327 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"40_105": {
|
||||
"title": "Bow of the North",
|
||||
"culture": "gondor",
|
||||
"cost": 1,
|
||||
"type": "possession",
|
||||
"possession": "ranged weapon",
|
||||
"strength": 1,
|
||||
"target": "culture(gondor),man",
|
||||
"effects": {
|
||||
"type": "activated",
|
||||
"phase": "skirmish",
|
||||
"cost": {
|
||||
"type": "exert",
|
||||
"filter": "choose(bearer)"
|
||||
},
|
||||
"effect": {
|
||||
"type": "choice",
|
||||
"texts": [
|
||||
"Wound a roaming minion bearer is skirmishing",
|
||||
"Wound a minion bearer is skirmishing"
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
"type": "location",
|
||||
"filter": "not(your)"
|
||||
},
|
||||
"effect": {
|
||||
"type": "wound",
|
||||
"filter": "choose(roaming,minion,inSkirmishAgainst(bearer))"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
"type": "location",
|
||||
"filter": "your"
|
||||
},
|
||||
"effect": {
|
||||
"type": "wound",
|
||||
"filter": "choose(minion,inSkirmishAgainst(bearer))"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_106": {
|
||||
"title": "Dagger Strike",
|
||||
"culture": "gondor",
|
||||
"cost": 0,
|
||||
"type": "event",
|
||||
"keyword": "skirmish",
|
||||
"effects": {
|
||||
"type": "event",
|
||||
"effect": [
|
||||
{
|
||||
"type": "modifyStrength",
|
||||
"filter": "choose(or(culture(gondor),culture(shire)),companion,hasAttached(hand weapon))",
|
||||
"amount": 2,
|
||||
"memorize": "chosenCompanion"
|
||||
},
|
||||
{
|
||||
"type": "addKeyword",
|
||||
"filter": "memory(chosenCompanion)",
|
||||
"keyword": "damage+1"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"40_108": {
|
||||
"title": "*Flaming Brand",
|
||||
"culture": "gondor",
|
||||
"cost": 0,
|
||||
"type": "possession",
|
||||
"possession": "hand weapon",
|
||||
"strength": 1,
|
||||
"target": "culture(gondor),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"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"40_110": {
|
||||
"title": "*Into the Wild",
|
||||
"culture": "gondor",
|
||||
"cost": 1,
|
||||
"type": "condition",
|
||||
"keyword": "support area",
|
||||
"effects": [
|
||||
{
|
||||
"type": "modifier",
|
||||
"modifier": {
|
||||
"type": "modifySiteNumber",
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "ranger"
|
||||
},
|
||||
"filter": "minion,inPlay",
|
||||
"amount": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "activatedTrigger",
|
||||
"trigger": {
|
||||
"type": "winsSkirmish",
|
||||
"filter": "ranger",
|
||||
"memorize": "winner"
|
||||
},
|
||||
"cost": [
|
||||
{
|
||||
"type": "exert",
|
||||
"filter": "memory(winner)"
|
||||
},
|
||||
{
|
||||
"type": "discard",
|
||||
"filter": "self"
|
||||
}
|
||||
],
|
||||
"effect": {
|
||||
"type": "playNextSite"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"40_111": {
|
||||
"title": "*Legacy of Numenor",
|
||||
"culture": "gondor",
|
||||
"cost": 1,
|
||||
"type": "condition",
|
||||
"keyword": "support area",
|
||||
"effects": [
|
||||
{
|
||||
"type": "trigger",
|
||||
"trigger": {
|
||||
"type": "winsSkirmish",
|
||||
"filter": "culture(gondor),man",
|
||||
"memorize": "winner"
|
||||
},
|
||||
"effect": {
|
||||
"type": "heal",
|
||||
"filter": "memory(winner)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "trigger",
|
||||
"trigger": {
|
||||
"type": "losesSkirmish",
|
||||
"filter": "culture(gondor),man"
|
||||
},
|
||||
"effect": {
|
||||
"type": "discard",
|
||||
"filter": "self"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"40_112": {
|
||||
"title": "Might of Numenor",
|
||||
"culture": "gondor",
|
||||
"cost": 1,
|
||||
"type": "event",
|
||||
"keyword": [
|
||||
"maneuver",
|
||||
"tale"
|
||||
],
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "culture(gondor),companion"
|
||||
},
|
||||
"effects": {
|
||||
"type": "event",
|
||||
"effect": [
|
||||
{
|
||||
"type": "revealRandomCardsFromHand",
|
||||
"hand": "shadowPlayer",
|
||||
"forced": true,
|
||||
"memorize": "revealedCard"
|
||||
},
|
||||
{
|
||||
"type": "heal",
|
||||
"filter": "choose(companion)",
|
||||
"count": {
|
||||
"type": "twilightCostInMemory",
|
||||
"memory": "revealedCard"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"40_113": {
|
||||
"title": "pathfinder",
|
||||
"culture": "gondor",
|
||||
"cost": 0,
|
||||
"type": "event",
|
||||
"keyword": [
|
||||
"fellowship",
|
||||
"regroup"
|
||||
],
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "ranger"
|
||||
},
|
||||
"effects": {
|
||||
"type": "event",
|
||||
"effect": {
|
||||
"type": "playNextSite"
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_114": {
|
||||
"title": "Ranger of the North",
|
||||
"culture": "gondor",
|
||||
"cost": 2,
|
||||
"type": "companion",
|
||||
"race": "man",
|
||||
"strength": 6,
|
||||
"vitality": 3,
|
||||
"resistance": 6,
|
||||
"keyword": "ranger",
|
||||
"effects": [
|
||||
{
|
||||
"type": "modifyOwnCost",
|
||||
"amount": -1,
|
||||
"condition": [
|
||||
{
|
||||
"type": "canSpot",
|
||||
"filter": "culture(gondor),man"
|
||||
},
|
||||
{
|
||||
"type": "phase",
|
||||
"phase": "play starting fellowship"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "trigger",
|
||||
"trigger": {
|
||||
"type": "startOfPhase",
|
||||
"phase": "skirmish"
|
||||
},
|
||||
"condition": [
|
||||
{
|
||||
"type": "canSpot",
|
||||
"filter": "self,inSkirmish"
|
||||
},
|
||||
{
|
||||
"type": "location",
|
||||
"filter": "your"
|
||||
}
|
||||
],
|
||||
"effect": {
|
||||
"type": "exert",
|
||||
"filter": "all(minion,inSkirmish)"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"40_115": {
|
||||
"title": "A Ranger's Adaptability",
|
||||
"culture": "gondor",
|
||||
"cost": 1,
|
||||
"type": "event",
|
||||
"keyword": "maneuver",
|
||||
"effects": {
|
||||
"type": "event",
|
||||
"cost": {
|
||||
"type": "exert",
|
||||
"filter": "choose(culture(gondor),ranger)"
|
||||
},
|
||||
"effect": {
|
||||
"type": "choice",
|
||||
"texts": [
|
||||
"Exhaust a roaming minion",
|
||||
"Exhaust any minion"
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
"type": "location",
|
||||
"filter": "not(your)"
|
||||
},
|
||||
"effect": {
|
||||
"type": "exhaust",
|
||||
"filter": "choose(roaming,minion)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
"type": "location",
|
||||
"filter": "your"
|
||||
},
|
||||
"effect": {
|
||||
"type": "exhaust",
|
||||
"filter": "choose(minion)"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_313": {
|
||||
"title": "Athelas",
|
||||
"subtitle": "Asëa Aranion",
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package com.gempukku.lotro.cards.set15.gondor;
|
||||
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractCompanion;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.logic.effects.AddUntilStartOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.MinionSiteNumberModifier;
|
||||
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.AbstractCompanion;
|
||||
import com.gempukku.lotro.logic.effects.AddUntilStartOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.MinionSiteNumberModifier;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -48,7 +48,7 @@ public class Card15_064 extends AbstractCompanion {
|
||||
if (threats > 0)
|
||||
action.appendEffect(
|
||||
new AddUntilStartOfPhaseModifierEffect(
|
||||
new MinionSiteNumberModifier(self, Filters.and(Filters.in(Filters.filterActive(game, CardType.MINION)), Filters.inPlay()), null, threats), Phase.REGROUP));
|
||||
new MinionSiteNumberModifier(self, Filters.and(Filters.in(Filters.filterActive(game, CardType.MINION)), Filters.inPlay), null, threats), Phase.REGROUP));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class Card20_197 extends AbstractPermanent {
|
||||
@Override
|
||||
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
|
||||
return Collections.singletonList(new MinionSiteNumberModifier(
|
||||
self, Filters.and(CardType.MINION, Filters.inPlay()), new SpotCondition(Culture.GONDOR, Keyword.RANGER),
|
||||
self, Filters.and(CardType.MINION, Filters.inPlay), new SpotCondition(Culture.GONDOR, Keyword.RANGER),
|
||||
new CountActiveEvaluator(CardType.SITE, Zone.ADVENTURE_PATH, Filters.owner(self.getOwner()), Filters.currentRegion)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Card20_201 extends AbstractPermanent {
|
||||
new SelfDiscardEffect(self));
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new MinionSiteNumberModifier(self, Filters.and(CardType.MINION, Filters.inPlay()), null, 2)));
|
||||
new MinionSiteNumberModifier(self, Filters.and(CardType.MINION, Filters.inPlay), null, 2)));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.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.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractAttachableFPPossession;
|
||||
import com.gempukku.lotro.logic.effects.ChoiceEffect;
|
||||
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: Bow of the North
|
||||
* Set: Second Edition
|
||||
* Side: Free
|
||||
* Culture: Gondor
|
||||
* Twilight Cost: 1
|
||||
* Type: Possession - Ranged Weapon
|
||||
* Strength: +1
|
||||
* Card Number: 1C105
|
||||
* Game Text: Bearer must be a [GONDOR] Man.
|
||||
* Skirmish: Exert bearer to wound a roaming minion he is skirmishing or exert bearer to wound any minion he
|
||||
* is skirmishing if at a site from your adventure deck.
|
||||
*/
|
||||
public class Card40_105 extends AbstractAttachableFPPossession {
|
||||
public Card40_105() {
|
||||
super(1, 1, 0, Culture.GONDOR, PossessionClass.RANGED_WEAPON, "Bow of the North");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
|
||||
return Filters.and(Culture.GONDOR, Race.MAN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getPhaseActionsInPlay(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
|
||||
&& PlayConditions.canExert(self, game, Filters.hasAttached(self))) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.hasAttached(self)));
|
||||
List<Effect> possibleEffects = new ArrayList<Effect>(2);
|
||||
possibleEffects.add(
|
||||
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, Filters.roamingMinion, Filters.inSkirmishAgainst(Filters.hasAttached(self))) {
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return "Wound a roaming minion in skirmish against bearer";
|
||||
}
|
||||
});
|
||||
if (PlayConditions.location(game, Filters.owner(playerId)))
|
||||
possibleEffects.add(
|
||||
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, Filters.inSkirmishAgainst(Filters.hasAttached(self))) {
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return "Wound any minion in skirmish against bearer";
|
||||
}
|
||||
});
|
||||
action.appendEffect(
|
||||
new ChoiceEffect(action, playerId, possibleEffects));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.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.modifiers.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
|
||||
|
||||
/**
|
||||
* Title: Dagger Strike
|
||||
* Set: Second Edition
|
||||
* Side: Free
|
||||
* Culture: Gondor
|
||||
* Twilight Cost: 0
|
||||
* Type: Event - Skirmish
|
||||
* Card Number: 1C106
|
||||
* Game Text: Make a [GONDOR] or [SHIRE] companion bearing a hand weapon strength +2 and damage +1.
|
||||
*/
|
||||
public class Card40_106 extends AbstractEvent {
|
||||
public Card40_106() {
|
||||
super(Side.FREE_PEOPLE, 0, Culture.GONDOR, "Dagger Strike", Phase.SKIRMISH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, final PhysicalCard self) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose GONDOR of SHIRE companion bearing a hand weapon", Filters.or(Culture.GONDOR, Culture.SHIRE), CardType.COMPANION, Filters.hasAttached(PossessionClass.HAND_WEAPON)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard companion) {
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(companion), 2)));
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new KeywordModifier(self, Filters.sameCard(companion), Keyword.DAMAGE)));
|
||||
}
|
||||
}
|
||||
);
|
||||
return action;
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.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;
|
||||
|
||||
/**
|
||||
* Title: *Flaming Brand
|
||||
* Set: Second Edition
|
||||
* Side: Free
|
||||
* Culture: Gondor
|
||||
* Twilight Cost: 0
|
||||
* Type: Possession - Hand Weapon
|
||||
* Strength: +1
|
||||
* Card Number: 1R108
|
||||
* Game Text: Bearer must be a [GONDOR] Man. This weapon may be borne in addition to one other hand weapon. Bearer is strength +2 and damage +1 while skirmishing a Nazgul.
|
||||
*/
|
||||
public class Card40_108 extends AbstractAttachableFPPossession {
|
||||
public Card40_108() {
|
||||
super(0, 1, 0, Culture.GONDOR, PossessionClass.HAND_WEAPON, "Flaming Brand", null, true);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.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.actions.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
|
||||
import com.gempukku.lotro.logic.effects.ExertCharactersEffect;
|
||||
import com.gempukku.lotro.logic.effects.PlayNextSiteEffect;
|
||||
import com.gempukku.lotro.logic.effects.SelfDiscardEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.MinionSiteNumberModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.SpotCondition;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.logic.timing.results.CharacterWonSkirmishResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: *Into the Wild
|
||||
* Set: Second Edition
|
||||
* Side: Free
|
||||
* Culture: Gondor
|
||||
* Twilight Cost: 1
|
||||
* Type: Condition - Support Area
|
||||
* Card Number: 1U110
|
||||
* Game Text: While you can spot a ranger, the site number of each minion in play is +1.
|
||||
* Response: If a ranger wins a skirmish, exert that ranger and discard this condition to play the fellowship's
|
||||
* next site (replacing opponent's site if necessary).
|
||||
*/
|
||||
public class Card40_110 extends AbstractPermanent {
|
||||
public Card40_110() {
|
||||
super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.GONDOR, "Into the Wild", null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
|
||||
MinionSiteNumberModifier modifier = new MinionSiteNumberModifier(self,
|
||||
Filters.and(CardType.MINION, Filters.inPlay()), new SpotCondition(Keyword.RANGER), 1);
|
||||
return Collections.singletonList(modifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getOptionalInPlayAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.winsSkirmish(game, effectResult, Keyword.RANGER)) {
|
||||
CharacterWonSkirmishResult result = (CharacterWonSkirmishResult) effectResult;
|
||||
final PhysicalCard winner = result.getWinner();
|
||||
if (PlayConditions.canExert(self, game, winner)
|
||||
&& PlayConditions.canSelfDiscard(self, game)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ExertCharactersEffect(action, self, winner));
|
||||
action.appendCost(
|
||||
new SelfDiscardEffect(self));
|
||||
action.appendEffect(
|
||||
new PlayNextSiteEffect(action, playerId));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.gondor;
|
||||
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.logic.effects.SelfDiscardEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
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.effects.HealCharactersEffect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.results.CharacterWonSkirmishResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: *Legacy of Numenor
|
||||
* Set: Second Edition
|
||||
* Side: Free
|
||||
* Culture: Gondor
|
||||
* Twilight Cost: 1
|
||||
* Type: Condition - Support Area
|
||||
* Card Number: 1U111
|
||||
* Game Text: Each time a [GONDOR] man wins a skirmish, heal that character.
|
||||
* Discard this condition if a [GONDOR] man loses a skirmish.
|
||||
*/
|
||||
public class Card40_111 extends AbstractPermanent {
|
||||
public Card40_111() {
|
||||
super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.GONDOR, "Legacy of Numenor", null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.winsSkirmish(game, effectResult, Culture.GONDOR, Race.MAN)) {
|
||||
CharacterWonSkirmishResult result = (CharacterWonSkirmishResult) effectResult;
|
||||
final PhysicalCard winner = result.getWinner();
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new HealCharactersEffect(self, winner));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
if (TriggerConditions.losesSkirmish(game, effectResult, Culture.GONDOR, Race.MAN)) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new SelfDiscardEffect(self));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.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.ChooseAndHealCharactersEffect;
|
||||
import com.gempukku.lotro.logic.effects.RevealRandomCardsFromHandEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseOpponentEffect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: Might of Numenor
|
||||
* Set: Second Edition
|
||||
* Side: Free
|
||||
* Culture: Gondor
|
||||
* Twilight Cost: 1
|
||||
* Type: Event - Maneuver
|
||||
* Card Number: 1C112
|
||||
* Game Text: Tale. Spot a [GONDOR] companion to reveal a card at random from an opponent's hand. Heal X companions, where X is the twilight cost of the card revealed.
|
||||
*/
|
||||
public class Card40_112 extends AbstractEvent {
|
||||
public Card40_112() {
|
||||
super(Side.FREE_PEOPLE, 1, Culture.GONDOR, "Might of Numenor", Phase.MANEUVER);
|
||||
addKeyword(Keyword.TALE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
|
||||
return Filters.canSpot(game, Culture.GONDOR, CardType.COMPANION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayEventCardAction(final String playerId, LotroGame game, final PhysicalCard self) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseOpponentEffect(playerId) {
|
||||
@Override
|
||||
protected void opponentChosen(String opponentId) {
|
||||
action.insertEffect(
|
||||
new RevealRandomCardsFromHandEffect(playerId, opponentId, self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
PhysicalCard revealedCard = revealedCards.get(0);
|
||||
int twilightCost = revealedCard.getBlueprint().getTwilightCost();
|
||||
action.appendEffect(
|
||||
new ChooseAndHealCharactersEffect(action, playerId, twilightCost, twilightCost, CardType.COMPANION));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return action;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.gondor;
|
||||
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
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.PlayNextSiteEffect;
|
||||
|
||||
/**
|
||||
* Title: Pathfinder
|
||||
* Set: Second Edition
|
||||
* Side: Free
|
||||
* Culture: Gondor
|
||||
* Twilight Cost: 0
|
||||
* Type: Event - Fellowship or Regroup
|
||||
* Card Number: 1C113
|
||||
* Game Text: Spot a ranger to play the fellowship's next site (replacing opponent's site if necessary).
|
||||
*/
|
||||
public class Card40_113 extends AbstractEvent {
|
||||
public Card40_113() {
|
||||
super(Side.FREE_PEOPLE, 0, Culture.GONDOR, "Pathfinder", Phase.FELLOWSHIP, Phase.REGROUP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayEventCardAction(final String playerId, LotroGame game, PhysicalCard self) {
|
||||
final PlayEventAction action = new PlayEventAction(self, true);
|
||||
action.appendEffect(new PlayNextSiteEffect(action, playerId));
|
||||
return action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
|
||||
return Filters.canSpot(game, Keyword.RANGER);
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.gondor;
|
||||
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractCompanion;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.logic.effects.ExertCharactersEffect;
|
||||
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.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: Ranger of the North
|
||||
* Set: Second Edition
|
||||
* Side: Free
|
||||
* Culture: Gondor
|
||||
* Twilight Cost: 2
|
||||
* Type: Companion - Man
|
||||
* Strength: 6
|
||||
* Vitality: 3
|
||||
* Resistance: 6
|
||||
* Card Number: 1C114
|
||||
* Game Text: Ranger.
|
||||
* While you can spot a [GONDOR] man, this companion's twilight cost is -1 in your starting fellowship.
|
||||
* At the start of each skirmish involving this companion, each minion skirmishing this companion must exert if
|
||||
* at a site from your adventure deck.
|
||||
*/
|
||||
public class Card40_114 extends AbstractCompanion {
|
||||
public Card40_114() {
|
||||
super(2, 6, 3, 6, Culture.GONDOR, Race.MAN, null, "Ranger of the North");
|
||||
addKeyword(Keyword.RANGER);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getTwilightCostModifier(LotroGame game, PhysicalCard self) {
|
||||
if (game.getGameState().getCurrentPhase() == Phase.PLAY_STARTING_FELLOWSHIP
|
||||
&& Filters.canSpot(game, Culture.GONDOR, Race.MAN))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.startOfPhase(game, effectResult, Phase.SKIRMISH)
|
||||
&& PlayConditions.canSpot(game, self, Filters.inSkirmish)
|
||||
&& PlayConditions.location(game, Filters.owner(self.getOwner()))) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new ExertCharactersEffect(action, self, CardType.MINION, Filters.inSkirmish));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.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.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndExhaustCharactersEffect;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
|
||||
/**
|
||||
* Title: A Ranger's Adaptability
|
||||
* Set: Second Edition
|
||||
* Side: Free
|
||||
* Culture: Gondor
|
||||
* Twilight Cost: 1
|
||||
* Type: Event - Maneuver
|
||||
* Card Number: 1U115
|
||||
* Game Text: Exert a [GONDOR] ranger to exhaust a roaming minion (or any minion if at a site from your adventure deck.)
|
||||
*/
|
||||
public class Card40_115 extends AbstractEvent {
|
||||
public Card40_115() {
|
||||
super(Side.FREE_PEOPLE, 1, Culture.GONDOR, "A Ranger's Adaptability", Phase.MANEUVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
|
||||
return PlayConditions.canExert(self, game, Culture.GONDOR, Keyword.RANGER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Culture.GONDOR, Keyword.RANGER));
|
||||
if (PlayConditions.location(game, Filters.owner(playerId)))
|
||||
action.appendEffect(
|
||||
new ChooseAndExhaustCharactersEffect(action, playerId, 1, 1, CardType.MINION));
|
||||
else
|
||||
action.appendEffect(
|
||||
new ChooseAndExhaustCharactersEffect(action, playerId, 1, 1, Filters.roamingMinion));
|
||||
return action;
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,8 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
|
||||
private ActionSource playEventAction;
|
||||
|
||||
private ExtraPossessionClassTest extraPossessionClassTest;
|
||||
|
||||
// Building methods
|
||||
|
||||
public void setAllyHomeSites(SitesBlock block, int[] numbers) {
|
||||
@@ -68,6 +70,10 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
this.allyHomeSites = numbers;
|
||||
}
|
||||
|
||||
public void setExtraPossessionClassTest(ExtraPossessionClassTest extraPossessionClassTest) {
|
||||
this.extraPossessionClassTest = extraPossessionClassTest;
|
||||
}
|
||||
|
||||
public void appendExtraPlayCost(ExtraPlayCostSource extraPlayCostSource) {
|
||||
if (extraPlayCosts == null)
|
||||
extraPlayCosts = new LinkedList<>();
|
||||
@@ -582,6 +588,8 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
|
||||
@Override
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self, PhysicalCard attachedTo) {
|
||||
if (extraPossessionClassTest != null)
|
||||
return extraPossessionClassTest.isExtraPossessionClass(game, self, attachedTo);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.gempukku.lotro.cards.build;
|
||||
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
|
||||
public interface ExtraPossessionClassTest {
|
||||
boolean isExtraPossessionClass(LotroGame game, PhysicalCard self, PhysicalCard attachedTo);
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public class EffectFieldProcessor implements FieldProcessor {
|
||||
effectProcessors.put("modifyowncost", new ModifyOwnCost());
|
||||
effectProcessors.put("extracost", new ExtraCost());
|
||||
effectProcessors.put("modifier", new Modifier());
|
||||
effectProcessors.put("extrapossessionclass", new ExtraPossessionClassEffectProcessor());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@ public class EffectAppenderFactory {
|
||||
effectAppenderProducers.put("discard", new DiscardFromPlay());
|
||||
effectAppenderProducers.put("preventdiscard", new PreventCardEffectAppender());
|
||||
effectAppenderProducers.put("exert", new Exert());
|
||||
effectAppenderProducers.put("exhaust", new Exhaust());
|
||||
effectAppenderProducers.put("modifystrength", new ModifyStrength());
|
||||
effectAppenderProducers.put("addkeyword", new AddKeyword());
|
||||
effectAppenderProducers.put("modifyarcherytotal", new ModifyArcheryTotal());
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.gempukku.lotro.cards.build.field.effect;
|
||||
|
||||
import com.gempukku.lotro.cards.build.*;
|
||||
import com.gempukku.lotro.cards.build.field.EffectProcessor;
|
||||
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class ExtraPossessionClassEffectProcessor implements EffectProcessor {
|
||||
@Override
|
||||
public void processEffect(JSONObject value, BuiltLotroCardBlueprint blueprint, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(value, "attachedTo");
|
||||
|
||||
final String attachedFilter = FieldUtils.getString(value.get("attachedTo"), "attachedTo", "any");
|
||||
|
||||
final FilterableSource attachedFilterableSource = environment.getFilterFactory().generateFilter(attachedFilter, environment);
|
||||
|
||||
blueprint.setExtraPossessionClassTest(
|
||||
(game, self, attachedTo) -> {
|
||||
DefaultActionContext actionContext = new DefaultActionContext(self.getOwner(), game, self, null, null);
|
||||
final Filterable attachedFilterable = attachedFilterableSource.getFilterable(actionContext);
|
||||
return Filters.and(attachedFilterable).accepts(game, self);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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.ValueSource;
|
||||
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.CardResolver;
|
||||
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.ValueResolver;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.logic.actions.CostToEffectAction;
|
||||
import com.gempukku.lotro.logic.effects.ExhaustCharacterEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class Exhaust implements EffectAppenderProducer {
|
||||
@Override
|
||||
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(effectObject, "player", "count", "filter", "memorize");
|
||||
|
||||
final String player = FieldUtils.getString(effectObject.get("player"), "player", "you");
|
||||
final ValueSource valueSource = ValueResolver.resolveEvaluator(effectObject.get("count"), 1, environment);
|
||||
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter");
|
||||
final String memory = FieldUtils.getString(effectObject.get("memorize"), "memorize", "_temp");
|
||||
|
||||
MultiEffectAppender result = new MultiEffectAppender();
|
||||
|
||||
result.addEffectAppender(
|
||||
CardResolver.resolveCards(filter,
|
||||
valueSource, memory, player, "Choose cards to exhaust", environment));
|
||||
result.addEffectAppender(
|
||||
new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||
final Collection<? extends PhysicalCard> cardsFromMemory = actionContext.getCardsFromMemory(memory);
|
||||
return new ExhaustCharacterEffect(actionContext.getSource(), action, Filters.in(cardsFromMemory));
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,6 +36,7 @@ public class FilterFactory {
|
||||
simpleFilters.put("wounded", (actionContext) -> Filters.wounded);
|
||||
simpleFilters.put("unwounded", (actionContext) -> Filters.unwounded);
|
||||
simpleFilters.put("inskirmish", (actionContext) -> Filters.inSkirmish);
|
||||
simpleFilters.put("inplay", (actionContext) -> Filters.inPlay);
|
||||
simpleFilters.put("notassignedtoskirmish",
|
||||
(actionContext) -> Filters.notAssignedToSkirmish);
|
||||
simpleFilters.put("skirmishloser",
|
||||
|
||||
@@ -24,6 +24,7 @@ public class ModifierSourceFactory {
|
||||
modifierProducers.put("opponentmaynotdiscard", new OpponentMayNotDiscard());
|
||||
modifierProducers.put("addnotwilightforcompanionmove", new AddNoTwilightForCompanionMove());
|
||||
modifierProducers.put("modifyarcherytotal", new ModifyArcheryTotal());
|
||||
modifierProducers.put("modifysitenumber", new ModifySiteNumber());
|
||||
}
|
||||
|
||||
public ModifierSource getModifier(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.gempukku.lotro.cards.build.field.effect.modifier;
|
||||
|
||||
import com.gempukku.lotro.cards.build.*;
|
||||
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.ValueResolver;
|
||||
import com.gempukku.lotro.logic.modifiers.MinionSiteNumberModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class ModifySiteNumber implements ModifierSourceProducer {
|
||||
@Override
|
||||
public ModifierSource getModifierSource(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(object, "filter", "condition", "amount");
|
||||
|
||||
final JSONObject[] conditionArray = FieldUtils.getObjectArray(object.get("condition"), "condition");
|
||||
final String filter = FieldUtils.getString(object.get("filter"), "filter", "self");
|
||||
final ValueSource amount = ValueResolver.resolveEvaluator(object.get("amount"), 0, environment);
|
||||
|
||||
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
||||
final Requirement[] requirements = environment.getRequirementFactory().getRequirements(conditionArray, environment);
|
||||
|
||||
return actionContext -> {
|
||||
final Evaluator evaluator = amount.getEvaluator(actionContext);
|
||||
return new MinionSiteNumberModifier(actionContext.getSource(),
|
||||
filterableSource.getFilterable(actionContext),
|
||||
new RequirementCondition(requirements, actionContext), evaluator);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -59,15 +59,6 @@ public class Filters {
|
||||
_keywordFilterMap.put(Keyword.BESIEGER, Filters.and(CardType.MINION, keyword(Keyword.BESIEGER)));
|
||||
}
|
||||
|
||||
public static Filter inPlay() {
|
||||
return new Filter() {
|
||||
@Override
|
||||
public boolean accepts(LotroGame game, PhysicalCard physicalCard) {
|
||||
return physicalCard.getZone().isInPlay();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static boolean canSpot(LotroGame game, Filterable... filters) {
|
||||
return canSpot(game, 1, filters);
|
||||
}
|
||||
@@ -439,6 +430,13 @@ public class Filters {
|
||||
}
|
||||
};
|
||||
|
||||
public static final Filter inPlay = new Filter() {
|
||||
@Override
|
||||
public boolean accepts(LotroGame game, PhysicalCard physicalCard) {
|
||||
return physicalCard.getZone().isInPlay();
|
||||
}
|
||||
};
|
||||
|
||||
public static final Filter canTakeWounds(final PhysicalCard woundSource, final int count) {
|
||||
return new Filter() {
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@ public class StatModifiersRule {
|
||||
|
||||
public void applyRule() {
|
||||
modifiersLogic.addAlwaysOnModifier(
|
||||
new StrengthModifier(null, Filters.and(Filters.inPlay(), Filters.character, Filters.hasAttached(Filters.any)), null,
|
||||
new StrengthModifier(null, Filters.and(Filters.inPlay, Filters.character, Filters.hasAttached(Filters.any)), null,
|
||||
new Evaluator() {
|
||||
@Override
|
||||
public int evaluateExpression(LotroGame game, PhysicalCard cardAffected) {
|
||||
@@ -31,7 +31,7 @@ public class StatModifiersRule {
|
||||
}
|
||||
}, true));
|
||||
modifiersLogic.addAlwaysOnModifier(
|
||||
new VitalityModifier(null, Filters.and(Filters.inPlay(), Filters.character, Filters.hasAttached(Filters.any)),
|
||||
new VitalityModifier(null, Filters.and(Filters.inPlay, Filters.character, Filters.hasAttached(Filters.any)),
|
||||
new Evaluator() {
|
||||
@Override
|
||||
public int evaluateExpression(LotroGame game, PhysicalCard cardAffected) {
|
||||
@@ -43,7 +43,7 @@ public class StatModifiersRule {
|
||||
}
|
||||
}, true));
|
||||
modifiersLogic.addAlwaysOnModifier(
|
||||
new ResistanceModifier(null, Filters.and(Filters.inPlay(), Filters.character, Filters.hasAttached(Filters.any)), null,
|
||||
new ResistanceModifier(null, Filters.and(Filters.inPlay, Filters.character, Filters.hasAttached(Filters.any)), null,
|
||||
new Evaluator() {
|
||||
@Override
|
||||
public int evaluateExpression(LotroGame game, PhysicalCard cardAffected) {
|
||||
@@ -55,7 +55,7 @@ public class StatModifiersRule {
|
||||
}
|
||||
}, true));
|
||||
modifiersLogic.addAlwaysOnModifier(
|
||||
new MinionSiteNumberModifier(null, Filters.and(Filters.inPlay(), CardType.MINION, Filters.hasAttached(Filters.any)), null,
|
||||
new MinionSiteNumberModifier(null, Filters.and(Filters.inPlay, CardType.MINION, Filters.hasAttached(Filters.any)), null,
|
||||
new Evaluator() {
|
||||
@Override
|
||||
public int evaluateExpression(LotroGame game, PhysicalCard cardAffected) {
|
||||
|
||||
@@ -11,7 +11,6 @@ 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.TransferPermanentAction;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractAttachableFPPossession;
|
||||
import com.gempukku.lotro.logic.modifiers.AbstractModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifierEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersLogic;
|
||||
@@ -31,7 +30,7 @@ public class TransferItemRule {
|
||||
public void applyRule() {
|
||||
modifiersLogic.addAlwaysOnModifier(
|
||||
new AbstractModifier(null, "Transfer item",
|
||||
Filters.and(Side.FREE_PEOPLE, Filters.inPlay(), Zone.ATTACHED, Filters.or(CardType.POSSESSION, CardType.ARTIFACT)),
|
||||
Filters.and(Side.FREE_PEOPLE, Filters.inPlay, Zone.ATTACHED, Filters.or(CardType.POSSESSION, CardType.ARTIFACT)),
|
||||
new PhaseCondition(Phase.FELLOWSHIP), ModifierEffect.EXTRA_ACTION_MODIFIER) {
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getExtraPhaseAction(LotroGame game, final PhysicalCard card) {
|
||||
|
||||
Reference in New Issue
Block a user