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

This commit is contained in:
Balázs Kristóf 2025-05-14 20:59:00 +02:00 committed by GitHub
parent 13e633f1ca
commit 9520a556c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 152 additions and 1 deletions

View file

@ -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";
}
}

View file

@ -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);
}
}

View file

@ -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));

View file

@ -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) {