- "Gnawing, Biting, Hacking, Burning" and similar cards should now allow to stack multiple minions if they are discarded

at the same time.
This commit is contained in:
marcins78
2013-01-04 12:58:40 +00:00
parent 643b43d8bb
commit e416b43744
17 changed files with 62 additions and 68 deletions

View File

@@ -81,7 +81,7 @@ public class LiberateASiteEffect extends AbstractEffect {
game.getGameState().loseControlOfCard(siteToLiberate, Zone.ADVENTURE_PATH);
for (PhysicalCard discardedCard : discardedCards)
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(discardedCard));
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(null, discardedCard));
liberatedSiteCallback(siteToLiberate);

View File

@@ -42,8 +42,7 @@ public class PutCardFromPlayOnBottomOfDeckEffect extends AbstractEffect {
gameState.putCardOnBottomOfDeck(_physicalCard);
for (PhysicalCard discardedCard : discardedCards) {
game.getActionsEnvironment().emitEffectResult(
new DiscardCardsFromPlayResult(discardedCard));
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(null, discardedCard));
}
for (PhysicalCard toGoToDiscardCard : toGoToDiscardCards)
gameState.addCardToZone(game, toGoToDiscardCard, Zone.DISCARD);

View File

@@ -42,8 +42,7 @@ public class PutCardFromPlayOnTopOfDeckEffect extends AbstractEffect {
gameState.putCardOnTopOfDeck(_physicalCard);
for (PhysicalCard discardedCard : discardedCards) {
game.getActionsEnvironment().emitEffectResult(
new DiscardCardsFromPlayResult(discardedCard));
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(null, discardedCard));
}
for (PhysicalCard toGoToDiscardCard : toGoToDiscardCards)
gameState.addCardToZone(game, toGoToDiscardCard, Zone.DISCARD);

View File

@@ -79,7 +79,7 @@ public class ReturnCardsToHandEffect extends AbstractEffect {
gameState.sendMessage(GameUtils.getCardLink(_source) + " returns " + getAppendedNames(cardsToReturnToHand) + " to hand");
for (PhysicalCard discardedCard : discardedFromPlay)
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(discardedCard));
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(null, discardedCard));
for (PhysicalCard cardReturned : cardsToReturnToHand)
game.getActionsEnvironment().emitEffectResult(new ReturnCardsToHandResult(cardReturned));

View File

@@ -69,7 +69,7 @@ public class ShuffleCardsFromPlayIntoDeckEffect extends AbstractEffect {
game.getGameState().addCardToZone(game, physicalCard, Zone.DISCARD);
for (PhysicalCard physicalCard : discardedFromPlay)
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(physicalCard));
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(null, physicalCard));
game.getGameState().sendMessage(getAppendedNames(toShuffleIn) + " " + GameUtils.be(toShuffleIn) + " shuffled into " + _playerDeck + " deck");

View File

@@ -62,7 +62,7 @@ public class StackCardFromPlayEffect extends AbstractEffect {
// Send the result (attached cards get discarded)
for (PhysicalCard discardedCard : discardedFromPlayCards)
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(discardedCard));
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(null, discardedCard));
return new FullEffectResult(true);
}

View File

