forked from External/mage
[DSK] Implement Miasma Demon
This commit is contained in:
parent
9736a49aa4
commit
b7bf0de2b5
2 changed files with 86 additions and 0 deletions
85
Mage.Sets/src/mage/cards/m/MiasmaDemon.java
Normal file
85
Mage.Sets/src/mage/cards/m/MiasmaDemon.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MiasmaDemon extends CardImpl {
|
||||
|
||||
public MiasmaDemon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
|
||||
|
||||
this.subtype.add(SubType.DEMON);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Miasma Demon enters, you may discard any number of cards. When you do, up to that many target creatures each get -2/-2 until end of turn.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new MiasmaDemonEffect()));
|
||||
}
|
||||
|
||||
private MiasmaDemon(final MiasmaDemon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MiasmaDemon copy() {
|
||||
return new MiasmaDemon(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MiasmaDemonEffect extends OneShotEffect {
|
||||
|
||||
MiasmaDemonEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "you may discard any number of cards. When you do, " +
|
||||
"up to that many target creatures each get -2/-2 until end of turn";
|
||||
}
|
||||
|
||||
private MiasmaDemonEffect(final MiasmaDemonEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MiasmaDemonEffect copy() {
|
||||
return new MiasmaDemonEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
int amount = player.discard(0, Integer.MAX_VALUE, false, source, game).size();
|
||||
if (amount < 1) {
|
||||
return false;
|
||||
}
|
||||
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
|
||||
new BoostTargetEffect(-2, -2), false,
|
||||
"Up to that many target creatures each get -2/-2 until end of turn"
|
||||
);
|
||||
ability.addTarget(new TargetCreaturePermanent(0, amount));
|
||||
game.fireReflexiveTriggeredAbility(ability, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -127,6 +127,7 @@ public final class DuskmournHouseOfHorror extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Malevolent Chandelier", 252, Rarity.COMMON, mage.cards.m.MalevolentChandelier.class));
|
||||
cards.add(new SetCardInfo("Manifest Dread", 189, Rarity.COMMON, mage.cards.m.ManifestDread.class));
|
||||
cards.add(new SetCardInfo("Marina Vendrell's Grimoire", 64, Rarity.RARE, mage.cards.m.MarinaVendrellsGrimoire.class));
|
||||
cards.add(new SetCardInfo("Miasma Demon", 109, Rarity.UNCOMMON, mage.cards.m.MiasmaDemon.class));
|
||||
cards.add(new SetCardInfo("Midnight Mayhem", 222, Rarity.UNCOMMON, mage.cards.m.MidnightMayhem.class));
|
||||
cards.add(new SetCardInfo("Most Valuable Slayer", 144, Rarity.COMMON, mage.cards.m.MostValuableSlayer.class));
|
||||
cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue