Added Dualcaster Mage, Legacy's Allure and Diabolic Servitude.

This commit is contained in:
LevelX2 2014-11-11 01:33:20 +01:00
parent f69ecddf87
commit b61a5908df
5 changed files with 392 additions and 2 deletions

View file

@ -0,0 +1,86 @@
/*
* 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.sets.commander2014;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetSpell;
/**
*
* @author LevelX2
*/
public class DualcasterMage extends CardImpl {
private static final FilterSpell filter = new FilterSpell("instant or sorcery spell");
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)));
}
public DualcasterMage(UUID ownerId) {
super(ownerId, 34, "Dualcaster Mage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
this.expansionSetCode = "C14";
this.subtype.add("Human");
this.subtype.add("Wizard");
this.color.setRed(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flash
this.addAbility(FlashAbility.getInstance());
// When Dualcaster Mage enters the battlefield, copy target instant or sorcery spell. You may choose new targets for the copy.
Ability ability = new EntersBattlefieldTriggeredAbility(new CopyTargetSpellEffect(), false);
ability.addTarget(new TargetSpell(filter));
this.addAbility(ability);
}
public DualcasterMage(final DualcasterMage card) {
super(card);
}
@Override
public DualcasterMage copy() {
return new DualcasterMage(this);
}
}

View file

@ -0,0 +1,94 @@
/*
* 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.sets.tempest;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.continious.GainControlTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.Counter;
import mage.filter.Filter;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class LegacysAllure extends CardImpl {
public LegacysAllure(UUID ownerId) {
super(ownerId, 71, "Legacy's Allure", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}");
this.expansionSetCode = "TMP";
this.color.setBlue(true);
// At the beginning of your upkeep, you may put a treasure counter on Legacy's Allure.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(new Counter("treasure")), TargetController.YOU, true));
// Sacrifice Legacy's Allure: Gain control of target creature with power less than or equal to the number of treasure counters on Legacy's Allure.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame, true),new SacrificeSourceCost());
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with power less than or equal to the number of treasure counters on Legacy's Allure")));
this.addAbility(ability);
}
public LegacysAllure(final LegacysAllure card) {
super(card);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability instanceof SimpleActivatedAbility) {
Permanent sourcePermanent = game.getPermanent(ability.getSourceId());
if (sourcePermanent != null) {
int numbCounters = sourcePermanent.getCounters().getCount("treasure");
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power less than or equal to the number of treasure counters on Legacy's Allure");
filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, numbCounters + 1));
ability.getTargets().clear();
ability.getTargets().add(new TargetCreaturePermanent(filter));
}
}
}
@Override
public LegacysAllure copy() {
return new LegacysAllure(this);
}
}

View file

@ -59,12 +59,14 @@ public class DoomedNecromancer extends CardImpl {
this.color.setBlack(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// {B}, {tap}, Sacrifice Doomed Necromancer: Return target creature card from your graveyard to the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new ColoredManaCost(ColoredManaSymbol.B));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
this.addAbility(ability);
// {B}, {tap}, Sacrifice Doomed Necromancer: Return target creature card from your graveyard to the battlefield.
}
public DoomedNecromancer(final DoomedNecromancer card) {

View file

@ -0,0 +1,208 @@
/*
* 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.sets.urzassaga;
import java.util.UUID;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class DiabolicServitude extends CardImpl {
public DiabolicServitude(UUID ownerId) {
super(ownerId, 130, "Diabolic Servitude", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}");
this.expansionSetCode = "USG";
this.color.setBlack(true);
// When Diabolic Servitude enters the battlefield, return target creature card from your graveyard to the battlefield.
Ability ability = new EntersBattlefieldTriggeredAbility(new DiabolicServitudeReturnCreatureEffect());
ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
this.addAbility(ability);
// When the creature put onto the battlefield with Diabolic Servitude dies, exile it and return Diabolic Servitude to its owner's hand.
this.addAbility(new DiabolicServitudeCreatureDiesTriggeredAbility());
// When Diabolic Servitude leaves the battlefield, exile the creature put onto the battlefield with Diabolic Servitude.
this.addAbility(new LeavesBattlefieldTriggeredAbility(new DiabolicServitudeSourceLeftBattlefieldEffect(), false));
}
public DiabolicServitude(final DiabolicServitude card) {
super(card);
}
@Override
public DiabolicServitude copy() {
return new DiabolicServitude(this);
}
}
class DiabolicServitudeReturnCreatureEffect extends OneShotEffect {
public DiabolicServitudeReturnCreatureEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "return target creature card from your graveyard to the battlefield";
}
public DiabolicServitudeReturnCreatureEffect(final DiabolicServitudeReturnCreatureEffect effect) {
super(effect);
}
@Override
public DiabolicServitudeReturnCreatureEffect copy() {
return new DiabolicServitudeReturnCreatureEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Card cardInGraveyard = game.getCard(getTargetPointer().getFirst(game, source));
if (cardInGraveyard != null) {
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
effect.setTargetPointer(getTargetPointer());
effect.apply(game, source);
game.getState().setValue(source.getSourceId().toString() + "returnedCreature", new MageObjectReference(cardInGraveyard.getId(), game));
return true;
}
return false;
}
}
class DiabolicServitudeCreatureDiesTriggeredAbility extends TriggeredAbilityImpl {
public DiabolicServitudeCreatureDiesTriggeredAbility() {
super(Zone.BATTLEFIELD, new DiabolicServitudeExileCreatureEffect(), false);
}
public DiabolicServitudeCreatureDiesTriggeredAbility(final DiabolicServitudeCreatureDiesTriggeredAbility ability) {
super(ability);
}
@Override
public DiabolicServitudeCreatureDiesTriggeredAbility copy() {
return new DiabolicServitudeCreatureDiesTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
Object object = game.getState().getValue(getSourceId().toString() + "returnedCreature");
if ((object instanceof MageObjectReference) && ((MageObjectReference)object).refersTo(zEvent.getTarget())) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "When the creature put onto the battlefield with {this} dies, exile it and return {this} to its owner's hand.";
}
}
class DiabolicServitudeExileCreatureEffect extends OneShotEffect {
public DiabolicServitudeExileCreatureEffect() {
super(Outcome.Benefit);
this.staticText = "exile it and return {this} to its owner's hand";
}
public DiabolicServitudeExileCreatureEffect(final DiabolicServitudeExileCreatureEffect effect) {
super(effect);
}
@Override
public DiabolicServitudeExileCreatureEffect copy() {
return new DiabolicServitudeExileCreatureEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Object object = game.getState().getValue(source.getSourceId().toString() + "returnedCreature");
if ((object instanceof MageObjectReference)) {
Effect effect = new ExileTargetEffect();
effect.setTargetPointer(new FixedTarget(((MageObjectReference)object).getSourceId()));
effect.apply(game, source);
return new ReturnToHandSourceEffect(true).apply(game, source);
}
return false;
}
}
class DiabolicServitudeSourceLeftBattlefieldEffect extends OneShotEffect {
public DiabolicServitudeSourceLeftBattlefieldEffect() {
super(Outcome.Detriment);
this.staticText = "exile the creature put onto the battlefield with {this}";
}
public DiabolicServitudeSourceLeftBattlefieldEffect(final DiabolicServitudeSourceLeftBattlefieldEffect effect) {
super(effect);
}
@Override
public DiabolicServitudeSourceLeftBattlefieldEffect copy() {
return new DiabolicServitudeSourceLeftBattlefieldEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Object object = game.getState().getValue(source.getSourceId().toString() + "returnedCreature");
if ((object instanceof MageObjectReference)) {
Effect effect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD);
effect.setTargetPointer(new FixedTarget(((MageObjectReference)object).getSourceId()));
effect.apply(game, source);
}
return false;
}
}

View file

@ -83,7 +83,7 @@ public class CopyTargetSpellEffect extends OneShotEffect {
@Override
public String getText(Mode mode) {
StringBuilder sb = new StringBuilder();
sb.append("Copy target ").append(mode.getTargets().get(0).getTargetName()).append(". You may choose new targets for the copy");
sb.append("copy target ").append(mode.getTargets().get(0).getTargetName()).append(". You may choose new targets for the copy");
return sb.toString();
}
}