[SNC] Implemented Knockout Blow

This commit is contained in:
Evan Kranzler 2022-04-12 08:40:47 -04:00
parent 6e0af2f9b9
commit be13f22435
3 changed files with 58 additions and 1 deletions

View file

@ -0,0 +1,56 @@
package mage.cards.k;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.SourceTargetsPermanentCondition;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetAttackingOrBlockingCreature;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class KnockoutBlow extends CardImpl {
private static final FilterPermanent filter
= new FilterPermanent("a red permanent");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
private static final Condition condition = new SourceTargetsPermanentCondition(filter);
public KnockoutBlow(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}");
// This spell costs {2} less to cast if it target a red creature.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SpellCostReductionSourceEffect(2, condition).setCanWorksOnStackOnly(true)
).setRuleAtTheTop(true));
// Knockout Blow deals 4 damage to target attacking or blocking creature and you gain 2 life.
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
this.getSpellAbility().addEffect(new GainLifeEffect(2).concatBy("and"));
this.getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature());
}
private KnockoutBlow(final KnockoutBlow card) {
super(card);
}
@Override
public KnockoutBlow copy() {
return new KnockoutBlow(this);
}
}

View file

@ -31,7 +31,7 @@ public final class OutOfTheWay extends CardImpl {
static { static {
filter.add(new ColorPredicate(ObjectColor.GREEN)); filter.add(new ColorPredicate(ObjectColor.GREEN));
filter.add(TargetController.OPPONENT.getControllerPredicate()); filter2.add(TargetController.OPPONENT.getControllerPredicate());
} }
private static final Condition condition = new SourceTargetsPermanentCondition(filter); private static final Condition condition = new SourceTargetsPermanentCondition(filter);

View file

@ -68,6 +68,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("Jetmir's Garden", 250, Rarity.RARE, mage.cards.j.JetmirsGarden.class)); cards.add(new SetCardInfo("Jetmir's Garden", 250, Rarity.RARE, mage.cards.j.JetmirsGarden.class));
cards.add(new SetCardInfo("Jetmir, Nexus of Revels", 193, Rarity.MYTHIC, mage.cards.j.JetmirNexusOfRevels.class)); cards.add(new SetCardInfo("Jetmir, Nexus of Revels", 193, Rarity.MYTHIC, mage.cards.j.JetmirNexusOfRevels.class));
cards.add(new SetCardInfo("Join the Maestros", 85, Rarity.COMMON, mage.cards.j.JoinTheMaestros.class)); cards.add(new SetCardInfo("Join the Maestros", 85, Rarity.COMMON, mage.cards.j.JoinTheMaestros.class));
cards.add(new SetCardInfo("Knockout Blow", 20, Rarity.COMMON, mage.cards.k.KnockoutBlow.class));
cards.add(new SetCardInfo("Ledger Shredder", 46, Rarity.RARE, mage.cards.l.LedgerShredder.class)); cards.add(new SetCardInfo("Ledger Shredder", 46, Rarity.RARE, mage.cards.l.LedgerShredder.class));
cards.add(new SetCardInfo("Light 'Em Up", 113, Rarity.COMMON, mage.cards.l.LightEmUp.class)); cards.add(new SetCardInfo("Light 'Em Up", 113, Rarity.COMMON, mage.cards.l.LightEmUp.class));
cards.add(new SetCardInfo("Lord Xander, the Collector", 197, Rarity.MYTHIC, mage.cards.l.LordXanderTheCollector.class)); cards.add(new SetCardInfo("Lord Xander, the Collector", 197, Rarity.MYTHIC, mage.cards.l.LordXanderTheCollector.class));