mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
Allow 'Gonti, Lord of Luxury', 'Nightveil Specter' and 'Thief of Sanity' to cast adventures from exile
This commit is contained in:
parent
e3db50f111
commit
e747b12659
3 changed files with 19 additions and 1 deletions
|
@ -147,6 +147,12 @@ class GontiLordOfLuxuryCastFromExileEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
|
Card theCard = game.getCard(objectId);
|
||||||
|
if (theCard == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
objectId = theCard.getMainCard().getId(); // for split cards
|
||||||
|
|
||||||
UUID targetId = getTargetPointer().getFirst(game, source);
|
UUID targetId = getTargetPointer().getFirst(game, source);
|
||||||
if (targetId == null) {
|
if (targetId == null) {
|
||||||
this.discard();
|
this.discard();
|
||||||
|
@ -194,7 +200,7 @@ class GontiLordOfLuxurySpendAnyManaEffect extends AsThoughEffectImpl implements
|
||||||
// if the card moved from exile to spell the zone change counter is increased by 1 (effect must applies before and on stack, use isCheckPlayableMode?)
|
// if the card moved from exile to spell the zone change counter is increased by 1 (effect must applies before and on stack, use isCheckPlayableMode?)
|
||||||
return source.isControlledBy(affectedControllerId);
|
return source.isControlledBy(affectedControllerId);
|
||||||
} else if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) {
|
} else if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) {
|
||||||
// object has moved zone so effect can be discarted
|
// object has moved zone so effect can be discarded
|
||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -119,6 +119,12 @@ class NightveilSpecterEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
|
Card theCard = game.getCard(objectId);
|
||||||
|
if (theCard == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
objectId = theCard.getMainCard().getId();// for split cards
|
||||||
|
|
||||||
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) {
|
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) {
|
||||||
ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
|
ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
|
||||||
return zone != null && zone.contains(objectId);
|
return zone != null && zone.contains(objectId);
|
||||||
|
|
|
@ -147,6 +147,12 @@ class ThiefOfSanityCastFromExileEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
|
Card theCard = game.getCard(objectId);
|
||||||
|
if (theCard == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
objectId = theCard.getMainCard().getId();// for split cards
|
||||||
|
|
||||||
UUID cardId = getTargetPointer().getFirst(game, source);
|
UUID cardId = getTargetPointer().getFirst(game, source);
|
||||||
if (cardId == null) {
|
if (cardId == null) {
|
||||||
this.discard(); // card is no longer in the origin zone, effect can be discarded
|
this.discard(); // card is no longer in the origin zone, effect can be discarded
|
||||||
|
|
Loading…
Reference in a new issue