In preparation for enhanced spPumpTgt spells, the following were added:

xCount(): MaxCMC - given a player zone, returns the highest Converted Mana Cost.
doDrawBack(): DamageTgtC - deals damage to the targeted creature.
This commit is contained in:
jendave
2011-08-06 03:15:41 +00:00
parent 221255765c
commit f3383fa8c4

View File

@@ -5,6 +5,7 @@ public class CardFactoryUtil
{ {
private static Random random = new Random(); private static Random random = new Random();
// who uses this function?
public final static String getPumpString(int n) public final static String getPumpString(int n)
{ {
if(0 <= n) if(0 <= n)
@@ -2518,7 +2519,6 @@ public class CardFactoryUtil
if (sq[0].contains("CardToughness")) if (sq[0].contains("CardToughness"))
return doXMath(c.getNetDefense(), m); return doXMath(c.getNetDefense(), m);
//Generic Zone-based counting //Generic Zone-based counting
// Count$QualityAndZones.Subquality // Count$QualityAndZones.Subquality
@@ -2710,7 +2710,22 @@ public class CardFactoryUtil
return (CardUtil.getColors(c).size() == 1); return (CardUtil.getColors(c).size() == 1);
} }
}); });
// 1/10 - Count$MaxCMCYouCtrl
if (sq[0].contains("MaxCMC"))
{
int mmc = 0;
int cmc = 0;
for (int i=0;i<someCards.size();i++)
{
cmc = CardUtil.getConvertedManaCost(someCards.getCard(i).getManaCost());
if (cmc > mmc)
mmc = cmc;
}
return doXMath(mmc, m);
}
n = someCards.size(); n = someCards.size();
return doXMath(n, m); return doXMath(n, m);
@@ -2746,22 +2761,23 @@ public class CardFactoryUtil
// not just the negative ones // not just the negative ones
String d[] = DB.split("/"); String d[] = DB.split("/");
int X; int X = 0;
if (d[1].contains("X")) if (d.length > 0)
{ if (d[1].contains("X"))
X = nDB; {
if (d[1].contains(".")) X = nDB;
{ if (d[1].contains("."))
String dd[] = d[1].split("\\."); {
ArrayList<String> ddd = new ArrayList<String>(); String dd[] = d[1].split("\\.");
for (int i=1; i<dd.length; i++) ArrayList<String> ddd = new ArrayList<String>();
ddd.add(dd[i]); for (int i=1; i<dd.length; i++)
ddd.add(dd[i]);
X = doXMath(X, ddd.toArray(new String [3]));
} X = doXMath(X, ddd.toArray(new String [3]));
} }
else }
X = Integer.parseInt(d[1]); else
X = Integer.parseInt(d[1]);
String dbPlayer = ""; String dbPlayer = "";
if (d[0].contains("You")) if (d[0].contains("You"))
@@ -2770,9 +2786,13 @@ public class CardFactoryUtil
dbPlayer = Opp; dbPlayer = Opp;
else if (d[0].contains("Tgt")) else if (d[0].contains("Tgt"))
dbPlayer = TgtP; dbPlayer = TgtP;
if (d[0].contains("Damage")) // 1/10
AllZone.GameAction.addDamage(dbPlayer, X); if (d[0].contains("DamageTgtC"))
AllZone.GameAction.addDamage(TgtC, Src, X);
else if (d[0].contains("Damage"))
AllZone.GameAction.addDamage(dbPlayer, X);
if (d[0].contains("GainLife")) if (d[0].contains("GainLife"))
AllZone.GameAction.addLife(dbPlayer, X); AllZone.GameAction.addLife(dbPlayer, X);