Fixed Duplicant getting boost from Commander in command zone (#3299)

This commit is contained in:
Evan Kranzler 2017-08-27 09:14:47 -04:00
parent 962ec40d4c
commit 4bf436b0f4
3 changed files with 14 additions and 2 deletions

View file

@ -104,8 +104,8 @@ class DuplicantExileTargetEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
MageObject sourceObject = source.getSourceObject(game);
if (permanent != null && sourceObject instanceof Permanent) {
if (permanent.moveToExile(null, null, source.getSourceId(), game)) {
((Permanent) sourceObject).imprint(permanent.getId(), game);
if (permanent.moveToExile(null, null, source.getSourceId(), game)
&& ((Permanent) sourceObject).imprint(permanent.getId(), game)) {
((Permanent) sourceObject).addInfo("imprint", "[Imprinted card - " + permanent.getName() + ']', game);
}
return true;

View file

@ -118,6 +118,15 @@ public class Exile implements Serializable, Copyable<Exile> {
return new Exile(this);
}
public boolean containsId(UUID cardId, Game game) {
for (Card card : getAllCards(game)) {
if (card.getId().equals(cardId)) {
return true;
}
}
return false;
}
public void clear() {
for (ExileZone exile : exileZones.values()) {
exile.clear();

View file

@ -1210,6 +1210,9 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
@Override
public boolean imprint(UUID imprintedCard, Game game) {
if (!game.getExile().containsId(imprintedCard, game)){
return false;
}
if (connectedCards.containsKey("imprint")) {
this.connectedCards.get("imprint").add(imprintedCard);
} else {