diff --git a/Mage.Sets/src/mage/cards/u/UnderworldFires.java b/Mage.Sets/src/mage/cards/u/UnderworldFires.java new file mode 100644 index 0000000000..51c04d4636 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UnderworldFires.java @@ -0,0 +1,38 @@ +package mage.cards.u; + +import java.util.UUID; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent; +import mage.watchers.common.DamagedByWatcher; + +/** + * + * @author LevelX2 + */ +public final class UnderworldFires extends CardImpl { + + public UnderworldFires(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}"); + + // Underworld Fires deals 1 damage to each creature and each planeswalker. + this.getSpellAbility().addEffect(new DamageAllEffect(1, + new FilterCreatureOrPlaneswalkerPermanent("creature and each planeswalker"))); + // If a permanent dealt damage this way would die this turn, exile it instead. + this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn)); + this.getSpellAbility().addWatcher(new DamagedByWatcher(false)); + } + + private UnderworldFires(final UnderworldFires card) { + super(card); + } + + @Override + public UnderworldFires copy() { + return new UnderworldFires(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WingsOfHubris.java b/Mage.Sets/src/mage/cards/w/WingsOfHubris.java new file mode 100644 index 0000000000..ba20b05135 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WingsOfHubris.java @@ -0,0 +1,96 @@ +package mage.cards.w; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public final class WingsOfHubris extends CardImpl { + + public WingsOfHubris(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + this.subtype.add(SubType.EQUIPMENT); + + // Equipped creature has flying. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.EQUIPMENT))); + + // Sacrifice Wings of Hubris: Equipped creature can't be blocked this turn. Sacrifice it at the beginning of the next end step. + this.addAbility(new SimpleActivatedAbility(new WingsOfHubrisEffect(), new SacrificeSourceCost())); + + // Equip {1} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1))); + } + + private WingsOfHubris(final WingsOfHubris card) { + super(card); + } + + @Override + public WingsOfHubris copy() { + return new WingsOfHubris(this); + } +} + +class WingsOfHubrisEffect extends OneShotEffect { + + public WingsOfHubrisEffect() { + super(Outcome.Detriment); + this.staticText = "Equipped creature can't be blocked this turn. Sacrifice it at the beginning of the next end step"; + } + + public WingsOfHubrisEffect(final WingsOfHubrisEffect effect) { + super(effect); + } + + @Override + public WingsOfHubrisEffect copy() { + return new WingsOfHubrisEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject equipment = game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + if (equipment instanceof Permanent && ((Permanent) equipment).getAttachedTo() != null) { + Permanent attachedToCreature = game.getPermanent(((Permanent) equipment).getAttachedTo()); + if (attachedToCreature != null) { + ContinuousEffect effect = new CantBeBlockedTargetEffect(Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(attachedToCreature, game)); + game.addEffect(effect, source); + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(attachedToCreature, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); + game.addDelayedTriggeredAbility(delayedAbility, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index f215e48f77..d84e1c5228 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -259,6 +259,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Underworld Breach", 161, Rarity.RARE, mage.cards.u.UnderworldBreach.class)); cards.add(new SetCardInfo("Underworld Charger", 120, Rarity.COMMON, mage.cards.u.UnderworldCharger.class)); cards.add(new SetCardInfo("Underworld Dreams", 121, Rarity.UNCOMMON, mage.cards.u.UnderworldDreams.class)); + cards.add(new SetCardInfo("Underworld Fires", 162, Rarity.UNCOMMON, mage.cards.u.UnderworldFires.class)); cards.add(new SetCardInfo("Underworld Rage-Hound", 163, Rarity.COMMON, mage.cards.u.UnderworldRageHound.class)); cards.add(new SetCardInfo("Underworld Sentinel", 293, Rarity.RARE, mage.cards.u.UnderworldSentinel.class)); cards.add(new SetCardInfo("Unknown Shores", 249, Rarity.COMMON, mage.cards.u.UnknownShores.class)); @@ -269,6 +270,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Warden of the Chained", 230, Rarity.UNCOMMON, mage.cards.w.WardenOfTheChained.class)); cards.add(new SetCardInfo("Wavebreak Hippocamp", 80, Rarity.RARE, mage.cards.w.WavebreakHippocamp.class)); cards.add(new SetCardInfo("Whirlwind Denial", 81, Rarity.UNCOMMON, mage.cards.w.WhirlwindDenial.class)); + cards.add(new SetCardInfo("Wings of Hubris", 241, Rarity.COMMON, mage.cards.w.WingsOfHubris.class)); cards.add(new SetCardInfo("Witness of Tomorrows", 82, Rarity.COMMON, mage.cards.w.WitnessOfTomorrows.class)); cards.add(new SetCardInfo("Woe Strider", 123, Rarity.RARE, mage.cards.w.WoeStrider.class)); cards.add(new SetCardInfo("Wolfwillow Haven", 205, Rarity.UNCOMMON, mage.cards.w.WolfwillowHaven.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java index 907aa371fe..1b6395382b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java @@ -102,7 +102,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl { } else { sb.append("gains "); } - sb.append('"' + ability.getRule("this creature") + '"'); + sb.append('"').append(ability.getRule("this creature")).append('"'); if (!duration.toString().isEmpty()) { sb.append(' ').append(duration.toString()); }