* Some changes to EnterTheBattlefield events, some other fixes (fixes #2765).

This commit is contained in:
LevelX2 2017-01-15 15:22:33 +01:00
parent dd810f2678
commit 75cbfdf3b9
24 changed files with 562 additions and 319 deletions

View file

@ -27,6 +27,7 @@
*/
package mage.abilities.effects.common;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
@ -93,8 +94,10 @@ public class MeldEffect extends OneShotEffect {
Permanent sourcePermanent = game.getPermanent(sourceId);
Permanent meldWithPermanent = game.getPermanent(meldWithId);
if (sourcePermanent != null && meldWithPermanent != null) {
sourcePermanent.moveToExile(null, "", sourceId, game);
meldWithPermanent.moveToExile(null, "", sourceId, game);
Set<Card> toExile = new HashSet<>();
toExile.add(sourcePermanent);
toExile.add(meldWithPermanent);
controller.moveCards(toExile, Zone.EXILED, source, game);
// Create the meld card and move it to the battlefield.
Card sourceCard = game.getExile().getCard(sourceId, game);
Card meldWithCard = game.getExile().getCard(meldWithId, game);
@ -106,7 +109,7 @@ public class MeldEffect extends OneShotEffect {
game.addMeldCard(meldCard.getId(), meldCard);
game.getState().addCard(meldCard);
meldCard.setZone(Zone.EXILED, game);
meldCard.moveToZone(Zone.BATTLEFIELD, sourceId, game, false);
controller.moveCards(meldCard, Zone.BATTLEFIELD, source, game);
}
return true;
}