[KHM] Implemented Rune of Mortality

This commit is contained in:
Evan Kranzler 2021-01-19 21:01:31 -05:00
parent 0d598c7383
commit 4d56c41842
2 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,75 @@
package mage.cards.r;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.AttachedToMatchesFilterCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class RuneOfMortality extends CardImpl {
private static final Condition condition1 = new AttachedToMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_CREATURE);
private static final Condition condition2 = new AttachedToMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_EQUIPMENT);
public RuneOfMortality(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
this.subtype.add(SubType.AURA);
this.subtype.add(SubType.RUNE);
// Enchant permanent
TargetPermanent auraTarget = new TargetPermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// When Rune of Mortality enters the battlefield, draw a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
// As long as enchanted permanent is a creature, it has deathtouch.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilityAttachedEffect(
DeathtouchAbility.getInstance(), AttachmentType.AURA
), condition1, "as long as enchanted permanent is a creature, it has deathtouch"
)));
// As long as enchanted permanent is an Equipment, it has "Equipped creature has deathtouch."
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilityAttachedEffect(
new SimpleStaticAbility(new GainAbilityAttachedEffect(
DeathtouchAbility.getInstance(), AttachmentType.EQUIPMENT
)), AttachmentType.AURA
), condition2, "as long as enchanted permanent is an Equipment, " +
"it has \"Equipped creature has deathtouch.\""
)));
}
private RuneOfMortality(final RuneOfMortality card) {
super(card);
}
@Override
public RuneOfMortality copy() {
return new RuneOfMortality(this);
}
}

View file

@ -254,6 +254,7 @@ public final class Kaldheim extends ExpansionSet {
cards.add(new SetCardInfo("Run Ashore", 74, Rarity.COMMON, mage.cards.r.RunAshore.class));
cards.add(new SetCardInfo("Rune of Flight", 75, Rarity.UNCOMMON, mage.cards.r.RuneOfFlight.class));
cards.add(new SetCardInfo("Rune of Might", 191, Rarity.UNCOMMON, mage.cards.r.RuneOfMight.class));
cards.add(new SetCardInfo("Rune of Mortality", 108, Rarity.UNCOMMON, mage.cards.r.RuneOfMortality.class));
cards.add(new SetCardInfo("Sarulf's Packmate", 192, Rarity.COMMON, mage.cards.s.SarulfsPackmate.class));
cards.add(new SetCardInfo("Sarulf, Realm Eater", 228, Rarity.RARE, mage.cards.s.SarulfRealmEater.class));
cards.add(new SetCardInfo("Saw It Coming", 76, Rarity.UNCOMMON, mage.cards.s.SawItComing.class));