mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
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:
@@ -5,6 +5,7 @@ public class CardFactoryUtil
|
||||
{
|
||||
private static Random random = new Random();
|
||||
|
||||
// who uses this function?
|
||||
public final static String getPumpString(int n)
|
||||
{
|
||||
if(0 <= n)
|
||||
@@ -2518,7 +2519,6 @@ public class CardFactoryUtil
|
||||
if (sq[0].contains("CardToughness"))
|
||||
return doXMath(c.getNetDefense(), m);
|
||||
|
||||
|
||||
//Generic Zone-based counting
|
||||
// Count$QualityAndZones.Subquality
|
||||
|
||||
@@ -2711,6 +2711,21 @@ public class CardFactoryUtil
|
||||
}
|
||||
});
|
||||
|
||||
// 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();
|
||||
|
||||
return doXMath(n, m);
|
||||
@@ -2746,7 +2761,8 @@ public class CardFactoryUtil
|
||||
// not just the negative ones
|
||||
|
||||
String d[] = DB.split("/");
|
||||
int X;
|
||||
int X = 0;
|
||||
if (d.length > 0)
|
||||
if (d[1].contains("X"))
|
||||
{
|
||||
X = nDB;
|
||||
@@ -2771,9 +2787,13 @@ public class CardFactoryUtil
|
||||
else if (d[0].contains("Tgt"))
|
||||
dbPlayer = TgtP;
|
||||
|
||||
if (d[0].contains("Damage"))
|
||||
// 1/10
|
||||
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"))
|
||||
AllZone.GameAction.addLife(dbPlayer, X);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user