Skip to content

[FIN] Implement Cecil, Dark Knight / Cecil, Redeemed Paladin #13445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions Mage.Sets/src/mage/cards/c/CecilDarkKnight.java
Original file line number Diff line number Diff line change
@@ -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";
}
}
52 changes: 52 additions & 0 deletions Mage.Sets/src/mage/cards/c/CecilRedeemedPaladin.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
8 changes: 8 additions & 0 deletions Mage.Sets/src/mage/sets/FinalFantasy.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ private FinalFantasy() {
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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
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) {
Expand Down