mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
[DTK] Added 8 blue cards and some fixes.
This commit is contained in:
parent
f94e05352e
commit
147ad8f86c
14 changed files with 780 additions and 59 deletions
|
@ -27,8 +27,6 @@
|
|||
*/
|
||||
package mage.sets.dragonsoftarkir;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.Cost;
|
||||
|
@ -40,18 +38,14 @@ import mage.cards.CardImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.watchers.Watcher;
|
||||
import mage.watchers.common.DragonOnTheBattlefieldWhileSpellWasCastWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -76,7 +70,7 @@ public class DraconicRoar extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new DraconicRoarEffect());
|
||||
this.getSpellAbility().addWatcher(new DraconicRoarCastWatcher());
|
||||
this.getSpellAbility().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -120,7 +114,7 @@ class DraconicRoarEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
DraconicRoarCastWatcher watcher = (DraconicRoarCastWatcher) game.getState().getWatchers().get("DraconicRoarCastWatcher");
|
||||
DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher = (DragonOnTheBattlefieldWhileSpellWasCastWatcher) game.getState().getWatchers().get("DragonOnTheBattlefieldWhileSpellWasCastWatcher");
|
||||
boolean condition = watcher != null && watcher.castWithConditionTrue(source.getId());
|
||||
if (!condition) {
|
||||
for (Cost cost: source.getCosts()) {
|
||||
|
@ -144,46 +138,3 @@ class DraconicRoarEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
class DraconicRoarCastWatcher extends Watcher {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Dragon", "Dragons");
|
||||
|
||||
private final Set<UUID> castWithDragonOnTheBattlefield = new HashSet<>();
|
||||
|
||||
public DraconicRoarCastWatcher() {
|
||||
super("DraconicRoarCastWatcher", WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public DraconicRoarCastWatcher(final DraconicRoarCastWatcher watcher) {
|
||||
super(watcher);
|
||||
this.castWithDragonOnTheBattlefield.addAll(watcher.castWithDragonOnTheBattlefield);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
// targetId is the unique ID of the spell
|
||||
Spell spell = game.getState().getStack().getSpell(event.getTargetId());
|
||||
if (spell != null) {
|
||||
if (game.getBattlefield().countAll(filter, spell.getControllerId(), game) > 0) {
|
||||
castWithDragonOnTheBattlefield.add(spell.getId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
castWithDragonOnTheBattlefield.clear();
|
||||
}
|
||||
|
||||
public boolean castWithConditionTrue(UUID spellId) {
|
||||
return castWithDragonOnTheBattlefield.contains(spellId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DraconicRoarCastWatcher copy() {
|
||||
return new DraconicRoarCastWatcher(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
|
|||
import mage.abilities.effects.ContinuousRuleModifyingEffect;
|
||||
import mage.abilities.effects.common.CantBeCounteredSourceEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
|
@ -45,6 +46,7 @@ import mage.filter.common.FilterControlledPermanent;
|
|||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
/**
|
||||
|
@ -64,20 +66,31 @@ public class DragonlordsPrerogative extends CardImpl {
|
|||
this.expansionSetCode = "DTK";
|
||||
|
||||
// As an additional cost to cast Dragonlord's Prerogative, you may reveal a Dragon card from your hand.
|
||||
// If you revealed a Dragon card or controlled a Dragon as you cast Dragonlord's Prerogative, Dragonlord's Prerogative can't be countered.
|
||||
// Draw four cards.
|
||||
this.getSpellAbility().addEffect(new InfoEffect("As an additional cost to cast {this}, you may reveal a Dragon card from your hand"));
|
||||
|
||||
this.getSpellAbility().addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, 1, filter)));
|
||||
// If you revealed a Dragon card or controlled a Dragon as you cast Dragonlord's Prerogative, Dragonlord's Prerogative can't be countered.
|
||||
Condition condition = new DragonlordsPrerogativeCondition();
|
||||
ContinuousRuleModifyingEffect cantBeCountered = new CantBeCounteredSourceEffect();
|
||||
ConditionalContinuousRuleModifyingEffect conditionalCantBeCountered = new ConditionalContinuousRuleModifyingEffect(cantBeCountered, condition);
|
||||
conditionalCantBeCountered.setText("If you revealed a Dragon card or controlled a Dragon as you cast {this}, {this} can't be countered");
|
||||
Ability ability = new SimpleStaticAbility(Zone.STACK, conditionalCantBeCountered);
|
||||
this.addAbility(ability);
|
||||
|
||||
// Draw four cards.
|
||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
Player controller = game.getPlayer(ability.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.getHand().count(filter, game) > 0) {
|
||||
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0,1, filter)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DragonlordsPrerogative(final DragonlordsPrerogative card) {
|
||||
super(card);
|
||||
}
|
||||
|
|
|
@ -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.dragonsoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ExploitCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.ExploitAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SilumgarSorcerer extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("creature spell");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
}
|
||||
|
||||
public SilumgarSorcerer(UUID ownerId) {
|
||||
super(ownerId, 76, "Silumgar Sorcerer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
|
||||
this.expansionSetCode = "DTK";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Wizard");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Flash
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// Exploit (When this creature enters the battlefield, you may sacrifice a creature.)
|
||||
this.addAbility(new ExploitAbility());
|
||||
|
||||
// When Silumgar Sorcerer exploits a creature, counter target creature spell.
|
||||
Ability ability = new ExploitCreatureTriggeredAbility(new CounterTargetEffect(), false);
|
||||
ability.addTarget(new TargetSpell(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public SilumgarSorcerer(final SilumgarSorcerer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SilumgarSorcerer copy() {
|
||||
return new SilumgarSorcerer(this);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* 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.dragonsoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CounterUnlessPaysEffect;
|
||||
import mage.abilities.keyword.MorphAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SilumgarSpellEater extends CardImpl {
|
||||
|
||||
public SilumgarSpellEater(UUID ownerId) {
|
||||
super(ownerId, 77, "Silumgar Spell-Eater", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||
this.expansionSetCode = "DTK";
|
||||
this.subtype.add("Naga");
|
||||
this.subtype.add("Wizard");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Megamorph {4}{U}
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{4}{U}"), true));
|
||||
|
||||
// When Silumgar Spell-Eater is turned face up, counter target spell unless its controller pays {3}.
|
||||
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new CounterUnlessPaysEffect(new GenericManaCost(3)), false, false);
|
||||
ability.addTarget(new TargetSpell());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public SilumgarSpellEater(final SilumgarSpellEater card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SilumgarSpellEater copy() {
|
||||
return new SilumgarSpellEater(this);
|
||||
}
|
||||
}
|
140
Mage.Sets/src/mage/sets/dragonsoftarkir/SilumgarsScorn.java
Normal file
140
Mage.Sets/src/mage/sets/dragonsoftarkir/SilumgarsScorn.java
Normal file
|
@ -0,0 +1,140 @@
|
|||
/*
|
||||
* 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.dragonsoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.RevealTargetFromHandCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetSpell;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.watchers.common.DragonOnTheBattlefieldWhileSpellWasCastWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SilumgarsScorn extends CardImpl {
|
||||
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("a Dragon card from your hand (you don't have to)");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Dragon"));
|
||||
}
|
||||
|
||||
public SilumgarsScorn(UUID ownerId) {
|
||||
super(ownerId, 78, "Silumgar's Scorn", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}{U}");
|
||||
this.expansionSetCode = "DTK";
|
||||
|
||||
// As an additional cost to cast Silumgar's Scorn, you may reveal a Dragon card from your hand.
|
||||
this.getSpellAbility().addEffect(new InfoEffect("As an additional cost to cast {this}, you may reveal a Dragon card from your hand<br/>"));
|
||||
|
||||
// Counter target spell unless its controller pays {1}. If you revealed a Dragon card or controlled a Dragon as you cast Silumgar's Scorn, counter that spell instead.
|
||||
this.getSpellAbility().addEffect(new SilumgarsScornCounterEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell());
|
||||
this.getSpellAbility().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
Player controller = game.getPlayer(ability.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.getHand().count(filter, game) > 0) {
|
||||
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0,1, filter)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SilumgarsScorn(final SilumgarsScorn card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SilumgarsScorn copy() {
|
||||
return new SilumgarsScorn(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SilumgarsScornCounterEffect extends OneShotEffect {
|
||||
|
||||
public SilumgarsScornCounterEffect() {
|
||||
super(Outcome.Detriment);
|
||||
staticText = "Counter target spell unless its controller pays {1}. If you revealed a Dragon card or controlled a Dragon as you cast {this}, counter that spell instead";
|
||||
}
|
||||
|
||||
public SilumgarsScornCounterEffect(final SilumgarsScornCounterEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SilumgarsScornCounterEffect copy() {
|
||||
return new SilumgarsScornCounterEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source));
|
||||
if (spell != null) {
|
||||
Player player = game.getPlayer(spell.getControllerId());
|
||||
if (player != null) {
|
||||
DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher = (DragonOnTheBattlefieldWhileSpellWasCastWatcher) game.getState().getWatchers().get("DragonOnTheBattlefieldWhileSpellWasCastWatcher");
|
||||
boolean condition = watcher != null && watcher.castWithConditionTrue(source.getId());
|
||||
if (!condition) {
|
||||
for (Cost cost: source.getCosts()) {
|
||||
if (cost instanceof RevealTargetFromHandCost) {
|
||||
condition = ((RevealTargetFromHandCost)cost).getNumberRevealedCards() > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (condition) {
|
||||
return game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
if (!(player.chooseUse(Outcome.Benefit, "Would you like to pay {1} to prevent counter effect?", game) &&
|
||||
new GenericManaCost(1).pay(source, game, spell.getSourceId(), spell.getControllerId(), false))) {
|
||||
return game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* 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.dragonsoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
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.game.permanent.token.Token;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SkywiseTeachings extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("a noncreature spell");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
||||
}
|
||||
|
||||
public SkywiseTeachings(UUID ownerId) {
|
||||
super(ownerId, 79, "Skywise Teachings", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
|
||||
this.expansionSetCode = "DTK";
|
||||
|
||||
// Whenever you cast a noncreature spell, you may pay {1}{U}. If you do, put a 2/2 blue Djinn Monk creature token with flying onto the battlefield.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new CreateTokenEffect(new SkywiseTeachingsToken()), new ManaCostsImpl("{1}{U}")), filter, false));
|
||||
|
||||
}
|
||||
|
||||
public SkywiseTeachings(final SkywiseTeachings card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkywiseTeachings copy() {
|
||||
return new SkywiseTeachings(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SkywiseTeachingsToken extends Token {
|
||||
|
||||
SkywiseTeachingsToken() {
|
||||
super("Djinn Monk", "a 2/2 blue Djinn Monk creature token with flying");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setRed(true);
|
||||
this.subtype.add("Djinn");
|
||||
this.subtype.add("Monk");
|
||||
power = new MageInt(2);
|
||||
toughness = new MageInt(2);
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
}
|
70
Mage.Sets/src/mage/sets/dragonsoftarkir/TaigamsStrike.java
Normal file
70
Mage.Sets/src/mage/sets/dragonsoftarkir/TaigamsStrike.java
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* 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.dragonsoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.keyword.ReboundAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TaigamsStrike extends CardImpl {
|
||||
|
||||
public TaigamsStrike(UUID ownerId) {
|
||||
super(ownerId, 81, "Taigam's Strike", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{U}");
|
||||
this.expansionSetCode = "DTK";
|
||||
|
||||
// Target creature gets +2/+0 until end of turn and can't be blocked this turn.
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn));
|
||||
Effect effect = new CantBeBlockedTargetEffect();
|
||||
effect.setText("and can't be blocked this turn");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
|
||||
// Rebound
|
||||
this.addAbility(new ReboundAbility());
|
||||
}
|
||||
|
||||
public TaigamsStrike(final TaigamsStrike card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaigamsStrike copy() {
|
||||
return new TaigamsStrike(this);
|
||||
}
|
||||
}
|
|
@ -54,7 +54,7 @@ import mage.watchers.Watcher;
|
|||
public class TapestryOfTheAges extends CardImpl {
|
||||
|
||||
public TapestryOfTheAges(UUID ownerId) {
|
||||
super(ownerId, 246, "Tapestry of the Ages", Rarity.UNCOMMON, new CardType[]{}, "Artifact");
|
||||
super(ownerId, 246, "Tapestry of the Ages", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT},"{4}" );
|
||||
this.expansionSetCode = "DTK";
|
||||
|
||||
// {2}, {T}: Draw a card. Activate this ability only if you've cast a noncreature spell this turn.
|
||||
|
|
64
Mage.Sets/src/mage/sets/dragonsoftarkir/VoidSquall.java
Normal file
64
Mage.Sets/src/mage/sets/dragonsoftarkir/VoidSquall.java
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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.dragonsoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.keyword.ReboundAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.target.common.TargetNonlandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class VoidSquall extends CardImpl {
|
||||
|
||||
public VoidSquall(UUID ownerId) {
|
||||
super(ownerId, 83, "Void Squall", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{U}");
|
||||
this.expansionSetCode = "DTK";
|
||||
|
||||
// Return target nonland permanent to its owner's hand.
|
||||
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
|
||||
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
||||
|
||||
// Rebound
|
||||
this.addAbility(new ReboundAbility());
|
||||
}
|
||||
|
||||
public VoidSquall(final VoidSquall card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoidSquall copy() {
|
||||
return new VoidSquall(this);
|
||||
}
|
||||
}
|
64
Mage.Sets/src/mage/sets/dragonsoftarkir/YouthfulScholar.java
Normal file
64
Mage.Sets/src/mage/sets/dragonsoftarkir/YouthfulScholar.java
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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.dragonsoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class YouthfulScholar extends CardImpl {
|
||||
|
||||
public YouthfulScholar(UUID ownerId) {
|
||||
super(ownerId, 84, "Youthful Scholar", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
||||
this.expansionSetCode = "DTK";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Wizard");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Youthful Scholar dies, draw two cards.
|
||||
this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(2), false));
|
||||
}
|
||||
|
||||
public YouthfulScholar(final YouthfulScholar card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public YouthfulScholar copy() {
|
||||
return new YouthfulScholar(this);
|
||||
}
|
||||
}
|
84
Mage.Sets/src/mage/sets/dragonsoftarkir/ZephyrScribe.java
Normal file
84
Mage.Sets/src/mage/sets/dragonsoftarkir/ZephyrScribe.java
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* 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.dragonsoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DrawDiscardControllerEffect;
|
||||
import mage.abilities.effects.common.UntapSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ZephyrScribe extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("a noncreature spell");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
||||
}
|
||||
|
||||
public ZephyrScribe(UUID ownerId) {
|
||||
super(ownerId, 85, "Zephyr Scribe", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||
this.expansionSetCode = "DTK";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Monk");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {U}, {T}: Draw a card, then discard a card.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(1,1), new ManaCostsImpl("{U}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Whenever you cast a noncreature spell, untap Zephyr Scribe.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), filter, false));
|
||||
}
|
||||
|
||||
public ZephyrScribe(final ZephyrScribe card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZephyrScribe copy() {
|
||||
return new ZephyrScribe(this);
|
||||
}
|
||||
}
|
|
@ -44,8 +44,8 @@ public class Disperse extends CardImpl {
|
|||
public Disperse (UUID ownerId) {
|
||||
super(ownerId, 31, "Disperse", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||
this.expansionSetCode = "SOM";
|
||||
this.color.setBlue(true);
|
||||
|
||||
// Return target nonland permanent to its owner's hand.
|
||||
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
|
||||
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
||||
}
|
||||
|
|
|
@ -69,6 +69,6 @@ public class CounterTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return "Counter target " + mode.getTargets().get(0).getTargetName();
|
||||
return "counter target " + mode.getTargets().get(0).getTargetName();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* 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.watchers.common;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class DragonOnTheBattlefieldWhileSpellWasCastWatcher extends Watcher {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Dragon", "Dragons");
|
||||
|
||||
private final Set<UUID> castWithDragonOnTheBattlefield = new HashSet<>();
|
||||
|
||||
public DragonOnTheBattlefieldWhileSpellWasCastWatcher() {
|
||||
super("DragonOnTheBattlefieldWhileSpellWasCastWatcher", WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public DragonOnTheBattlefieldWhileSpellWasCastWatcher(final DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher) {
|
||||
super(watcher);
|
||||
this.castWithDragonOnTheBattlefield.addAll(watcher.castWithDragonOnTheBattlefield);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
// targetId is the unique ID of the spell
|
||||
Spell spell = game.getState().getStack().getSpell(event.getTargetId());
|
||||
if (spell != null) {
|
||||
if (game.getBattlefield().countAll(filter, spell.getControllerId(), game) > 0) {
|
||||
castWithDragonOnTheBattlefield.add(spell.getId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
castWithDragonOnTheBattlefield.clear();
|
||||
}
|
||||
|
||||
public boolean castWithConditionTrue(UUID spellId) {
|
||||
return castWithDragonOnTheBattlefield.contains(spellId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DragonOnTheBattlefieldWhileSpellWasCastWatcher copy() {
|
||||
return new DragonOnTheBattlefieldWhileSpellWasCastWatcher(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue