mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-11 16:26:22 +00:00
Compare commits
2 Commits
52b21fa72f
...
cleaveKeyw
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08289bf6bd | ||
|
|
29c6bee1f2 |
@@ -1717,6 +1717,10 @@ public class AbilityUtils {
|
||||
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")) {
|
||||
return doXMath(calculateAmount(c, sq[sa.isFreerunning() ? 1 : 2], ctb), expr, c, ctb);
|
||||
}
|
||||
|
||||
@@ -3324,6 +3324,24 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITr
|
||||
// Pseudo keywords, only print Reminder
|
||||
sbBefore.append(inst.getReminderText());
|
||||
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")
|
||||
|| keyword.startsWith("Miracle") || keyword.startsWith("Recover")
|
||||
|| keyword.startsWith("Escape") || keyword.startsWith("Foretell:")
|
||||
|
||||
@@ -2852,6 +2852,23 @@ public class CardFactoryUtil {
|
||||
final SpellAbility sa = AbilityFactory.getAbility(sbClass.toString(), card);
|
||||
sa.setIntrinsic(intrinsic);
|
||||
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")) {
|
||||
final String[] k = keyword.split(":");
|
||||
final Cost dashCost = new Cost(k[1], false);
|
||||
|
||||
@@ -36,6 +36,7 @@ public enum Keyword {
|
||||
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."),
|
||||
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."),
|
||||
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."),
|
||||
|
||||
@@ -4,6 +4,7 @@ public enum AlternativeCost {
|
||||
Awaken,
|
||||
Bestow,
|
||||
Blitz,
|
||||
Cleave,
|
||||
Dash,
|
||||
Disturb,
|
||||
Emerge,
|
||||
|
||||
@@ -646,6 +646,10 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
||||
return isAlternativeCost(AlternativeCost.Blitz);
|
||||
}
|
||||
|
||||
public final boolean isCleave() {
|
||||
return isAlternativeCost(AlternativeCost.Cleave);
|
||||
}
|
||||
|
||||
public final boolean isDash() {
|
||||
return isAlternativeCost(AlternativeCost.Dash);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
Name:Lantern Flare
|
||||
ManaCost:1 W
|
||||
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.]
|
||||
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ Y
|
||||
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:DBGainLifeC:DB$ GainLife | Defined$ You | LifeAmount$ X
|
||||
K:Cleave:X R W
|
||||
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.]
|
||||
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ Z
|
||||
SVar:X:Count$xPaid
|
||||
SVar:Y:Count$Valid Creature.YouCtrl
|
||||
SVar:Z:Count$Cleave.X.Y
|
||||
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.]
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
Name:Winged Portent
|
||||
ManaCost:1 U U
|
||||
Types:Instant
|
||||
A:SP$ Draw | NumCards$ X | SpellDescription$ Draw a card for each creature [with flying] you control.
|
||||
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.)
|
||||
SVar:X:Count$Valid Creature.withFlying+YouCtrl
|
||||
SVar:Y:Count$Valid Creature.YouCtrl
|
||||
K:Cleave:4 G U
|
||||
A:SP$ Draw | NumCards$ Z | SpellDescription$ Draw a card for each creature [with flying] you control.
|
||||
SVar:X: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.
|
||||
|
||||
Reference in New Issue
Block a user