diff --git a/Mage.Sets/src/mage/cards/f/FaithboundJudge.java b/Mage.Sets/src/mage/cards/f/FaithboundJudge.java new file mode 100644 index 00000000000..be8df152ef3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FaithboundJudge.java @@ -0,0 +1,78 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalAsThoughEffect; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.*; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.counters.CounterType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FaithboundJudge extends CardImpl { + + private static final Condition condition1 = new SourceHasCounterCondition(CounterType.JUDGMENT, 0, 2); + private static final Condition condition2 = new SourceHasCounterCondition(CounterType.JUDGMENT, 3); + + public FaithboundJudge(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + + this.subtype.add(SubType.SPIRIT); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + this.secondSideCardClazz = mage.cards.s.SinnersJudgment.class; + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // At the beginning of your upkeep, if Faithbound Judge has two or fewer judgment counters on it, put a judgment counter on it. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility( + new AddCountersSourceEffect(CounterType.JUDGMENT.createInstance()), + TargetController.YOU, false + ), condition1, "At the beginning of your upkeep, if {this} has " + + "two or fewer judgment counters on it, put a judgment counter on it." + )); + + // As long as Faithbound Judge has three or more judgment counters on it, it can attack as though it didn't have defender. + this.addAbility(new SimpleStaticAbility(new ConditionalAsThoughEffect( + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), condition2 + ).setText("as long as {this} has three or more judgment counters on it," + + " it can attack as though it didn't have defender"))); + + // Disturb {5}{W}{W} + this.addAbility(new TransformAbility()); + this.addAbility(new DisturbAbility(new ManaCostsImpl<>("{5}{W}{W}"))); + } + + private FaithboundJudge(final FaithboundJudge card) { + super(card); + } + + @Override + public FaithboundJudge copy() { + return new FaithboundJudge(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SinnersJudgment.java b/Mage.Sets/src/mage/cards/s/SinnersJudgment.java new file mode 100644 index 00000000000..25d59e150e9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SinnersJudgment.java @@ -0,0 +1,96 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.PutIntoGraveFromAnywhereSourceAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SinnersJudgment extends CardImpl { + + public SinnersJudgment(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, ""); + + this.subtype.add(SubType.AURA); + this.subtype.add(SubType.CURSE); + this.color.setWhite(true); + this.nightCard = true; + + // Enchant player + TargetPlayer auraTarget = new TargetPlayer(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // At the beginning of your upkeep, put a judgment counter on Sinner's Judgment. Then if there are three or more judgment counters on it, enchanted player loses the game. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new SinnersJudgmentEffect(), TargetController.YOU, false + )); + + // If Sinner's Judgment would be put into a graveyard from anywhere, exile it instead. + this.addAbility(new PutIntoGraveFromAnywhereSourceAbility(new ExileSourceEffect().setText("exile it instead"))); + } + + private SinnersJudgment(final SinnersJudgment card) { + super(card); + } + + @Override + public SinnersJudgment copy() { + return new SinnersJudgment(this); + } +} + +class SinnersJudgmentEffect extends OneShotEffect { + + SinnersJudgmentEffect() { + super(Outcome.Benefit); + staticText = "put a judgment counter on {this}. Then if there are three " + + "or more judgment counters on it, enchanted player loses the game"; + } + + private SinnersJudgmentEffect(final SinnersJudgmentEffect effect) { + super(effect); + } + + @Override + public SinnersJudgmentEffect copy() { + return new SinnersJudgmentEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + if (permanent == null) { + return false; + } + permanent.addCounters(CounterType.JUDGMENT.createInstance(), source, game); + if (permanent.getCounters(game).getCount(CounterType.JUDGMENT) < 3) { + return true; + } + Player player = game.getPlayer(permanent.getAttachedTo()); + if (player != null) { + player.lost(game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index 5701f266eb6..edf05e0e961 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -111,6 +111,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("End the Festivities", 155, Rarity.COMMON, mage.cards.e.EndTheFestivities.class)); cards.add(new SetCardInfo("Estwald Shieldbasher", 11, Rarity.COMMON, mage.cards.e.EstwaldShieldbasher.class)); cards.add(new SetCardInfo("Evolving Wilds", 263, Rarity.COMMON, mage.cards.e.EvolvingWilds.class)); + cards.add(new SetCardInfo("Faithbound Judge", 12, Rarity.MYTHIC, mage.cards.f.FaithboundJudge.class)); cards.add(new SetCardInfo("Falkenrath Celebrants", 156, Rarity.COMMON, mage.cards.f.FalkenrathCelebrants.class)); cards.add(new SetCardInfo("Falkenrath Forebear", 111, Rarity.RARE, mage.cards.f.FalkenrathForebear.class)); cards.add(new SetCardInfo("Fear of Death", 59, Rarity.COMMON, mage.cards.f.FearOfDeath.class)); @@ -225,6 +226,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Sheltering Boughs", 218, Rarity.COMMON, mage.cards.s.ShelteringBoughs.class)); cards.add(new SetCardInfo("Sigarda's Imprisonment", 35, Rarity.COMMON, mage.cards.s.SigardasImprisonment.class)); cards.add(new SetCardInfo("Sigardian Paladin", 247, Rarity.UNCOMMON, mage.cards.s.SigardianPaladin.class)); + cards.add(new SetCardInfo("Sinner's Judgment", 12, Rarity.MYTHIC, mage.cards.s.SinnersJudgment.class)); cards.add(new SetCardInfo("Skywarp Skaab", 78, Rarity.COMMON, mage.cards.s.SkywarpSkaab.class)); cards.add(new SetCardInfo("Snarling Wolf", 219, Rarity.COMMON, mage.cards.s.SnarlingWolf.class)); cards.add(new SetCardInfo("Sorin the Mirthless", 131, Rarity.MYTHIC, mage.cards.s.SorinTheMirthless.class)); diff --git a/Mage/src/main/java/mage/counters/CounterType.java b/Mage/src/main/java/mage/counters/CounterType.java index a764ba0ac38..c611359adfc 100644 --- a/Mage/src/main/java/mage/counters/CounterType.java +++ b/Mage/src/main/java/mage/counters/CounterType.java @@ -95,6 +95,7 @@ public enum CounterType { INVITATION("invitation"), ISOLATION("isolation"), JAVELIN("javelin"), + JUDGMENT("judgment"), KNOWLEDGE("knowledge"), KI("ki"), LANDMARK("landmark"),