mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
* Darksteel Colossus - Fixed that the put into graveyard effect did not work correctly for Tokens of Darksteel Colossus.
This commit is contained in:
parent
fa788a1624
commit
4622973639
2 changed files with 32 additions and 12 deletions
|
@ -144,7 +144,7 @@ class JaliraMasterPolymorphistEffect extends OneShotEffect {
|
||||||
card = cards.getRandom(game);
|
card = cards.getRandom(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -37,6 +37,8 @@ import mage.cards.CardsImpl;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.game.permanent.PermanentCard;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,19 +59,37 @@ public class RevealAndShuffleIntoLibrarySourceEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Card sourceCard = game.getCard(source.getSourceId());
|
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
if (sourceCard != null) {
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Player player = game.getPlayer(sourceCard.getOwnerId());
|
if (sourceObject != null && controller != null) {
|
||||||
if (player != null) {
|
Player owner = null;
|
||||||
Zone fromZone = game.getState().getZone(sourceCard.getId());
|
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
cards.add(sourceCard);
|
Permanent permanent = null;
|
||||||
player.revealCards(sourceObject.getLogName(), cards, game);
|
if (sourceObject instanceof Permanent) {
|
||||||
player.moveCardToLibraryWithInfo(sourceCard, source.getSourceId(), game, fromZone, true, true);
|
permanent = (Permanent) sourceObject;
|
||||||
player.shuffleLibrary(game);
|
owner = game.getPlayer(permanent.getOwnerId());
|
||||||
return true;
|
if (sourceObject instanceof PermanentCard) {
|
||||||
|
cards.add(permanent);
|
||||||
}
|
}
|
||||||
|
} else if (sourceObject instanceof Card) {
|
||||||
|
owner = game.getPlayer(((Card)sourceObject).getOwnerId());
|
||||||
|
cards.add((Card)sourceObject);
|
||||||
|
}
|
||||||
|
if (owner != null) {
|
||||||
|
Zone fromZone = game.getState().getZone(sourceObject.getId());
|
||||||
|
if (!cards.isEmpty()) {
|
||||||
|
controller.revealCards(sourceObject.getLogName(), cards, game);
|
||||||
|
}
|
||||||
|
if (permanent != null) {
|
||||||
|
controller.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, fromZone, true, true);
|
||||||
|
} else {
|
||||||
|
controller.moveCardToLibraryWithInfo((Card)sourceObject, source.getSourceId(), game, fromZone, true, true);
|
||||||
|
}
|
||||||
|
if (!cards.isEmpty()) {
|
||||||
|
controller.shuffleLibrary(game);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue