diff --git a/Mage.Sets/src/mage/cards/m/MaskOfImmolation.java b/Mage.Sets/src/mage/cards/m/MaskOfImmolation.java new file mode 100644 index 00000000000..97688431cdd --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MaskOfImmolation.java @@ -0,0 +1,88 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.YoungPyromancerElementalToken; +import mage.players.Player; +import mage.target.common.TargetAnyTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MaskOfImmolation extends CardImpl { + + public MaskOfImmolation(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{R}"); + + this.subtype.add(SubType.EQUIPMENT); + + // When Mask of Immolation enters the battlefield, create a 1/1 red Elemental creature token, then attach Mask of Immolation to it. + this.addAbility(new EntersBattlefieldTriggeredAbility(new MaskOfImmolationEffect())); + + // Equipped creature has "Sacrifice this creature: It deals 1 damage to any target." + Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(1), new SacrificeSourceCost()); + ability.addTarget(new TargetAnyTarget()); + this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect( + ability, AttachmentType.EQUIPMENT + ).setText("Equipped creature has \"Sacrifice this creature: It deals 1 damage to any target.\""))); + + // Equip {2} + this.addAbility(new EquipAbility(2)); + } + + private MaskOfImmolation(final MaskOfImmolation card) { + super(card); + } + + @Override + public MaskOfImmolation copy() { + return new MaskOfImmolation(this); + } +} + +class MaskOfImmolationEffect extends CreateTokenEffect { + + MaskOfImmolationEffect() { + super(new YoungPyromancerElementalToken()); + staticText = "create a 1/1 red Elemental creature token, then attach {this} to it."; + } + + private MaskOfImmolationEffect(final MaskOfImmolationEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null || !super.apply(game, source)) { + return false; + } + Permanent p = game.getPermanent(this.getLastAddedTokenId()); + if (p == null) { + return false; + } + p.addAttachment(source.getSourceId(), game); + return true; + } + + @Override + public MaskOfImmolationEffect copy() { + return new MaskOfImmolationEffect(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WolfridersSaddle.java b/Mage.Sets/src/mage/cards/w/WolfridersSaddle.java index 7208ef24447..d01f70a9a7c 100644 --- a/Mage.Sets/src/mage/cards/w/WolfridersSaddle.java +++ b/Mage.Sets/src/mage/cards/w/WolfridersSaddle.java @@ -68,7 +68,7 @@ class WolfridersSaddleEffect extends CreateTokenEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null == !super.apply(game, source)) { + if (controller == null || !super.apply(game, source)) { return false; } Permanent p = game.getPermanent(this.getLastAddedTokenId()); diff --git a/Mage.Sets/src/mage/sets/CoreSet2020.java b/Mage.Sets/src/mage/sets/CoreSet2020.java index 13d07959234..e6879037adf 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2020.java +++ b/Mage.Sets/src/mage/sets/CoreSet2020.java @@ -100,6 +100,7 @@ public final class CoreSet2020 extends ExpansionSet { cards.add(new SetCardInfo("Loxodon Lifechanter", 27, Rarity.RARE, mage.cards.l.LoxodonLifechanter.class)); cards.add(new SetCardInfo("Loyal Pegasus", 28, Rarity.UNCOMMON, mage.cards.l.LoyalPegasus.class)); cards.add(new SetCardInfo("Manifold Key", 230, Rarity.UNCOMMON, mage.cards.m.ManifoldKey.class)); + cards.add(new SetCardInfo("Mask of Immolation", 151, Rarity.UNCOMMON, mage.cards.m.MaskOfImmolation.class)); cards.add(new SetCardInfo("Moat Piranhas", 67, Rarity.COMMON, mage.cards.m.MoatPiranhas.class)); cards.add(new SetCardInfo("Moldervine Reclamation", 214, Rarity.UNCOMMON, mage.cards.m.MoldervineReclamation.class)); cards.add(new SetCardInfo("Mu Yanling, Sky Dancer", 68, Rarity.MYTHIC, mage.cards.m.MuYanlingSkyDancer.class));