diff --git a/Mage.Sets/src/mage/cards/u/UnstoppableSlasher.java b/Mage.Sets/src/mage/cards/u/UnstoppableSlasher.java new file mode 100644 index 00000000000..f3b3386bf50 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UnstoppableSlasher.java @@ -0,0 +1,73 @@ +package mage.cards.u; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.DiesSourceTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.LoseHalfLifeTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldWithCounterEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.counters.Counter; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author PurpleCrowbar + */ +public final class UnstoppableSlasher extends CardImpl { + + public UnstoppableSlasher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.subtype.add(SubType.ZOMBIE, SubType.ASSASSIN); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Whenever Unstoppable Slasher deals combat damage to a player, they lose half their life, rounded up. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LoseHalfLifeTargetEffect() + .setText("they lose half their life, rounded up"), false, true)); + + // When Unstoppable Slasher dies, if it had no counters on it, return it to the battlefield tapped under its owner's control with two stun counters on it. + this.addAbility(new ConditionalInterveningIfTriggeredAbility(new DiesSourceTriggeredAbility(new ReturnSourceFromGraveyardToBattlefieldWithCounterEffect( + CounterType.STUN.createInstance(2), true, true, false, false + ), false), UnstoppableSlasherCondition.instance, "When {this} dies, if it had no counters on it, return it to the battlefield tapped under its owner's control with two stun counters on it")); + } + + private UnstoppableSlasher(final UnstoppableSlasher card) { + super(card); + } + + @Override + public UnstoppableSlasher copy() { + return new UnstoppableSlasher(this); + } +} + +enum UnstoppableSlasherCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = source.getSourcePermanentOrLKI(game); + if (permanent == null) { + return false; + } + return permanent + .getCounters(game) + .values() + .stream() + .mapToInt(Counter::getCount) + .sum() == 0; + } +} diff --git a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java index 60bfc60f548..81fe839e138 100644 --- a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java +++ b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java @@ -226,6 +226,9 @@ public final class DuskmournHouseOfHorror extends ExpansionSet { cards.add(new SetCardInfo("Unidentified Hovership", 37, Rarity.RARE, mage.cards.u.UnidentifiedHovership.class)); cards.add(new SetCardInfo("Unnerving Grasp", 80, Rarity.UNCOMMON, mage.cards.u.UnnervingGrasp.class)); cards.add(new SetCardInfo("Unsettling Twins", 38, Rarity.COMMON, mage.cards.u.UnsettlingTwins.class)); + cards.add(new SetCardInfo("Unstoppable Slasher", 119, Rarity.RARE, mage.cards.u.UnstoppableSlasher.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Unstoppable Slasher", 294, Rarity.RARE, mage.cards.u.UnstoppableSlasher.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Unstoppable Slasher", 312, Rarity.RARE, mage.cards.u.UnstoppableSlasher.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Untimely Malfunction", 161, Rarity.UNCOMMON, mage.cards.u.UntimelyMalfunction.class)); cards.add(new SetCardInfo("Unwanted Remake", 39, Rarity.UNCOMMON, mage.cards.u.UnwantedRemake.class)); cards.add(new SetCardInfo("Unwilling Vessel", 81, Rarity.UNCOMMON, mage.cards.u.UnwillingVessel.class));