implement [M3C] Lazotep Quarry

This commit is contained in:
Susucre 2024-06-04 19:10:14 +02:00
parent 274b52bef0
commit dd8b5e4f93
2 changed files with 109 additions and 0 deletions

View file

@ -0,0 +1,108 @@
package mage.cards.l;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.abilities.mana.AnyColorManaAbility;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.Card;
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.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetadjustment.XManaValueTargetAdjuster;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author Susucr
*/
public final class LazotepQuarry extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.DESERT, "Desert");
public LazotepQuarry(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
this.subtype.add(SubType.DESERT);
// {T}: Add {C}.
this.addAbility(new ColorlessManaAbility());
// {T}, Sacrifice a creature: Add one mana of any color.
Ability ability = new AnyColorManaAbility();
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_PERMANENT_CREATURE));
this.addAbility(ability);
// {X}{2}, {T}, Sacrifice a Desert: Exile target creature card with mana value X from your graveyard. Create a token that's a copy of it, except it's a 4/4 black Zombie. Activate only as a sorcery.
ability = new ActivateAsSorceryActivatedAbility(
new LazotepQuarryTargetEffect(),
new ManaCostsImpl<>("{X}{2}")
);
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(filter));
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE));
ability.setTargetAdjuster(new XManaValueTargetAdjuster());
this.addAbility(ability);
}
private LazotepQuarry(final LazotepQuarry card) {
super(card);
}
@Override
public LazotepQuarry copy() {
return new LazotepQuarry(this);
}
}
class LazotepQuarryTargetEffect extends OneShotEffect {
LazotepQuarryTargetEffect() {
super(Outcome.PutCreatureInPlay);
staticText = "Exile target creature card with mana value X from your graveyard. "
+ "Create a token that's a copy of it, except it's a 4/4 black Zombie";
}
private LazotepQuarryTargetEffect(final LazotepQuarryTargetEffect effect) {
super(effect);
}
@Override
public LazotepQuarryTargetEffect copy() {
return new LazotepQuarryTargetEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
if (card == null || controller == null) {
return false;
}
controller.moveCards(card, Zone.EXILED, source, game);
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(
source.getControllerId(), null, false, 1,
false, false, null, 4, 4, false
);
effect.setTargetPointer(new FixedTarget(card, game));
effect.setOnlySubType(SubType.ZOMBIE);
effect.setOnlyColor(ObjectColor.BLACK);
effect.apply(game, source);
return true;
}
}

View file

@ -155,6 +155,7 @@ public final class ModernHorizons3Commander extends ExpansionSet {
cards.add(new SetCardInfo("Kolaghan's Command", 268, Rarity.RARE, mage.cards.k.KolaghansCommand.class));
cards.add(new SetCardInfo("Kozilek's Return", 214, Rarity.MYTHIC, mage.cards.k.KozileksReturn.class));
cards.add(new SetCardInfo("Lair of the Hydra", 353, Rarity.RARE, mage.cards.l.LairOfTheHydra.class));
cards.add(new SetCardInfo("Lazotep Quarry", 79, Rarity.RARE, mage.cards.l.LazotepQuarry.class));
cards.add(new SetCardInfo("Legion Loyalty", 171, Rarity.MYTHIC, mage.cards.l.LegionLoyalty.class));
cards.add(new SetCardInfo("Lhurgoyf", 235, Rarity.RARE, mage.cards.l.Lhurgoyf.class));
cards.add(new SetCardInfo("Lightning Greaves", 298, Rarity.UNCOMMON, mage.cards.l.LightningGreaves.class));