[40K] Implemented Malanthrope

This commit is contained in:
Evan Kranzler 2022-10-03 22:37:16 -04:00
parent 42d6080a7a
commit b2c741b971
2 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,84 @@
package mage.cards.m;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
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.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class Malanthrope extends CardImpl {
public Malanthrope(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{U}");
this.subtype.add(SubType.TYRANID);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Scavenge the Dead -- When Malanthrope enters the battlefield, exile target player's graveyard. Put a +1/+1 counter on Malanthrope for each creature card exiled this way.
Ability ability = new EntersBattlefieldTriggeredAbility(new MalanthropeEffect());
ability.addTarget(new TargetPlayer());
this.addAbility(ability.withFlavorWord("Scavenge the Dead"));
}
private Malanthrope(final Malanthrope card) {
super(card);
}
@Override
public Malanthrope copy() {
return new Malanthrope(this);
}
}
class MalanthropeEffect extends OneShotEffect {
MalanthropeEffect() {
super(Outcome.Benefit);
staticText = "exile target player's graveyard. Put a +1/+1 counter " +
"on {this} for each creature card exiled this way";
}
private MalanthropeEffect(final MalanthropeEffect effect) {
super(effect);
}
@Override
public MalanthropeEffect copy() {
return new MalanthropeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player == null || player.getGraveyard().isEmpty()) {
return false;
}
int count = player.getGraveyard().size();
player.moveCards(player.getGraveyard(), Zone.EXILED, source, game);
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent != null) {
permanent.addCounters(CounterType.P1P1.createInstance(count), source, game);
}
return true;
}
}

View file

@ -137,6 +137,7 @@ public final class Warhammer40000 extends ExpansionSet {
cards.add(new SetCardInfo("Lokhust Heavy Destroyer", 38, Rarity.RARE, mage.cards.l.LokhustHeavyDestroyer.class));
cards.add(new SetCardInfo("Lord of Change", 24, Rarity.RARE, mage.cards.l.LordOfChange.class));
cards.add(new SetCardInfo("Lychguard", 39, Rarity.RARE, mage.cards.l.Lychguard.class));
cards.add(new SetCardInfo("Malanthrope", 132, Rarity.RARE, mage.cards.m.Malanthrope.class));
cards.add(new SetCardInfo("Martial Coup", 189, Rarity.RARE, mage.cards.m.MartialCoup.class));
cards.add(new SetCardInfo("Mask of Memory", 243, Rarity.UNCOMMON, mage.cards.m.MaskOfMemory.class));
cards.add(new SetCardInfo("Mawloc", 133, Rarity.RARE, mage.cards.m.Mawloc.class));