diff --git a/Mage.Sets/src/mage/cards/l/LovestruckBeast.java b/Mage.Sets/src/mage/cards/l/LovestruckBeast.java new file mode 100644 index 00000000000..9114fa4e739 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LovestruckBeast.java @@ -0,0 +1,88 @@ +package mage.cards.l; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.AdventureCard; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.mageobject.ToughnessPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.HumanToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class LovestruckBeast extends AdventureCard { + + public LovestruckBeast(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.SORCERY}, "{2}{G}", "{G}"); + + this.subtype.add(SubType.BEAST); + this.subtype.add(SubType.NOBLE); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Lovestruck Beast can't attack unless you control a 1/1 creature. + this.addAbility(new SimpleStaticAbility(new LovestruckBeastEffect())); + + // Heart's Desire + // Create a 1/1 white Human creature token. + this.getAdventureSpellAbility().addEffect(new CreateTokenEffect(new HumanToken())); + } + + private LovestruckBeast(final LovestruckBeast card) { + super(card); + } + + @Override + public LovestruckBeast copy() { + return new LovestruckBeast(this); + } +} + +class LovestruckBeastEffect extends RestrictionEffect { + + private static final FilterPermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(new PowerPredicate(ComparisonType.EQUAL_TO, 1)); + filter.add(new ToughnessPredicate(ComparisonType.EQUAL_TO, 1)); + } + + LovestruckBeastEffect() { + super(Duration.WhileOnBattlefield); + staticText = "{this} can't attack unless you control a 1/1 creature"; + } + + private LovestruckBeastEffect(final LovestruckBeastEffect effect) { + super(effect); + } + + @Override + public LovestruckBeastEffect copy() { + return new LovestruckBeastEffect(this); + } + + @Override + public boolean canAttack(Game game, boolean canUseChooseDialogs) { + return false; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getId().equals(source.getSourceId()) + && game.getBattlefield().countAll(filter, source.getControllerId(), game) <= 0; + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index 8653f9c50fa..b0c7bb99f30 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -51,6 +51,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Golden Egg", 220, Rarity.COMMON, mage.cards.g.GoldenEgg.class)); cards.add(new SetCardInfo("Heraldic Banner", 222, Rarity.UNCOMMON, mage.cards.h.HeraldicBanner.class)); cards.add(new SetCardInfo("Inspiring Veteran", 194, Rarity.UNCOMMON, mage.cards.i.InspiringVeteran.class)); + cards.add(new SetCardInfo("Lovestruck Beast", 165, Rarity.RARE, mage.cards.l.LovestruckBeast.class)); cards.add(new SetCardInfo("Maraleaf Pixie", 196, Rarity.UNCOMMON, mage.cards.m.MaraleafPixie.class)); cards.add(new SetCardInfo("Order of Midnight", 99, Rarity.UNCOMMON, mage.cards.o.OrderOfMidnight.class)); cards.add(new SetCardInfo("Rankle, Master of Pranks", 101, Rarity.MYTHIC, mage.cards.r.RankleMasterOfPranks.class)); diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index a917fb171fc..0310341a25c 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -240,6 +240,7 @@ public enum SubType { NIGHTMARE("Nightmare", SubTypeSet.CreatureType), NIGHTSTALKER("Nightstalker", SubTypeSet.CreatureType), NINJA("Ninja", SubTypeSet.CreatureType), + NOBLE("Noble", SubTypeSet.CreatureType), NOGGLE("Noggle", SubTypeSet.CreatureType), NOMAD("Nomad", SubTypeSet.CreatureType), NYMPH("Nymph", SubTypeSet.CreatureType),