* Gonti, Lord of Luxury - Fixed the not working "look at the face down card" ability.

This commit is contained in:
LevelX2 2016-10-10 16:42:51 +02:00
parent cbffe624aa
commit bc47bb0e7d
2 changed files with 10 additions and 5 deletions

View file

@ -34,6 +34,7 @@ import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.AsThoughManaEffect;
import mage.abilities.effects.ContinuousEffect;
@ -69,7 +70,7 @@ public class GontiLordOfLuxury extends CardImpl {
protected static final String VALUE_PREFIX = "ExileZones";
public GontiLordOfLuxury(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
this.supertype.add("Legendary");
this.subtype.add("Aetherborn");
this.subtype.add("Rogue");
@ -79,11 +80,13 @@ public class GontiLordOfLuxury extends CardImpl {
// Deathtouch
this.addAbility(DeathtouchAbility.getInstance());
// When Gonti, Lord of Luxury enters the battlefield, look at the top four cards of target opponent's library, exile one of them face down, then put the rest on the bottom of that library in a random order. For as long as that card remains exiled, you may look at it, you may cast it, and you may spend mana as though it were mana of any type to cast it.
// When Gonti, Lord of Luxury enters the battlefield, look at the top four cards of target opponent's library, exile one of them face down,
// then put the rest on the bottom of that library in a random order. For as long as that card remains exiled,
// you may look at it, you may cast it, and you may spend mana as though it were mana of any type to cast it.
Ability ability = new EntersBattlefieldTriggeredAbility(new GontiLordOfLuxuryEffect());
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
this.addAbility(new SimpleStaticAbility(Zone.ALL, new GontiLordOfLuxuryLookEffect()));
}
public GontiLordOfLuxury(final GontiLordOfLuxury card) {
@ -130,6 +133,7 @@ class GontiLordOfLuxuryEffect extends OneShotEffect {
card.setFaceDown(true, game);
controller.moveCardsToExile(card, source, game, false, exileZoneId, sourceObject.getIdName());
card.setFaceDown(true, game);
@SuppressWarnings("unchecked")
Set<UUID> exileZones = (Set<UUID>) game.getState().getValue(GontiLordOfLuxury.VALUE_PREFIX + source.getSourceId().toString());
if (exileZones == null) {
exileZones = new HashSet<>();
@ -145,6 +149,7 @@ class GontiLordOfLuxuryEffect extends OneShotEffect {
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);
}
while (!topCards.isEmpty() && controller.isInGame()) {
Card libCard = topCards.getRandom(game);
topCards.remove(libCard);

View file

@ -62,7 +62,7 @@ public class IntetTheDreamer extends CardImpl {
protected static final String VALUE_PREFIX = "ExileZones";
public IntetTheDreamer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{R}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{R}{G}");
this.supertype.add("Legendary");
this.subtype.add("Dragon");
this.power = new MageInt(6);
@ -162,7 +162,7 @@ class IntetTheDreamerCastEffect extends AsThoughEffectImpl {
if (zone != null && zone.contains(card.getId())/* && CardUtil.cardCanBePlayedNow(card, controller.getId(), game)*/) {
if (card.getCardType().contains(CardType.LAND)) {
if (game.canPlaySorcery(controller.getId()) && game.getPlayer(controller.getId()).canPlayLand()) {
return controller.chooseUse(outcome, "Play " + card.getName() + "?", source, game);
return controller.chooseUse(outcome, "Play " + card.getIdName() + "?", source, game);
}
} else {
controller.setCastSourceIdWithAlternateMana(objectId, null, null);