mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Implemented Mystical Dispute
This commit is contained in:
parent
77516b7e71
commit
ce5e61e612
2 changed files with 74 additions and 0 deletions
73
Mage.Sets/src/mage/cards/m/MysticalDispute.java
Normal file
73
Mage.Sets/src/mage/cards/m/MysticalDispute.java
Normal file
|
@ -0,0 +1,73 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.CounterUnlessPaysEffect;
|
||||
import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MysticalDispute extends CardImpl {
|
||||
|
||||
public MysticalDispute(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}");
|
||||
|
||||
// This spell costs {2} less to cast if it targets a blue spell.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.STACK, new SpellCostReductionSourceEffect(2, MysticalDisputeCondition.instance)
|
||||
).setRuleAtTheTop(true));
|
||||
|
||||
// Counter target spell unless its controller pays {3}.
|
||||
this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(3)));
|
||||
this.getSpellAbility().addTarget(new TargetSpell());
|
||||
}
|
||||
|
||||
private MysticalDispute(final MysticalDispute card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MysticalDispute copy() {
|
||||
return new MysticalDispute(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum MysticalDisputeCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
StackObject sourceSpell = game.getStack().getStackObject(source.getSourceId());
|
||||
if (sourceSpell == null) {
|
||||
return false;
|
||||
}
|
||||
return sourceSpell
|
||||
.getStackAbility()
|
||||
.getTargets()
|
||||
.stream()
|
||||
.map(Target::getTargets)
|
||||
.flatMap(Collection::stream)
|
||||
.map(game::getSpell)
|
||||
.anyMatch(spell -> spell != null && spell.getColor(game).isBlue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "it targets a blue spell";
|
||||
}
|
||||
|
||||
}
|
|
@ -67,6 +67,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Mace of the Valiant", 314, Rarity.RARE, mage.cards.m.MaceOfTheValiant.class));
|
||||
cards.add(new SetCardInfo("Maraleaf Pixie", 196, Rarity.UNCOMMON, mage.cards.m.MaraleafPixie.class));
|
||||
cards.add(new SetCardInfo("Midnight Clock", 54, Rarity.RARE, mage.cards.m.MidnightClock.class));
|
||||
cards.add(new SetCardInfo("Mystical Dispute", 58, Rarity.UNCOMMON, mage.cards.m.MysticalDispute.class));
|
||||
cards.add(new SetCardInfo("Oko's Accomplices", 310, Rarity.COMMON, mage.cards.o.OkosAccomplices.class));
|
||||
cards.add(new SetCardInfo("Oko, Thief of Crowns", 197, Rarity.MYTHIC, mage.cards.o.OkoThiefOfCrowns.class));
|
||||
cards.add(new SetCardInfo("Order of Midnight", 99, Rarity.UNCOMMON, mage.cards.o.OrderOfMidnight.class));
|
||||
|
|
Loading…
Reference in a new issue