diff --git a/Mage.Sets/src/mage/cards/j/JoyfulStormsculptor.java b/Mage.Sets/src/mage/cards/j/JoyfulStormsculptor.java new file mode 100644 index 0000000000..3800de5149 --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JoyfulStormsculptor.java @@ -0,0 +1,65 @@ +package mage.cards.j; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.ProtectedByOpponentPredicate; +import mage.game.permanent.token.Elemental11BlueRedToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class JoyfulStormsculptor extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a spell that has convoke"); + private static final FilterPermanent filter2 = new FilterPermanent(); + + static { + filter.add(new AbilityPredicate(ConvokeAbility.class)); + filter2.add(CardType.BATTLE.getPredicate()); + filter2.add(ProtectedByOpponentPredicate.instance); + } + + public JoyfulStormsculptor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{R}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // When Joyful Stormsculptor enters the battlefield, create two 1/1 blue and red Elemental creature tokens. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new Elemental11BlueRedToken(), 2))); + + // Whenever you cast a spell that has convoke, Joyful Stormsculptor deals 1 damage to each opponent and each battle they protect. + Ability ability = new SpellCastControllerTriggeredAbility( + new DamagePlayersEffect(1, TargetController.OPPONENT), filter, false + ); + ability.addEffect(new DamageAllEffect(1, filter2).setText("and each battle they protect")); + this.addAbility(ability); + } + + private JoyfulStormsculptor(final JoyfulStormsculptor card) { + super(card); + } + + @Override + public JoyfulStormsculptor copy() { + return new JoyfulStormsculptor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 1892c55f10..59ab36d0f5 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -61,6 +61,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Interdisciplinary Mascot", 326, Rarity.RARE, mage.cards.i.InterdisciplinaryMascot.class)); cards.add(new SetCardInfo("Into the Fire", 144, Rarity.RARE, mage.cards.i.IntoTheFire.class)); cards.add(new SetCardInfo("Island", 278, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Joyful Stormsculptor", 243, Rarity.UNCOMMON, mage.cards.j.JoyfulStormsculptor.class)); cards.add(new SetCardInfo("Jungle Hollow", 270, Rarity.COMMON, mage.cards.j.JungleHollow.class)); cards.add(new SetCardInfo("Merciless Repurposing", 117, Rarity.UNCOMMON, mage.cards.m.MercilessRepurposing.class)); cards.add(new SetCardInfo("Monastery Mentor", 28, Rarity.MYTHIC, mage.cards.m.MonasteryMentor.class)); diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/ProtectedByOpponentPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/ProtectedByOpponentPredicate.java new file mode 100644 index 0000000000..dbc2bd2856 --- /dev/null +++ b/Mage/src/main/java/mage/filter/predicate/permanent/ProtectedByOpponentPredicate.java @@ -0,0 +1,19 @@ +package mage.filter.predicate.permanent; + +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * @author TheElk801 + */ +public enum ProtectedByOpponentPredicate implements ObjectSourcePlayerPredicate { + instance; + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + // TODO: Implement this + return false; + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/Elemental11BlueRedToken.java b/Mage/src/main/java/mage/game/permanent/token/Elemental11BlueRedToken.java new file mode 100644 index 0000000000..305069ce14 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/Elemental11BlueRedToken.java @@ -0,0 +1,33 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.Arrays; + +/** + * @author TheElk801 + */ +public final class Elemental11BlueRedToken extends TokenImpl { + + public Elemental11BlueRedToken() { + super("Elemental Token", "1/1 blue and red Elemental creature token"); + cardType.add(CardType.CREATURE); + subtype.add(SubType.ELEMENTAL); + color.setBlue(true); + color.setRed(true); + power = new MageInt(1); + toughness = new MageInt(1); + + availableImageSetCodes = Arrays.asList("MOM"); + } + + public Elemental11BlueRedToken(final Elemental11BlueRedToken token) { + super(token); + } + + public Elemental11BlueRedToken copy() { + return new Elemental11BlueRedToken(this); + } +}