[DOM] Added Rona, Disciple of Gix.

This commit is contained in:
LevelX2 2018-04-18 17:12:27 +02:00
parent 26ce05b42d
commit 1eaa12aca4
3 changed files with 182 additions and 0 deletions

View file

@ -0,0 +1,166 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.common.FilterHistoricCard;
import mage.game.ExileZone;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class RonaDiscipleOfGix extends CardImpl {
public RonaDiscipleOfGix(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ARTIFICER);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// When Rona, Disciple of Gix enters the battlefield, you may exile target historic card from your graveyard.
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect().setToSourceExileZone(true), true);
ability.addTarget(new TargetCardInYourGraveyard(new FilterHistoricCard()));
this.addAbility(ability);
// You may cast nonland cards exiled with Rona.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new RonaDiscipleOfGixPlayNonLandEffect()));
// {4}, {T}: Exile the top card of your library.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RonaDiscipleOfGixExileEffect(), new GenericManaCost(4));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public RonaDiscipleOfGix(final RonaDiscipleOfGix card) {
super(card);
}
@Override
public RonaDiscipleOfGix copy() {
return new RonaDiscipleOfGix(this);
}
}
class RonaDiscipleOfGixPlayNonLandEffect extends AsThoughEffectImpl {
public RonaDiscipleOfGixPlayNonLandEffect() {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "You may cast nonland cards exiled with {this}";
}
public RonaDiscipleOfGixPlayNonLandEffect(final RonaDiscipleOfGixPlayNonLandEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public RonaDiscipleOfGixPlayNonLandEffect copy() {
return new RonaDiscipleOfGixPlayNonLandEffect(this);
}
@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
if (affectedControllerId.equals(source.getControllerId())) {
Card card = game.getCard(objectId);
MageObject sourceObject = source.getSourceObject(game);
if (card != null && !card.isLand() && sourceObject != null) {
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (exileId != null) {
ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
return exileZone != null && exileZone.contains(objectId);
}
}
}
return false;
}
}
class RonaDiscipleOfGixExileEffect extends OneShotEffect {
public RonaDiscipleOfGixExileEffect() {
super(Outcome.Exile);
this.staticText = "Exile the top card of your library";
}
public RonaDiscipleOfGixExileEffect(final RonaDiscipleOfGixExileEffect effect) {
super(effect);
}
@Override
public RonaDiscipleOfGixExileEffect copy() {
return new RonaDiscipleOfGixExileEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
Card card = controller.getLibrary().getFromTop(game);
if (card != null) {
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
controller.moveCardsToExile(card, source, game, true, exileId, sourceObject.getIdName());
}
return true;
}
return false;
}
}

View file

@ -230,6 +230,7 @@ public class Dominaria extends ExpansionSet {
cards.add(new SetCardInfo("Relic Runner", 62, Rarity.COMMON, mage.cards.r.RelicRunner.class)); cards.add(new SetCardInfo("Relic Runner", 62, Rarity.COMMON, mage.cards.r.RelicRunner.class));
cards.add(new SetCardInfo("Rescue", 63, Rarity.COMMON, mage.cards.r.Rescue.class)); cards.add(new SetCardInfo("Rescue", 63, Rarity.COMMON, mage.cards.r.Rescue.class));
cards.add(new SetCardInfo("Rite of Belzenlok", 102, Rarity.RARE, mage.cards.r.RiteOfBelzenlok.class)); cards.add(new SetCardInfo("Rite of Belzenlok", 102, Rarity.RARE, mage.cards.r.RiteOfBelzenlok.class));
cards.add(new SetCardInfo("Rona, Disciple of Gix", 203, Rarity.UNCOMMON, mage.cards.r.RonaDiscipleOfGix.class));
cards.add(new SetCardInfo("Run Amok", 140, Rarity.COMMON, mage.cards.r.RunAmok.class)); cards.add(new SetCardInfo("Run Amok", 140, Rarity.COMMON, mage.cards.r.RunAmok.class));
cards.add(new SetCardInfo("Sage of Lat-Nam", 64, Rarity.UNCOMMON, mage.cards.s.SageOfLatNam.class)); cards.add(new SetCardInfo("Sage of Lat-Nam", 64, Rarity.UNCOMMON, mage.cards.s.SageOfLatNam.class));
cards.add(new SetCardInfo("Sanctum Spirit", 30, Rarity.UNCOMMON, mage.cards.s.SanctumSpirit.class)); cards.add(new SetCardInfo("Sanctum Spirit", 30, Rarity.UNCOMMON, mage.cards.s.SanctumSpirit.class));

View file

@ -30,6 +30,7 @@ package mage.abilities.effects.common;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -56,6 +57,7 @@ public class ExileTargetEffect extends OneShotEffect {
private String exileZone = null; private String exileZone = null;
private UUID exileId = null; private UUID exileId = null;
protected boolean multitargetHandling; protected boolean multitargetHandling;
private boolean toSourceExileZone = false; // exile the targets to a source object specific exile zone (takes care of zone change counter)
public ExileTargetEffect(String effectText) { public ExileTargetEffect(String effectText) {
this(effectText, false); this(effectText, false);
@ -93,6 +95,7 @@ public class ExileTargetEffect extends OneShotEffect {
this.exileId = effect.exileId; this.exileId = effect.exileId;
this.onlyFromZone = effect.onlyFromZone; this.onlyFromZone = effect.onlyFromZone;
this.multitargetHandling = effect.multitargetHandling; this.multitargetHandling = effect.multitargetHandling;
this.toSourceExileZone = effect.toSourceExileZone;
} }
@Override @Override
@ -100,6 +103,11 @@ public class ExileTargetEffect extends OneShotEffect {
return new ExileTargetEffect(this); return new ExileTargetEffect(this);
} }
public ExileTargetEffect setToSourceExileZone(boolean toSourceExileZone) {
this.toSourceExileZone = toSourceExileZone;
return this;
}
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
@ -156,6 +164,13 @@ public class ExileTargetEffect extends OneShotEffect {
} }
} }
} }
if (toSourceExileZone) {
MageObject sourceObject = source.getSourceObject(game);
exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (sourceObject != null) {
exileZone = sourceObject.getIdName();
}
}
controller.moveCardsToExile(toExile, source, game, true, exileId, exileZone); controller.moveCardsToExile(toExile, source, game, true, exileId, exileZone);
return true; return true;
} }