Gonti & Thief of Sanity - Do not allow to play land half of MDFCs

This commit is contained in:
Daniel Bomar 2021-01-27 07:52:56 -06:00
parent eae954d0c5
commit bb1a63ea48
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 16 additions and 13 deletions

View file

@ -147,21 +147,22 @@ class GontiLordOfLuxuryCastFromExileEffect extends AsThoughEffectImpl {
@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
UUID targetId = getTargetPointer().getFirst(game, source);
if (targetId == null) {
this.discard(); // card is no longer in the origin zone, effect can be discarded
return false;
}
Card theCard = game.getCard(objectId);
if (theCard == null) {
if (theCard == null || theCard.isLand()) {
return false;
}
objectId = theCard.getMainCard().getId(); // for split cards
UUID targetId = getTargetPointer().getFirst(game, source);
if (targetId == null) {
this.discard();
} else if (objectId.equals(targetId)
if (objectId.equals(targetId)
&& affectedControllerId.equals(source.getControllerId())) {
Card card = game.getCard(objectId);
// TODO: Allow to cast Zoetic Cavern face down
return card != null
&& !card.isLand();
return card != null;
}
return false;
}

View file

@ -147,20 +147,22 @@ class ThiefOfSanityCastFromExileEffect extends AsThoughEffectImpl {
@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
UUID cardId = getTargetPointer().getFirst(game, source);
if (cardId == null) {
this.discard(); // card is no longer in the origin zone, effect can be discarded
return false;
}
Card theCard = game.getCard(objectId);
if (theCard == null) {
if (theCard == null || theCard.isLand()) {
return false;
}
objectId = theCard.getMainCard().getId();// for split cards
UUID cardId = getTargetPointer().getFirst(game, source);
if (cardId == null) {
this.discard(); // card is no longer in the origin zone, effect can be discarded
} else if (objectId.equals(cardId)
if (objectId.equals(cardId)
&& affectedControllerId.equals(authorizedPlayerId)) {
Card card = game.getCard(objectId);
// TODO: Allow to cast Zoetic Cavern face down
return card != null && !card.isLand();
return card != null;
}
return false;
}