added the support to fix avatar of might...you can now do

otherrestriction=type(creature|mybattlefield)~lessthan~type(creature|opponentbattlefield)-3

which means, if the statement above is true you can play the card....if you subtract 3 from the amount the opponent has in creatures, and you are still less then the opponent...then that means he has atleast 4 more creatures than you do.

so right after the type(blah) you can add +number or -number...and it will modify the amount to compare.
This commit is contained in:
omegablast2002@yahoo.com
2011-07-08 10:47:28 +00:00
parent a3c22ddd32
commit dbbf5e4cb6
+9
View File
@@ -112,6 +112,7 @@ int MTGAbility::parseCastRestrictions(MTGCardInstance * card,Player * player,str
{
int firstAmount = 0;
int secondAmount = 0;
int mod=0;
string type;
vector<string> comparasion = split(restriction[i],'~');
if(comparasion.size() != 3)
@@ -133,10 +134,18 @@ int MTGAbility::parseCastRestrictions(MTGCardInstance * card,Player * player,str
type = comparasion[i].substr(found + 5, end - found - 5).c_str();
TargetChooserFactory tcf;
TargetChooser * ttc = tcf.createTargetChooser(type,card);
mod = atoi(comparasion[i].substr(end+1).c_str());
if(i == 2)
{
secondAmount = ttc->countValidTargets();
secondAmount += mod;
}
else
{
firstAmount = ttc->countValidTargets();
firstAmount += mod;
}
mod = 0;
SAFE_DELETE(ttc);
}
}