"Gorgoroth Attacker"
This commit is contained in:
@@ -63,7 +63,7 @@ public class AttachPermanentAction extends AbstractCostToEffectAction {
|
||||
|
||||
_preCostIterator = preCostEffects.iterator();
|
||||
|
||||
_playCardEffect = new PlayCardEffect(card, target);
|
||||
_playCardEffect = new PlayCardEffect(zone, card, target, null);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class PlayEventAction extends AbstractCostToEffectAction {
|
||||
|
||||
_preCostIterator = preCostEffects.iterator();
|
||||
|
||||
_playCardEffect = new PlayEventEffect(card, requiresRanger);
|
||||
_playCardEffect = new PlayEventEffect(card.getZone(), card, requiresRanger);
|
||||
}
|
||||
|
||||
public boolean isRequiresRanger() {
|
||||
|
||||
@@ -41,7 +41,13 @@ public class PlayPermanentAction extends AbstractCostToEffectAction {
|
||||
|
||||
_preCostIterator = preCostEffects.iterator();
|
||||
|
||||
_playCardEffect = new PlayCardEffect(card, zone);
|
||||
PhysicalCard playedFromCard = null;
|
||||
if (card.getZone() == Zone.STACKED)
|
||||
playedFromCard = card.getStackedOn();
|
||||
else if (card.getZone() == Zone.ATTACHED)
|
||||
playedFromCard = card.getAttachedTo();
|
||||
|
||||
_playCardEffect = new PlayCardEffect(card.getZone(), card, zone, playedFromCard);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -94,7 +94,7 @@ public class PlaySiteEffect extends AbstractEffect {
|
||||
}
|
||||
|
||||
sitePlayedCallback(newSite);
|
||||
return new FullEffectResult(Collections.singleton(new PlayCardResult(newSite, null)), true, true);
|
||||
return new FullEffectResult(Collections.singleton(new PlayCardResult(Zone.DECK, newSite, null, null)), true, true);
|
||||
}
|
||||
return new FullEffectResult(null, false, false);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.gempukku.lotro.cards.AbstractEvent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDiscardEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.ForEachThreatEvaluator;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
@@ -37,8 +36,9 @@ public class Card7_074 extends AbstractEvent {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), Filters.gollum));
|
||||
int threats = game.getGameState().getThreats();
|
||||
action.appendEffect(
|
||||
new AddTwilightEffect(self, new ForEachThreatEvaluator()));
|
||||
new AddTwilightEffect(self, threats));
|
||||
return action;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.gempukku.lotro.cards.set7.raider;
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.ForEachThreatEvaluator;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.MultiplyEvaluator;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
@@ -35,8 +33,9 @@ public class Card7_153 extends AbstractEvent {
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
int threats = game.getGameState().getThreats();
|
||||
action.appendEffect(
|
||||
new AddTwilightEffect(self, new MultiplyEvaluator(2, new ForEachThreatEvaluator())));
|
||||
new AddTwilightEffect(self, 2 * threats));
|
||||
return action;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.gempukku.lotro.cards.set7.sauron;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
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 com.gempukku.lotro.logic.timing.results.PlayCardResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: The Return of the King
|
||||
* Side: Shadow
|
||||
* Culture: Sauron
|
||||
* Twilight Cost: 3
|
||||
* Type: Minion • Orc
|
||||
* Strength: 9
|
||||
* Vitality: 2
|
||||
* Site: 5
|
||||
* Game Text: Besieger. When you play this minion from a site you control, add a burden for each site you control.
|
||||
*/
|
||||
public class Card7_270 extends AbstractMinion {
|
||||
public Card7_270() {
|
||||
super(3, 9, 2, 5, Race.ORC, Culture.SAURON, "Gorgoroth Attacker");
|
||||
addKeyword(Keyword.BESIEGER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (PlayConditions.played(game, effectResult, self)) {
|
||||
PlayCardResult playResult = (PlayCardResult) effectResult;
|
||||
if (playResult.getPlayedFrom() == Zone.STACKED && Filters.siteControlled(self.getOwner()).accepts(game.getGameState(), game.getModifiersQuerying(), playResult.getAttachedOrStackedPlayedFrom())) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
int controlledSites = Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.siteControlled(self.getOwner()));
|
||||
action.appendEffect(
|
||||
new AddBurdenEffect(self, controlledSites));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,6 @@ package com.gempukku.lotro.logic.effects;
|
||||
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.ConstantEvaluator;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
|
||||
import com.gempukku.lotro.logic.timing.AbstractEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.Preventable;
|
||||
@@ -13,17 +11,12 @@ import java.util.Collections;
|
||||
|
||||
public class AddTwilightEffect extends AbstractEffect implements Preventable {
|
||||
private PhysicalCard _source;
|
||||
private Evaluator _twilight;
|
||||
private int _resultTwilight;
|
||||
private int _twilight;
|
||||
private int _prevented;
|
||||
|
||||
public AddTwilightEffect(PhysicalCard source, Evaluator twilightEvaluator) {
|
||||
_source = source;
|
||||
_twilight = twilightEvaluator;
|
||||
}
|
||||
|
||||
public AddTwilightEffect(PhysicalCard source, int twilight) {
|
||||
this(source, new ConstantEvaluator(twilight));
|
||||
_source = source;
|
||||
_twilight = twilight;
|
||||
}
|
||||
|
||||
public PhysicalCard getSource() {
|
||||
@@ -32,7 +25,7 @@ public class AddTwilightEffect extends AbstractEffect implements Preventable {
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return "Add (" + _twilight.evaluateExpression(game.getGameState(), game.getModifiersQuerying(), null) + ")";
|
||||
return "Add (" + _twilight + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -42,12 +35,12 @@ public class AddTwilightEffect extends AbstractEffect implements Preventable {
|
||||
|
||||
@Override
|
||||
public boolean isPrevented() {
|
||||
return _prevented == _resultTwilight;
|
||||
return _prevented == _twilight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prevent() {
|
||||
_prevented = _resultTwilight;
|
||||
_prevented = _twilight;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,10 +50,9 @@ public class AddTwilightEffect extends AbstractEffect implements Preventable {
|
||||
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
_resultTwilight = _twilight.evaluateExpression(game.getGameState(), game.getModifiersQuerying(), null);
|
||||
if (!isPrevented()) {
|
||||
game.getGameState().sendMessage(_resultTwilight + " gets added to the twilight pool");
|
||||
game.getGameState().addTwilight(_resultTwilight);
|
||||
game.getGameState().sendMessage(_twilight + " gets added to the twilight pool");
|
||||
game.getGameState().addTwilight(_twilight);
|
||||
return new FullEffectResult(Collections.singleton(new AddTwilightResult(_source)), true, _prevented == 0);
|
||||
}
|
||||
return new FullEffectResult(null, true, false);
|
||||
|
||||
@@ -10,18 +10,24 @@ import com.gempukku.lotro.logic.timing.results.PlayCardResult;
|
||||
import java.util.Collections;
|
||||
|
||||
public class PlayCardEffect extends AbstractEffect {
|
||||
private Zone _playedFrom;
|
||||
private PhysicalCard _cardPlayed;
|
||||
private PhysicalCard _attachedToCard;
|
||||
private Zone _zone;
|
||||
private PhysicalCard _attachedOrStackedPlayedFrom;
|
||||
|
||||
public PlayCardEffect(PhysicalCard cardPlayed, Zone zone) {
|
||||
public PlayCardEffect(Zone playedFrom, PhysicalCard cardPlayed, Zone playedTo, PhysicalCard attachedOrStackedPlayedFrom) {
|
||||
_playedFrom = playedFrom;
|
||||
_cardPlayed = cardPlayed;
|
||||
_zone = zone;
|
||||
_zone = playedTo;
|
||||
_attachedOrStackedPlayedFrom = attachedOrStackedPlayedFrom;
|
||||
}
|
||||
|
||||
public PlayCardEffect(PhysicalCard cardPlayed, PhysicalCard attachedToCard) {
|
||||
public PlayCardEffect(Zone playedFrom, PhysicalCard cardPlayed, PhysicalCard attachedToCard, PhysicalCard attachedOrStackedPlayedFrom) {
|
||||
_playedFrom = playedFrom;
|
||||
_cardPlayed = cardPlayed;
|
||||
_attachedToCard = attachedToCard;
|
||||
_attachedOrStackedPlayedFrom = attachedOrStackedPlayedFrom;
|
||||
_zone = Zone.ATTACHED;
|
||||
}
|
||||
|
||||
@@ -58,6 +64,6 @@ public class PlayCardEffect extends AbstractEffect {
|
||||
game.getGameState().addCardToZone(game, _cardPlayed, _zone);
|
||||
}
|
||||
|
||||
return new FullEffectResult(Collections.singleton(new PlayCardResult(_cardPlayed, _attachedToCard)), true, true);
|
||||
return new FullEffectResult(Collections.singleton(new PlayCardResult(_playedFrom, _cardPlayed, _attachedToCard, _attachedOrStackedPlayedFrom)), true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ public class PlayEventEffect extends PlayCardEffect {
|
||||
private boolean _requiresRanger;
|
||||
private PlayEventResult _playEventResult;
|
||||
|
||||
public PlayEventEffect(PhysicalCard cardPlayed, boolean requiresRanger) {
|
||||
super(cardPlayed, (Zone) null);
|
||||
public PlayEventEffect(Zone playedFrom, PhysicalCard cardPlayed, boolean requiresRanger) {
|
||||
super(playedFrom, cardPlayed, (Zone) null, null);
|
||||
_cardPlayed = cardPlayed;
|
||||
_requiresRanger = requiresRanger;
|
||||
_playEventResult = new PlayEventResult(getPlayedCard(), _requiresRanger);
|
||||
_playEventResult = new PlayEventResult(playedFrom, getPlayedCard(), _requiresRanger);
|
||||
}
|
||||
|
||||
public PlayEventResult getPlayEventResult() {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class PlayerPlaysNextSiteIfNotThereGameProcess implements GameProcess {
|
||||
@Override
|
||||
public void process() {
|
||||
_game.getActionsEnvironment().addActionToStack(
|
||||
new SimpleEffectAction(new PlayCardEffect(site, Zone.ADVENTURE_PATH), "Plays next site"));
|
||||
new SimpleEffectAction(new PlayCardEffect(Zone.DECK, site, Zone.ADVENTURE_PATH, null), "Plays next site"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
package com.gempukku.lotro.logic.timing.results;
|
||||
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
public class PlayCardResult extends EffectResult {
|
||||
private Zone _playedFrom;
|
||||
private PhysicalCard _playedCard;
|
||||
private PhysicalCard _attachedTo;
|
||||
private PhysicalCard _attachedOrStackedPlayedFrom;
|
||||
|
||||
public PlayCardResult(PhysicalCard playedCard, PhysicalCard attachedTo) {
|
||||
public PlayCardResult(Zone playedFrom, PhysicalCard playedCard, PhysicalCard attachedTo, PhysicalCard attachedOrStackedPlayedFrom) {
|
||||
super(EffectResult.Type.PLAY);
|
||||
_playedFrom = playedFrom;
|
||||
_playedCard = playedCard;
|
||||
_attachedTo = attachedTo;
|
||||
_attachedOrStackedPlayedFrom = attachedOrStackedPlayedFrom;
|
||||
}
|
||||
|
||||
public PhysicalCard getPlayedCard() {
|
||||
@@ -20,4 +25,12 @@ public class PlayCardResult extends EffectResult {
|
||||
public PhysicalCard getAttachedTo() {
|
||||
return _attachedTo;
|
||||
}
|
||||
|
||||
public PhysicalCard getAttachedOrStackedPlayedFrom() {
|
||||
return _attachedOrStackedPlayedFrom;
|
||||
}
|
||||
|
||||
public Zone getPlayedFrom() {
|
||||
return _playedFrom;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public class PlayEventResult extends PlayCardResult {
|
||||
private boolean _requiresRanger;
|
||||
private Zone _targetZone = Zone.DISCARD;
|
||||
|
||||
public PlayEventResult(PhysicalCard playedCard, boolean requiresRanger) {
|
||||
super(playedCard, null);
|
||||
public PlayEventResult(Zone playedFrom, PhysicalCard playedCard, boolean requiresRanger) {
|
||||
super(playedFrom, playedCard, null, null);
|
||||
_requiresRanger = requiresRanger;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user