Compare commits

...

2 Commits

Author SHA1 Message Date
Hans Mackowiak
08289bf6bd next cleave card 2025-10-08 20:28:29 +02:00
Hans Mackowiak
29c6bee1f2 Cleave: turn it into a keyword 2025-10-08 07:37:44 +02:00
8 changed files with 54 additions and 8 deletions

View File

@@ -1717,6 +1717,10 @@ public class AbilityUtils {
return doXMath(calculateAmount(c, sq[sa.isBargained() ? 1 : 2], ctb), expr, c, ctb); return doXMath(calculateAmount(c, sq[sa.isBargained() ? 1 : 2], ctb), expr, c, ctb);
} }
if (sq[0].startsWith("Cleave")) {
return doXMath(calculateAmount(c, sq[sa.isCleave() ? 1 : 2], ctb), expr, c, ctb);
}
if (sq[0].startsWith("Freerunning")) { if (sq[0].startsWith("Freerunning")) {
return doXMath(calculateAmount(c, sq[sa.isFreerunning() ? 1 : 2], ctb), expr, c, ctb); return doXMath(calculateAmount(c, sq[sa.isFreerunning() ? 1 : 2], ctb), expr, c, ctb);
} }

View File

@@ -3324,6 +3324,24 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITr
// Pseudo keywords, only print Reminder // Pseudo keywords, only print Reminder
sbBefore.append(inst.getReminderText()); sbBefore.append(inst.getReminderText());
sbBefore.append("\r\n"); sbBefore.append("\r\n");
} else if (keyword.startsWith("Cleave")) {
final String[] k = keyword.split(":");
final Cost mCost;
if (k.length < 2 || "ManaCost".equals(k[1])) {
mCost = new Cost(getManaCost(), false);
} else {
mCost = new Cost(k[1], false);
}
StringBuilder sbCost = new StringBuilder(k[0]);
if (!mCost.isOnlyManaCost()) {
sbCost.append("");
} else {
sbCost.append(" ");
}
sbCost.append(mCost.toSimpleString());
sbBefore.append(sbCost).append(" (").append(inst.getReminderText()).append(")");
sbBefore.append("\r\n");
} else if (keyword.startsWith("Entwine") || keyword.startsWith("Madness") } else if (keyword.startsWith("Entwine") || keyword.startsWith("Madness")
|| keyword.startsWith("Miracle") || keyword.startsWith("Recover") || keyword.startsWith("Miracle") || keyword.startsWith("Recover")
|| keyword.startsWith("Escape") || keyword.startsWith("Foretell:") || keyword.startsWith("Escape") || keyword.startsWith("Foretell:")

View File

@@ -2852,6 +2852,23 @@ public class CardFactoryUtil {
final SpellAbility sa = AbilityFactory.getAbility(sbClass.toString(), card); final SpellAbility sa = AbilityFactory.getAbility(sbClass.toString(), card);
sa.setIntrinsic(intrinsic); sa.setIntrinsic(intrinsic);
inst.addSpellAbility(sa); inst.addSpellAbility(sa);
} else if (keyword.startsWith("Cleave")) {
final String[] k = keyword.split(":");
final Cost cost = new Cost(k[1], false);
final SpellAbility newSA = card.getFirstSpellAbility().copyWithDefinedCost(cost);
final StringBuilder desc = new StringBuilder();
desc.append("Cleave ").append(cost.toSimpleString()).append(" (");
desc.append(inst.getReminderText());
desc.append(")");
newSA.setDescription(desc.toString());
newSA.putParam("Secondary", "True");
newSA.setAlternativeCost(AlternativeCost.Cleave);
newSA.setIntrinsic(intrinsic);
inst.addSpellAbility(newSA);
} else if (keyword.startsWith("Dash")) { } else if (keyword.startsWith("Dash")) {
final String[] k = keyword.split(":"); final String[] k = keyword.split(":");
final Cost dashCost = new Cost(k[1], false); final Cost dashCost = new Cost(k[1], false);

View File

@@ -36,6 +36,7 @@ public enum Keyword {
CHANGELING("Changeling", SimpleKeyword.class, true, "This card is every creature type."), CHANGELING("Changeling", SimpleKeyword.class, true, "This card is every creature type."),
CHOOSE_A_BACKGROUND("Choose a Background", Partner.class, true, "You can have a Background as a second commander."), CHOOSE_A_BACKGROUND("Choose a Background", Partner.class, true, "You can have a Background as a second commander."),
CIPHER("Cipher", SimpleKeyword.class, true, "Then you may exile this spell card encoded on a creature you control. Whenever that creature deals combat damage to a player, its controller may cast a copy of the encoded card without paying its mana cost."), CIPHER("Cipher", SimpleKeyword.class, true, "Then you may exile this spell card encoded on a creature you control. Whenever that creature deals combat damage to a player, its controller may cast a copy of the encoded card without paying its mana cost."),
CLEAVE("Cleave", KeywordWithCost.class, false, "You may cast this spell for its cleave cost. If you do, remove the words in square brackets."),
COMPANION("Companion", Companion.class, true, "Reveal your companion from outside the game if your deck meets the companion restriction."), COMPANION("Companion", Companion.class, true, "Reveal your companion from outside the game if your deck meets the companion restriction."),
COMPLEATED("Compleated", SimpleKeyword.class, true, "This planeswalker enters with two fewer loyalty counters for each Phyrexian mana symbol life was paid for."), COMPLEATED("Compleated", SimpleKeyword.class, true, "This planeswalker enters with two fewer loyalty counters for each Phyrexian mana symbol life was paid for."),
CONSPIRE("Conspire", SimpleKeyword.class, false, "As an additional cost to cast this spell, you may tap two untapped creatures you control that each share a color with it. If you do, copy it."), CONSPIRE("Conspire", SimpleKeyword.class, false, "As an additional cost to cast this spell, you may tap two untapped creatures you control that each share a color with it. If you do, copy it."),

View File

@@ -4,6 +4,7 @@ public enum AlternativeCost {
Awaken, Awaken,
Bestow, Bestow,
Blitz, Blitz,
Cleave,
Dash, Dash,
Disturb, Disturb,
Emerge, Emerge,

View File

@@ -646,6 +646,10 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
return isAlternativeCost(AlternativeCost.Blitz); return isAlternativeCost(AlternativeCost.Blitz);
} }
public final boolean isCleave() {
return isAlternativeCost(AlternativeCost.Cleave);
}
public final boolean isDash() { public final boolean isDash() {
return isAlternativeCost(AlternativeCost.Dash); return isAlternativeCost(AlternativeCost.Dash);
} }

View File

@@ -1,11 +1,11 @@
Name:Lantern Flare Name:Lantern Flare
ManaCost:1 W ManaCost:1 W
Types:Instant Types:Instant
A:SP$ DealDamage | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker | NumDmg$ Y | SubAbility$ DBGainLife | SpellDescription$ CARDNAME deals X damage to target creature or planeswalker and you gain X life. [X is the number of creatures you control.] K:Cleave:X R W
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ Y A:SP$ DealDamage | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker | NumDmg$ Z | SubAbility$ DBGainLife | SpellDescription$ CARDNAME deals X damage to target creature or planeswalker and you gain X life. [X is the number of creatures you control.]
A:SP$ DealDamage | Cost$ X R W | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker | NumDmg$ X | PrecostDesc$ Cleave | SubAbility$ DBGainLifeC | CostDesc$ {X}{R}{W} | NonBasicSpell$ True | SpellDescription$ (You may cast this spell for its cleave cost. If you do, remove the words in square brackets.) SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ Z
SVar:DBGainLifeC:DB$ GainLife | Defined$ You | LifeAmount$ X
SVar:X:Count$xPaid SVar:X:Count$xPaid
SVar:Y:Count$Valid Creature.YouCtrl SVar:Y:Count$Valid Creature.YouCtrl
SVar:Z:Count$Cleave.X.Y
DeckHas:Ability$LifeGain DeckHas:Ability$LifeGain
Oracle:Cleave {X}{R}{W} (You may cast this spell for its cleave cost. If you do, remove the words in square brackets.)\nLantern Flare deals X damage to target creature or planeswalker and you gain X life. [X is the number of creatures you control.] Oracle:Cleave {X}{R}{W} (You may cast this spell for its cleave cost. If you do, remove the words in square brackets.)\nLantern Flare deals X damage to target creature or planeswalker and you gain X life. [X is the number of creatures you control.]

View File

@@ -1,8 +1,9 @@
Name:Winged Portent Name:Winged Portent
ManaCost:1 U U ManaCost:1 U U
Types:Instant Types:Instant
A:SP$ Draw | NumCards$ X | SpellDescription$ Draw a card for each creature [with flying] you control. K:Cleave:4 G U
A:SP$ Draw | Cost$ 4 G U | NumCards$ Y | PrecostDesc$ Cleave | CostDesc$ {4}{G}{U} | NonBasicSpell$ True | SpellDescription$ (You may cast this spell for its cleave cost. If you do, remove the words in square brackets.) A:SP$ Draw | NumCards$ Z | SpellDescription$ Draw a card for each creature [with flying] you control.
SVar:X:Count$Valid Creature.withFlying+YouCtrl SVar:X:Count$Valid Creature.YouCtrl
SVar:Y:Count$Valid Creature.YouCtrl SVar:Y:Count$Valid Creature.withFlying+YouCtrl
SVar:Z:Count$Cleave.X.Y
Oracle:Cleave {4}{G}{U} (You may cast this spell for its cleave cost. If you do, remove the words in square brackets.)\nDraw a card for each creature [with flying] you control. Oracle:Cleave {4}{G}{U} (You may cast this spell for its cleave cost. If you do, remove the words in square brackets.)\nDraw a card for each creature [with flying] you control.