[MKM] Implement Judith, Carnage Connoisseur (#11821)

This commit is contained in:
Matthew Wilson 2024-02-21 06:36:34 +02:00 committed by GitHub
parent 201edec5f9
commit 477ccb99e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 131 additions and 0 deletions

View file

@ -0,0 +1,94 @@
package mage.cards.j;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.Card;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SetTargetPointer;
import mage.constants.SubLayer;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.token.ImpToken;
import mage.game.stack.Spell;
/**
*
* @author DominionSpy
*/
public final class JudithCarnageConnoisseur extends CardImpl {
public JudithCarnageConnoisseur(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{R}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SHAMAN);
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// Whenever you cast an instant or sorcery spell, choose one --
// * That spell gains deathtouch and lifelink.
Ability ability = new SpellCastControllerTriggeredAbility(
new JudithCarnageConnoisseurEffect(),
StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY,
false, SetTargetPointer.SPELL);
// * Create a 2/2 red Imp creature token with "When this creature dies, it deals 2 damage to each opponent."
Mode mode = new Mode(new CreateTokenEffect(new ImpToken()));
ability.addMode(mode);
this.addAbility(ability);
}
private JudithCarnageConnoisseur(final JudithCarnageConnoisseur card) {
super(card);
}
@Override
public JudithCarnageConnoisseur copy() {
return new JudithCarnageConnoisseur(this);
}
}
class JudithCarnageConnoisseurEffect extends ContinuousEffectImpl {
JudithCarnageConnoisseurEffect() {
super(Duration.Custom, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
staticText = "That spell gains deathtouch and lifelink";
}
private JudithCarnageConnoisseurEffect(final JudithCarnageConnoisseurEffect effect) {
super(effect);
}
@Override
public JudithCarnageConnoisseurEffect copy() {
return new JudithCarnageConnoisseurEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getSpell(getTargetPointer().getFirst(game, source));
if (spell == null) {
return false;
}
Card card = spell.getCard();
game.getState().addOtherAbility(card, DeathtouchAbility.getInstance());
game.getState().addOtherAbility(card, LifelinkAbility.getInstance());
return true;
}
}

View file

@ -137,6 +137,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet {
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("Judith, Carnage Connoisseur", 210, Rarity.RARE, mage.cards.j.JudithCarnageConnoisseur.class));
cards.add(new SetCardInfo("Knife", 134, Rarity.UNCOMMON, mage.cards.k.Knife.class));
cards.add(new SetCardInfo("Kraul Whipcracker", 213, Rarity.UNCOMMON, mage.cards.k.KraulWhipcracker.class));
cards.add(new SetCardInfo("Krenko's Buzzcrusher", 136, Rarity.RARE, mage.cards.k.KrenkosBuzzcrusher.class));

View file

@ -0,0 +1,36 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamagePlayersEffect;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
public final class ImpToken extends TokenImpl {
public ImpToken() {
super("Imp Token", "2/2 red Imp creature token with \"When this creature dies, it deals 2 damage to each opponent.\"");
cardType.add(CardType.CREATURE);
subtype.add(SubType.IMP);
color.setRed(true);
power = new MageInt(2);
toughness = new MageInt(2);
// When this creature dies, it deals 2 damage to each opponent.
Effect effect = new DamagePlayersEffect(2, TargetController.OPPONENT);
effect.setText("it deals 2 damage to each opponent");
Ability ability = new DiesSourceTriggeredAbility(effect);
this.addAbility(ability);
}
private ImpToken(final ImpToken token) {
super(token);
}
public ImpToken copy() {
return new ImpToken(this);
}
}