diff --git a/Mage.Sets/src/mage/cards/d/DissatisfiedCustomer.java b/Mage.Sets/src/mage/cards/d/DissatisfiedCustomer.java new file mode 100644 index 0000000000..ffe2067837 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DissatisfiedCustomer.java @@ -0,0 +1,80 @@ +package mage.cards.d; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DissatisfiedCustomer extends CardImpl { + + public DissatisfiedCustomer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.GUEST); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // When Dissatisfied Customer enters the battlefield, roll a six-sided die. If the result is 3 or less, you lose that much life. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DissatisfiedCustomerEffect())); + } + + private DissatisfiedCustomer(final DissatisfiedCustomer card) { + super(card); + } + + @Override + public DissatisfiedCustomer copy() { + return new DissatisfiedCustomer(this); + } +} + +class DissatisfiedCustomerEffect extends OneShotEffect { + + DissatisfiedCustomerEffect() { + super(Outcome.Benefit); + staticText = "roll a six-sided die. If the result is 3 or less, you lose that much life"; + } + + private DissatisfiedCustomerEffect(final DissatisfiedCustomerEffect effect) { + super(effect); + } + + @Override + public DissatisfiedCustomerEffect copy() { + return new DissatisfiedCustomerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int result = player.rollDice(outcome, source, game, 6); + if (result <= 3) { + player.loseLife(result, game, source, false); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Unfinity.java b/Mage.Sets/src/mage/sets/Unfinity.java index 5509b5a940..40be8a4684 100644 --- a/Mage.Sets/src/mage/sets/Unfinity.java +++ b/Mage.Sets/src/mage/sets/Unfinity.java @@ -26,6 +26,7 @@ public final class Unfinity extends ExpansionSet { cards.add(new SetCardInfo("Breeding Pool", 286, Rarity.RARE, mage.cards.b.BreedingPool.class)); cards.add(new SetCardInfo("Circuits Act", 103, Rarity.COMMON, mage.cards.c.CircuitsAct.class)); cards.add(new SetCardInfo("Clown Car", 186, Rarity.RARE, mage.cards.c.ClownCar.class)); + cards.add(new SetCardInfo("Dissatisfied Customer", 72, Rarity.COMMON, mage.cards.d.DissatisfiedCustomer.class)); cards.add(new SetCardInfo("Forest", 239, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Godless Shrine", 282, Rarity.RARE, mage.cards.g.GodlessShrine.class)); cards.add(new SetCardInfo("Hallowed Fountain", 277, Rarity.RARE, mage.cards.h.HallowedFountain.class));