@@ -12,6 +12,7 @@ import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.DiscardCardsFromPlayResult;
import java.util.Collections;
import java.util.List;
@@ -36,6 +37,7 @@ public class Card12_071 extends AbstractPermanent {
&& !PlayConditions.isPhase(game, Phase.REGROUP)
&& PlayConditions.canPlayFromHand(playerId, game, -2, Culture.MEN, CardType.MINION)) {
final OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setTriggerIdentifier(self.getCardId()+"-"+((DiscardCardsFromPlayResult) effectResult).getDiscardedCard().getCardId());
action.appendEffect(
new ChooseAndPlayCardFromHandEffect(playerId, game, -2, Culture.MEN, CardType.MINION) {
@Override

View File

@@ -14,6 +14,7 @@ import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.DiscardCardsFromPlayResult;
import java.util.Collections;
import java.util.List;
@@ -45,6 +46,7 @@ public class Card17_036 extends AbstractPermanent {
if (PlayConditions.isPhase(game, Phase.SKIRMISH)
&& TriggerConditions.forEachDiscardedFromPlay(game, effectResult, CardType.MINION)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setTriggerIdentifier(self.getCardId()+"-"+((DiscardCardsFromPlayResult) effectResult).getDiscardedCard());
action.appendEffect(
new ReinforceTokenEffect(self, playerId, Token.GONDOR));
return Collections.singletonList(action);

View File

@@ -43,6 +43,7 @@ public class Card17_041 extends AbstractPermanent {
&& PlayConditions.isPhase(game, Phase.MANEUVER)) {
DiscardCardsFromPlayResult discardResult = (DiscardCardsFromPlayResult) effectResult;
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setTriggerIdentifier(self.getCardId()+"-"+discardResult.getDiscardedCard());
action.setText("Stack " + GameUtils.getCardLink(discardResult.getDiscardedCard()));
action.appendEffect(
new StackCardFromDiscardEffect(discardResult.getDiscardedCard(), self));

View File

@@ -39,6 +39,7 @@ public class Card17_066 extends AbstractPermanent {
&& PlayConditions.isPhase(game, Phase.MANEUVER)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
PhysicalCard discardedCard = ((DiscardCardsFromPlayResult) effectResult).getDiscardedCard();
action.setTriggerIdentifier(self.getCardId() + "-" + discardedCard.getCardId());
action.setText("Stack " + GameUtils.getCardLink(discardedCard));
action.appendEffect(
new StackCardFromDiscardEffect(discardedCard, self));

View File

@@ -14,13 +14,11 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.DiscardCardsFromPlayResult;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
@@ -38,22 +36,18 @@ public class Card6_063 extends AbstractPermanent {
}
@Override
public List<OptionalTriggerAction> getOptionalBeforeTriggers(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (TriggerConditions.isGettingDiscarded(effect, game, Culture.ISENGARD, Race.ORC)) {
DiscardCardsFromPlayEffect discardEffect = (DiscardCardsFromPlayEffect) effect;
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.forEachDiscardedFromPlay(game, effectResult, Culture.ISENGARD, Race.ORC)) {
DiscardCardsFromPlayResult discardResult = (DiscardCardsFromPlayResult) effectResult;
if (game.getGameState().getCurrentPhase() == Phase.REGROUP
&& discardEffect.getSource() != null) {
List<OptionalTriggerAction> actions = new LinkedList<OptionalTriggerAction>();
final Collection<PhysicalCard> discardedOrcs = Filters.filter(discardEffect.getAffectedCardsMinusPrevented(game), game.getGameState(), game.getModifiersQuerying(), Culture.ISENGARD, Race.ORC);
for (final PhysicalCard discardedOrc : discardedOrcs) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setText("Stack " + GameUtils.getCardLink(discardedOrc));
action.appendEffect(
new StackCardFromPlayEffect(discardedOrc, self));
actions.add(action);
}
return actions;
&& discardResult.getSource() != null) {
PhysicalCard discardedOrc = discardResult.getDiscardedCard();
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setTriggerIdentifier(self.getCardId()+"-"+discardedOrc.getCardId());
action.setText("Stack " + GameUtils.getCardLink(discardedOrc));
action.appendEffect(
new StackCardFromPlayEffect(discardedOrc, self));
return Collections.singletonList(action);
}
}
return null;

View File

@@ -14,13 +14,11 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.DiscardCardsFromPlayResult;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
@@ -38,22 +36,18 @@ public class Card6_064 extends AbstractPermanent {
}
@Override
public List<OptionalTriggerAction> getOptionalBeforeTriggers(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (TriggerConditions.isGettingDiscarded(effect, game, Culture.ISENGARD, Race.ORC)) {
DiscardCardsFromPlayEffect discardEffect = (DiscardCardsFromPlayEffect) effect;
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.forEachDiscardedFromPlay(game, effectResult, Culture.ISENGARD, Race.ORC)) {
DiscardCardsFromPlayResult discardResult = (DiscardCardsFromPlayResult) effectResult;
if (game.getGameState().getCurrentPhase() == Phase.REGROUP
&& discardEffect.getSource() != null) {
List<OptionalTriggerAction> actions = new LinkedList<OptionalTriggerAction>();
final Collection<PhysicalCard> discardedOrcs = Filters.filter(discardEffect.getAffectedCardsMinusPrevented(game), game.getGameState(), game.getModifiersQuerying(), Culture.ISENGARD, Race.ORC);
for (final PhysicalCard discardedOrc : discardedOrcs) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setText("Stack " + GameUtils.getCardLink(discardedOrc));
action.appendEffect(
new StackCardFromPlayEffect(discardedOrc, self));
actions.add(action);
}
return actions;
&& discardResult.getSource() != null) {
PhysicalCard discardedOrc = discardResult.getDiscardedCard();
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setTriggerIdentifier(self.getCardId()+"-"+discardedOrc.getCardId());
action.setText("Stack " + GameUtils.getCardLink(discardedOrc));
action.appendEffect(
new StackCardFromPlayEffect(discardedOrc, self));
return Collections.singletonList(action);
}
}
return null;

View File

@@ -13,13 +13,12 @@ import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.DiscardCardsFromPlayResult;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
@@ -38,28 +37,23 @@ public class Card6_073 extends AbstractPermanent {
}
@Override
public List<OptionalTriggerAction> getOptionalBeforeTriggers(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (TriggerConditions.isGettingDiscarded(effect, game, Culture.ISENGARD, Race.ORC)) {
DiscardCardsFromPlayEffect discardEffect = (DiscardCardsFromPlayEffect) effect;
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.forEachDiscardedFromPlay(game, effectResult, Culture.ISENGARD, Race.ORC)) {
DiscardCardsFromPlayResult discardResult = (DiscardCardsFromPlayResult) effectResult;
if (game.getGameState().getCurrentPhase() == Phase.REGROUP
&& discardEffect.getSource() != null) {
List<OptionalTriggerAction> actions = new LinkedList<OptionalTriggerAction>();
final Collection<PhysicalCard> discardedOrcs = Filters.filter(discardEffect.getAffectedCardsMinusPrevented(game), game.getGameState(), game.getModifiersQuerying(), Culture.ISENGARD, Race.ORC);
for (final PhysicalCard discardedOrc : discardedOrcs) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setText("Stack " + GameUtils.getCardLink(discardedOrc));
action.appendEffect(
new StackCardFromPlayEffect(discardedOrc, self));
actions.add(action);
}
return actions;
&& discardResult.getSource() != null) {
PhysicalCard discardedOrc = discardResult.getDiscardedCard();
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.setTriggerIdentifier(self.getCardId()+"-"+discardedOrc.getCardId());
action.setText("Stack " + GameUtils.getCardLink(discardedOrc));
action.appendEffect(
new StackCardFromPlayEffect(discardedOrc, self));
return Collections.singletonList(action);
}
}
return null;
}
@Override
public List<? extends ActivateCardAction> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (TriggerConditions.isGettingWounded(effect, game, Culture.ISENGARD, Race.ORC)

View File

@@ -91,6 +91,6 @@ public class DiscardCardsFromPlayEffect extends AbstractPreventableCardEffect {
game.getGameState().sendMessage(_source.getOwner() + " discards " + getAppendedNames(discardedCards) + " from play using " + GameUtils.getCardLink(_source));
for (PhysicalCard discardedCard : discardedCards)
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(discardedCard));
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(_source, discardedCard));
}
}

View File

@@ -103,7 +103,7 @@ public class KillEffect extends AbstractSuccessfulEffect {
for (PhysicalCard killedCard : killedCards)
game.getActionsEnvironment().emitEffectResult(new ForEachKilledResult(killedCard, _cause));
for (PhysicalCard discardedCard : discardedCards)
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(discardedCard));
game.getActionsEnvironment().emitEffectResult(new DiscardCardsFromPlayResult(null, discardedCard));
}
}

View File

@@ -4,14 +4,20 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.logic.timing.EffectResult;
public class DiscardCardsFromPlayResult extends EffectResult {
private PhysicalCard _source;
private PhysicalCard _card;
public DiscardCardsFromPlayResult(PhysicalCard card) {
public DiscardCardsFromPlayResult(PhysicalCard source, PhysicalCard card) {
super(EffectResult.Type.FOR_EACH_DISCARDED_FROM_PLAY);
_source = source;
_card = card;
}
public PhysicalCard getDiscardedCard() {
return _card;
}
public PhysicalCard getSource() {
return _source;
}
}

View File

@@ -7,6 +7,8 @@ response.setDateHeader ("Expires", -1);
<pre style="font-size:80%">
<b>04 Jan. 2013</b>
- If FP player uses Muster, shadow player is now also able to use it.
- "Gnawing, Biting, Hacking, Burning" and similar cards should now allow to stack multiple minions if they are discarded
at the same time.
<b>03 Jan. 2013</b>
- "Legolas, Elven Comrade" now should automatically allow to choose a minion skirmishing an unbound companion.