mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Implemented Mythos of Nethroi
This commit is contained in:
parent
742f74ba86
commit
2b9fe91b63
2 changed files with 74 additions and 0 deletions
73
Mage.Sets/src/mage/cards/m/MythosOfNethroi.java
Normal file
73
Mage.Sets/src/mage/cards/m/MythosOfNethroi.java
Normal file
|
@ -0,0 +1,73 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.CompoundCondition;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ManaWasSpentCondition;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetNonlandPermanent;
|
||||
import mage.watchers.common.ManaSpentToCastWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MythosOfNethroi extends CardImpl {
|
||||
|
||||
public MythosOfNethroi(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}");
|
||||
|
||||
// Destroy target nonland permanent if it's a creature or if {G}{W} was spent to cast this spell.
|
||||
this.getSpellAbility().addEffect(new MythosOfNethroiEffect());
|
||||
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
|
||||
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
|
||||
}
|
||||
|
||||
private MythosOfNethroi(final MythosOfNethroi card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MythosOfNethroi copy() {
|
||||
return new MythosOfNethroi(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MythosOfNethroiEffect extends OneShotEffect {
|
||||
|
||||
private static final Condition condition = new CompoundCondition(
|
||||
new ManaWasSpentCondition(ColoredManaSymbol.G),
|
||||
new ManaWasSpentCondition(ColoredManaSymbol.W)
|
||||
);
|
||||
|
||||
MythosOfNethroiEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Destroy target nonland permanent if it's a creature or if {G}{W} was spent to cast this spell.";
|
||||
}
|
||||
|
||||
private MythosOfNethroiEffect(final MythosOfNethroiEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MythosOfNethroiEffect copy() {
|
||||
return new MythosOfNethroiEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent == null || (!permanent.isCreature() && !condition.apply(game, source))) {
|
||||
return false;
|
||||
}
|
||||
return permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
|
@ -58,6 +58,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Migration Path", 164, Rarity.UNCOMMON, mage.cards.m.MigrationPath.class));
|
||||
cards.add(new SetCardInfo("Mosscoat Goriak", 167, Rarity.COMMON, mage.cards.m.MosscoatGoriak.class));
|
||||
cards.add(new SetCardInfo("Mysterious Egg", 3, Rarity.COMMON, mage.cards.m.MysteriousEgg.class));
|
||||
cards.add(new SetCardInfo("Mythos of Nethroi", 97, Rarity.RARE, mage.cards.m.MythosOfNethroi.class));
|
||||
cards.add(new SetCardInfo("Nethroi, Apex of Death", 197, Rarity.MYTHIC, mage.cards.n.NethroiApexOfDeath.class));
|
||||
cards.add(new SetCardInfo("Neutralize", 59, Rarity.UNCOMMON, mage.cards.n.Neutralize.class));
|
||||
cards.add(new SetCardInfo("Pacifism", 25, Rarity.COMMON, mage.cards.p.Pacifism.class));
|
||||
|
|
Loading…
Reference in a new issue