[MKM] Implement It Doesn't Add Up

This commit is contained in:
theelk801 2024-01-30 10:58:58 -05:00
parent bfb9002471
commit f2694eaa56
2 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,70 @@
package mage.cards.i;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.Optional;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ItDoesntAddUp extends CardImpl {
public ItDoesntAddUp(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}{B}");
// Return target creature card from your graveyard to the battlefield. Suspect it.
this.getSpellAbility().addEffect(new ItDoesntAddUpEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
}
private ItDoesntAddUp(final ItDoesntAddUp card) {
super(card);
}
@Override
public ItDoesntAddUp copy() {
return new ItDoesntAddUp(this);
}
}
class ItDoesntAddUpEffect extends OneShotEffect {
ItDoesntAddUpEffect() {
super(Outcome.Benefit);
staticText = "return target creature card from your graveyard to the battlefield. Suspect it";
}
private ItDoesntAddUpEffect(final ItDoesntAddUpEffect effect) {
super(effect);
}
@Override
public ItDoesntAddUpEffect copy() {
return new ItDoesntAddUpEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (player == null || card == null) {
return false;
}
player.moveCards(card, Zone.BATTLEFIELD, source, game);
Optional.ofNullable(game.getPermanent(card.getId()))
.ifPresent(permanent -> permanent.setSuspected(true, game, source));
return true;
}
}

View file

@ -120,6 +120,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet {
cards.add(new SetCardInfo("Inside Source", 19, Rarity.COMMON, mage.cards.i.InsideSource.class));
cards.add(new SetCardInfo("Insidious Roots", 208, Rarity.UNCOMMON, mage.cards.i.InsidiousRoots.class));
cards.add(new SetCardInfo("Island", 273, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("It Doesn't Add Up", 89, Rarity.UNCOMMON, mage.cards.i.ItDoesntAddUp.class));
cards.add(new SetCardInfo("Izoni, Center of the Web", 209, Rarity.RARE, mage.cards.i.IzoniCenterOfTheWeb.class));
cards.add(new SetCardInfo("Jaded Analyst", 62, Rarity.COMMON, mage.cards.j.JadedAnalyst.class));
cards.add(new SetCardInfo("Knife", 134, Rarity.UNCOMMON, mage.cards.k.Knife.class));