* Sidis Brood Tyrant - Fixed triggered ability not working as intended.

This commit is contained in:
LevelX2 2014-09-25 00:32:43 +02:00
parent 86965dfde6
commit e6d2bce95d
2 changed files with 10 additions and 8 deletions

View file

@ -135,8 +135,11 @@ class SidisiBroodTyrantTriggeredAbility extends ZoneChangeTriggeredAbility {
Card card = game.getCard(event.getTargetId());
if (card != null && card.getOwnerId().equals(getControllerId()) && card.getCardType().contains(CardType.CREATURE)) {
StackObject stackObject = game.getStack().getStackObject(event.getSourceId());
if (stackObject == null) {
stackObject = (StackObject) game.getLastKnownInformation(event.getSourceId(), Zone.STACK);
}
if (stackObject != null) {
if (lastStackObjectId.equals(stackObject.getId())) {
if (stackObject.getId().equals(lastStackObjectId)) {
return false; // was already handled
}
lastStackObjectId = stackObject.getId();

View file

@ -127,14 +127,13 @@ public class LookLibraryControllerEffect extends OneShotEffect {
// take cards from library and look at them
boolean topCardRevealed = player.isTopCardRevealed();
player.setTopCardRevealed(false);
Cards cards = new CardsImpl(Zone.PICK);
Cards cards = new CardsImpl();
int count = Math.min(player.getLibrary().size(), this.numberOfCards.calculate(game, source, this));
for (int i = 0; i < count; i++) {
Card card = player.getLibrary().removeFromTop(game);
if (card != null) {
cards.add(card);
this.cardLooked(card, game, source);
game.setZone(card.getId(), Zone.PICK);
}
}
player.lookAtCards(windowName, cards, game);
@ -167,25 +166,25 @@ public class LookLibraryControllerEffect extends OneShotEffect {
protected void putCardsBack(Ability source, Player player, Cards cards, Game game) {
switch(targetZoneLookedCards) {
case LIBRARY:
TargetCard target = new TargetCard(Zone.PICK, new FilterCard(this.getPutBackText()));
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard(this.getPutBackText()));
while (player.isInGame() && cards.size() > 1) {
player.choose(Outcome.Neutral, cards, target, game);
Card card = cards.get(target.getFirstTarget(), game);
if (card != null) {
cards.remove(card);
card.moveToZone(targetZoneLookedCards, source.getSourceId(), game, putOnTop);
game.informPlayers(player.getName() + " moves a card to " + targetZoneLookedCards.toString());
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, putOnTop, false);
}
target.clearChosen();
}
if (cards.size() == 1) {
Card card = cards.get(cards.iterator().next(), game);
card.moveToZone(targetZoneLookedCards, source.getSourceId(), game, putOnTop);
game.informPlayers(player.getName() + " moves a card to " + targetZoneLookedCards.toString());
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, putOnTop, false);
}
break;
case GRAVEYARD:
for (Card card : cards.getCards(game)) {
player.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
}
break;