diff --git a/Mage.Sets/src/mage/cards/c/CecilDarkKnight.java b/Mage.Sets/src/mage/cards/c/CecilDarkKnight.java new file mode 100644 index 00000000000..846f09e9950 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CecilDarkKnight.java @@ -0,0 +1,87 @@ +package mage.cards.c; + +import java.util.Optional; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.game.Controllable; +import mage.game.Game; +import mage.players.Player; +import mage.abilities.Ability; +import mage.abilities.common.DealsDamageSourceTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.LessThanHalfStartingLifeTotalCondition; +import mage.abilities.dynamicvalue.common.SavedDamageValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; + +/** + * @author balazskristof + */ +public final class CecilDarkKnight extends CardImpl { + + public CecilDarkKnight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + this.secondSideCardClazz = mage.cards.c.CecilRedeemedPaladin.class; + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Darkness -- Whenever Cecil deals damage, you lose that much life. Then if your life total is less than or equal to half your starting life total, untap Cecil and transform it. + this.addAbility(new TransformAbility()); + Ability ability = new DealsDamageSourceTriggeredAbility(new LoseLifeSourceControllerEffect(SavedDamageValue.MUCH), false).withFlavorWord("Darkness"); + ability.addEffect(new ConditionalOneShotEffect( + new UntapSourceEffect(), + CecilDarkKnightCondition.instance + ).addEffect( + (OneShotEffect) new TransformSourceEffect(true).concatBy("and") + ).concatBy("Then")); + this.addAbility(ability); + } + + private CecilDarkKnight(final CecilDarkKnight card) { + super(card); + } + + @Override + public CecilDarkKnight copy() { + return new CecilDarkKnight(this); + } +} + +enum CecilDarkKnightCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return Optional + .ofNullable(source) + .map(Controllable::getControllerId) + .map(game::getPlayer) + .map(Player::getLife) + .map(life -> life <= game.getStartingLife() / 2) + .orElse(false); + } + + @Override + public String toString() { + return "your life total is less than or equal to half your starting life total"; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/c/CecilRedeemedPaladin.java b/Mage.Sets/src/mage/cards/c/CecilRedeemedPaladin.java new file mode 100644 index 00000000000..2e6f4f4999c --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CecilRedeemedPaladin.java @@ -0,0 +1,52 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.StaticFilters; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; + +/** + * @author balazskristof + */ +public final class CecilRedeemedPaladin extends CardImpl { + + public CecilRedeemedPaladin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, ""); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + this.color.setWhite(true); + this.nightCard = true; + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // Protect -- Whenever Cecil attacks, other attacking creatures gain indestructible until end of turn. + this.addAbility(new AttacksTriggeredAbility(new GainAbilityAllEffect( + IndestructibleAbility.getInstance(), Duration.EndOfTurn, + StaticFilters.FILTER_ATTACKING_CREATURES, true + )).withFlavorWord("Protect")); + } + + private CecilRedeemedPaladin(final CecilRedeemedPaladin card) { + super(card); + } + + @Override + public CecilRedeemedPaladin copy() { + return new CecilRedeemedPaladin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/FinalFantasy.java b/Mage.Sets/src/mage/sets/FinalFantasy.java index 864f27b3e23..2bf5b7959e3 100644 --- a/Mage.Sets/src/mage/sets/FinalFantasy.java +++ b/Mage.Sets/src/mage/sets/FinalFantasy.java @@ -41,6 +41,14 @@ public final class FinalFantasy extends ExpansionSet { cards.add(new SetCardInfo("Beatrix, Loyal General", 426, Rarity.RARE, mage.cards.b.BeatrixLoyalGeneral.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Beatrix, Loyal General", 554, Rarity.RARE, mage.cards.b.BeatrixLoyalGeneral.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Black Mage's Rod", 90, Rarity.COMMON, mage.cards.b.BlackMagesRod.class)); + cards.add(new SetCardInfo("Cecil, Dark Knight", 91, Rarity.RARE, mage.cards.c.CecilDarkKnight.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Cecil, Dark Knight", 380, Rarity.RARE, mage.cards.c.CecilDarkKnight.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Cecil, Dark Knight", 445, Rarity.RARE, mage.cards.c.CecilDarkKnight.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Cecil, Dark Knight", 525, Rarity.RARE, mage.cards.c.CecilDarkKnight.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Cecil, Redeemed Paladin", 91, Rarity.RARE, mage.cards.c.CecilRedeemedPaladin.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Cecil, Redeemed Paladin", 380, Rarity.RARE, mage.cards.c.CecilRedeemedPaladin.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Cecil, Redeemed Paladin", 445, Rarity.RARE, mage.cards.c.CecilRedeemedPaladin.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Cecil, Redeemed Paladin", 525, Rarity.RARE, mage.cards.c.CecilRedeemedPaladin.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Chaos, the Endless", 221, Rarity.UNCOMMON, mage.cards.c.ChaosTheEndless.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Chaos, the Endless", 486, Rarity.UNCOMMON, mage.cards.c.ChaosTheEndless.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Cid, Timeless Artificer", 216, Rarity.UNCOMMON, mage.cards.c.CidTimelessArtificer.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/TransformSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/TransformSourceEffect.java index 770ac3ae306..7d34ff2f7d5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/TransformSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/TransformSourceEffect.java @@ -12,8 +12,12 @@ import mage.game.permanent.Permanent; public class TransformSourceEffect extends OneShotEffect { public TransformSourceEffect() { + this(false); + } + + public TransformSourceEffect(boolean it) { super(Outcome.Transform); - staticText = "transform {this}"; + staticText = "transform " + (it ? "it" : "{this}"); } protected TransformSourceEffect(final TransformSourceEffect effect) {