- Added a way to count specific colors of mana spent on X (Count$XColorPaid followed by a list of colors in one-letter abbreviation format e.g. Count$XColorPaid WUG).

- Added Soul Burn.
This commit is contained in:
Agetian
2014-02-18 13:55:15 +00:00
parent 878c037554
commit e52e154774
6 changed files with 83 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -11462,6 +11462,7 @@ forge-gui/res/cardsfolder/s/sosuke_son_of_seshiro.txt svneol=native#text/plain
forge-gui/res/cardsfolder/s/sosukes_summons.txt svneol=native#text/plain
forge-gui/res/cardsfolder/s/soul_barrier.txt svneol=native#text/plain
forge-gui/res/cardsfolder/s/soul_bleed.txt svneol=native#text/plain
forge-gui/res/cardsfolder/s/soul_burn.txt -text
forge-gui/res/cardsfolder/s/soul_channeling.txt svneol=native#text/plain
forge-gui/res/cardsfolder/s/soul_charmer.txt svneol=native#text/plain
forge-gui/res/cardsfolder/s/soul_collector.txt svneol=native#text/plain

View File

@@ -38,6 +38,7 @@ import forge.game.cost.Cost;
import forge.game.event.*;
import forge.game.event.GameEventCardAttachment.AttachMethod;
import forge.game.event.GameEventCardDamaged.DamageType;
import forge.game.mana.Mana;
import forge.game.player.Player;
import forge.game.replacement.ReplaceMoved;
import forge.game.replacement.ReplacementEffect;
@@ -181,6 +182,7 @@ public class Card extends GameEntity implements Comparable<Card> {
private int semiPermanentDefenseBoost = 0;
private int xManaCostPaid = 0;
private ArrayList<Mana> xManaCostPaidByColor = new ArrayList<>();
private int sunburstValue = 0;
private byte colorsPaid = 0;
@@ -869,6 +871,60 @@ public class Card extends GameEntity implements Comparable<Card> {
this.xManaCostPaid = n;
}
/**
* <p>
* Getter for the field <code>xManaCostPaidByColor</code>.
* </p>
*
* @return a int.
*/
public final ArrayList<Mana> getXManaCostPaidByColor() {
return this.xManaCostPaidByColor;
}
/**
* <p>
* Getter for the field <code>xManaCostPaidByColor</code>.
* </p>
*
* @return a int.
*/
public final int getXManaCostPaidCount(final String colors) {
int count = 0;
for (Mana m : this.xManaCostPaidByColor) {
if (colors.contains(m.toString())) {
count++;
}
}
return count;
}
/**
* <p>
* Setter or the field <code>xManaCostPaidByColor</code>.
* </p>
*
* @param n
* a int.
*/
public final void setXManaCostPaidByColor(final ArrayList<Mana> xByColor) {
this.xManaCostPaidByColor = xByColor;
}
/**
* <p>
* addXManaCostPaidByColor.
* </p>
*
* @param xByColor
* an ArrayList<Mana>.
*/
public final void addXManaCostPaidByColor(final ArrayList<Mana> xByColor) {
this.xManaCostPaidByColor.addAll(xByColor);
}
/**
* <p>
* Getter for the field <code>xManaCostPaid</code>.

View File

@@ -223,6 +223,7 @@ public class CardFactory {
if (bCopyDetails) {
c.addXManaCostPaid(original.getXManaCostPaid());
c.addXManaCostPaidByColor(original.getXManaCostPaidByColor());
c.setKickerMagnitude(original.getKickerMagnitude());
for (OptionalCost cost : original.getOptionalCostsPaid()) {

View File

@@ -56,6 +56,7 @@ import forge.game.zone.Zone;
import forge.game.zone.ZoneType;
import forge.util.Aggregates;
import forge.util.Lang;
import forge.util.TextUtil;
import org.apache.commons.lang3.StringUtils;
import java.util.*;
@@ -975,6 +976,14 @@ public class CardFactoryUtil {
sq = l[0].split("\\.");
if (sq[0].contains("xPaid")) return doXMath(c.getXManaCostPaid(), m, c);
if (sq[0].contains("xColorPaid")) {
String[] attrs = TextUtil.split(sq[0], ' ');
String colors = "";
for (int i = 1; i < attrs.length; i++) {
colors += attrs[i];
}
return doXMath(c.getXManaCostPaidCount(colors), m, c);
}
if (sq[0].equals("YouDrewThisTurn")) return doXMath(c.getController().getNumDrawnThisTurn(), m, c);

View File

@@ -0,0 +1,12 @@
Name:Soul Burn
ManaCost:X 2 B
Types:Sorcery
A:SP$ StoreSVar | Cost$ X 2 B | XColor$ BR | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | SVar$ Limit | Type$ Targeted | Expression$ CardToughness | SubAbility$ StoreTgtP | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature | ConditionCompare$ GE1 | SpellDescription$ Spend only black and/or red mana on X. CARDNAME deals X damage to target creature or player. You gain life equal to the damage dealt, but not more than the amount of {B} spent on X, the player's life total before Soul Burn dealt damage, or the creature's toughness.
SVar:StoreTgtP:DB$ StoreSVar | SVar$ Limit | Type$ Count | Expression$ TargetedLifeTotal | SubAbility$ DBDamage | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature | ConditionCompare$ EQ0
SVar:DBDamage:DB$ DealDamage | Defined$ Targeted | NumDmg$ X | SubAbility$ DBGainLife | References$ X
SVar:X:Count$xPaid
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ DrainedLifeCard | References$ DrainedLifeCard
SVar:DrainedLifeCard:SVar$BlackManaPaid/LimitMax.Limit
SVar:Limit:Count$xPaid
SVar:BlackManaPaid:Count$xColorPaid B
Oracle:Spend only black and/or red mana on X.\nSoul Burn deals X damage to target creature or player. You gain life equal to the damage dealt, but not more than the amount of {B} spent on X, the player's life total before Soul Burn dealt damage, or the creature's toughness.

View File

@@ -4,6 +4,7 @@ import forge.card.ColorSet;
import forge.card.mana.ManaCost;
import forge.card.mana.ManaCostParser;
import forge.game.card.Card;
import forge.game.mana.Mana;
import forge.game.mana.ManaCostBeingPaid;
import forge.game.spellability.SpellAbility;
import forge.view.ButtonUtil;
@@ -16,6 +17,7 @@ import java.util.List;
public class InputPayManaX extends InputPayMana {
private static final long serialVersionUID = -6900234444347364050L;
private int xPaid = 0;
private ArrayList<Mana> xPaidByColor = new ArrayList<>();
private byte colorsPaid;
private final ManaCost manaCostPerX;
private final boolean xCanBe0;
@@ -101,6 +103,7 @@ public class InputPayManaX extends InputPayMana {
this.colorsPaid |= manaCost.getColorsPaid();
this.manaCost = new ManaCostBeingPaid(manaCostPerX);
this.xPaid++;
this.xPaidByColor.add(saPaidFor.getPayingMana().get(0));
}
}
@@ -121,6 +124,7 @@ public class InputPayManaX extends InputPayMana {
protected void done() {
final Card card = saPaidFor.getHostCard();
card.setXManaCostPaid(this.xPaid);
card.setXManaCostPaidByColor(this.xPaidByColor);
card.setColorsPaid(this.colorsPaid);
card.setSunburstValue(ColorSet.fromMask(this.colorsPaid).countColors());
}