diff --git a/Mage.Sets/src/mage/cards/c/CoalbornEntity.java b/Mage.Sets/src/mage/cards/c/CoalbornEntity.java new file mode 100644 index 0000000000..27c346dbb5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CoalbornEntity.java @@ -0,0 +1,58 @@ +package mage.cards.c; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.common.FilterPermanentOrPlayer; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.target.common.TargetPermanentOrPlayer; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CoalbornEntity extends CardImpl { + + private static final FilterPermanentOrPlayer filter + = new FilterPermanentOrPlayer("creature token, player, or planeswalker"); + + static { + filter.getPermanentFilter().add(Predicates.or( + CardType.PLANESWALKER.getPredicate(), + Predicates.and( + CardType.CREATURE.getPredicate(), + TokenPredicate.TRUE + ) + )); + } + + public CoalbornEntity(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); + + this.subtype.add(SubType.ELEMENTAL); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {2}{R}: Coalborn Entity deals 1 damage to target creature token, player, or planeswalker. + Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(1), new ManaCostsImpl<>("{2}{R}")); + ability.addTarget(new TargetPermanentOrPlayer(filter)); + this.addAbility(ability); + } + + private CoalbornEntity(final CoalbornEntity card) { + super(card); + } + + @Override + public CoalbornEntity copy() { + return new CoalbornEntity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Jumpstart2022.java b/Mage.Sets/src/mage/sets/Jumpstart2022.java index 23d3662606..63aadac192 100644 --- a/Mage.Sets/src/mage/sets/Jumpstart2022.java +++ b/Mage.Sets/src/mage/sets/Jumpstart2022.java @@ -29,6 +29,7 @@ public final class Jumpstart2022 extends ExpansionSet { cards.add(new SetCardInfo("Blood Artist", 117, Rarity.UNCOMMON, mage.cards.b.BloodArtist.class)); cards.add(new SetCardInfo("Burglar Rat", 384, Rarity.COMMON, mage.cards.b.BurglarRat.class)); cards.add(new SetCardInfo("Chittering Rats", 387, Rarity.COMMON, mage.cards.c.ChitteringRats.class)); + cards.add(new SetCardInfo("Coalborn Entity", 32, Rarity.UNCOMMON, mage.cards.c.CoalbornEntity.class)); cards.add(new SetCardInfo("Coldsteel Heart", 94, Rarity.UNCOMMON, mage.cards.c.ColdsteelHeart.class)); cards.add(new SetCardInfo("Conductor of Cacophony", 20, Rarity.UNCOMMON, mage.cards.c.ConductorOfCacophony.class)); cards.add(new SetCardInfo("Crypt Rats", 392, Rarity.UNCOMMON, mage.cards.c.CryptRats.class)); diff --git a/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java b/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java index 7270ab98ed..9d08556a9d 100644 --- a/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java +++ b/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java @@ -23,13 +23,17 @@ public class TargetPermanentOrPlayer extends TargetImpl { protected FilterPermanentOrPlayer filter; public TargetPermanentOrPlayer() { - this(1, 1); + this(1); } public TargetPermanentOrPlayer(int numTargets) { this(numTargets, numTargets); } + public TargetPermanentOrPlayer(FilterPermanentOrPlayer filter) { + this(1, 1, filter, false); + } + public TargetPermanentOrPlayer(int minNumTargets, int maxNumTargets) { this(minNumTargets, maxNumTargets, false); }