forked from External/mage
implement [MH3] Vexing Bauble (#12344)
This commit is contained in:
parent
371ee07b34
commit
f36a40716d
3 changed files with 95 additions and 0 deletions
48
Mage.Sets/src/mage/cards/v/VexingBauble.java
Normal file
48
Mage.Sets/src/mage/cards/v/VexingBauble.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package mage.cards.v;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SpellCastNoManaSpentTriggeredAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author grimreap124
|
||||
*/
|
||||
public final class VexingBauble extends CardImpl {
|
||||
|
||||
public VexingBauble(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[] { CardType.ARTIFACT }, "{1}");
|
||||
|
||||
// Whenever a player casts a spell, if no mana was spent to cast it, counter that spell.
|
||||
this.addAbility(new SpellCastNoManaSpentTriggeredAbility(
|
||||
new CounterTargetEffect().setText("counter that spell")));
|
||||
|
||||
// {1}, {T}, Sacrifice Vexing Bauble: Draw a card.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1),
|
||||
new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
;
|
||||
}
|
||||
|
||||
private VexingBauble(final VexingBauble card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VexingBauble copy() {
|
||||
return new VexingBauble(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -269,6 +269,7 @@ public final class ModernHorizons3 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Urza's Cave", 234, Rarity.UNCOMMON, mage.cards.u.UrzasCave.class));
|
||||
cards.add(new SetCardInfo("Urza's Incubator", 297, Rarity.RARE, mage.cards.u.UrzasIncubator.class));
|
||||
cards.add(new SetCardInfo("Utter Insignificance", 78, Rarity.COMMON, mage.cards.u.UtterInsignificance.class));
|
||||
cards.add(new SetCardInfo("Vexing Bauble", 212, Rarity.UNCOMMON, mage.cards.v.VexingBauble.class));
|
||||
cards.add(new SetCardInfo("Victimize", 278, Rarity.UNCOMMON, mage.cards.v.Victimize.class));
|
||||
cards.add(new SetCardInfo("Voidpouncer", 143, Rarity.COMMON, mage.cards.v.Voidpouncer.class));
|
||||
cards.add(new SetCardInfo("Voltstorm Angel", 46, Rarity.UNCOMMON, mage.cards.v.VoltstormAngel.class));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
* @author grimreap124
|
||||
*/
|
||||
public class SpellCastNoManaSpentTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public SpellCastNoManaSpentTriggeredAbility(Effect effect) {
|
||||
super(Zone.BATTLEFIELD, effect, false);
|
||||
this.setTriggerPhrase("Whenever a player casts a spell, if no mana was spent to cast it, ");
|
||||
}
|
||||
|
||||
protected SpellCastNoManaSpentTriggeredAbility(final SpellCastNoManaSpentTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellCastNoManaSpentTriggeredAbility copy() {
|
||||
return new SpellCastNoManaSpentTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.SPELL_CAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && spell.getStackAbility().getManaCostsToPay().getUsedManaToPay().count() == 0) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue