mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- 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:
@@ -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>.
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user