add manapool count

also add getStringValue for menutext
This commit is contained in:
Anthony Calosa
2016-08-25 00:17:16 +08:00
parent a90cddf589
commit 1cd6f00c59
2 changed files with 61 additions and 0 deletions

View File

@@ -726,6 +726,14 @@ private:
{//this is just to count the number of snow mana produced ... just for debugging purposes...
intValue = target->controller()->snowManaG + target->controller()->snowManaU +target->controller()->snowManaR + target->controller()->snowManaB + target->controller()->snowManaW + target->controller()->snowManaC;
}
else if (s == "mypoolcount")
{//manapool
intValue = target->controller()->getManaPool()->getConvertedCost();
}
else if (s == "opponentpoolcount")
{//manapool opponent
intValue = target->controller()->opponent()->getManaPool()->getConvertedCost();
}
else if (s == "p" || s == "power")
{
intValue = target->getCurrentPower();
@@ -1133,6 +1141,13 @@ public:
{
return intValue;
}
string getStringValue()
{
stringstream sval;
sval << intValue;
return sval.str();
}
};
class WParsedPT

View File

@@ -1103,7 +1103,20 @@ AADamager::AADamager(GameObserver* observer, int _id, MTGCardInstance * _source,
if(_target && _target->hasType(Subtypes::TYPE_PLANESWALKER))
return _target->name.c_str();
if(redirected)
{
if(d.size())
{
WParsedInt parsedNum(d, NULL, source);
return _("Deal " + parsedNum.getStringValue() + " Damage to Player").c_str();
}
return "Damage Player";
}
if(d.size())
{
WParsedInt parsedNum(d, NULL, source);
return _("Deal " + parsedNum.getStringValue() + " Damage").c_str();
}
return "Damage";
}
@@ -1250,7 +1263,20 @@ AADepleter::AADepleter(GameObserver* observer, int _id, MTGCardInstance * card,
const string AADepleter::getMenuText()
{
if(toexile)
{
if(nbcardsStr.size())
{
WParsedInt parsedNum(nbcardsStr, NULL, source);
return _("Ingest " + parsedNum.getStringValue()).c_str();
}
return "Ingest";
}
if(nbcardsStr.size())
{
WParsedInt parsedNum(nbcardsStr, NULL, source);
return _("Deplete " + parsedNum.getStringValue()).c_str();
}
return "Deplete";
}
@@ -2934,6 +2960,11 @@ AADrawer::AADrawer(GameObserver* observer, int _id, MTGCardInstance * card, Targ
const string AADrawer::getMenuText()
{
if(nbcardsStr.size())
{
WParsedInt parsedNum(nbcardsStr, NULL, source);
return _("Draw " + parsedNum.getStringValue()).c_str();
}
return "Draw";
}
@@ -4492,6 +4523,11 @@ int AARandomDiscarder::resolve()
const string AARandomDiscarder::getMenuText()
{
if(nbcardsStr.size())
{
WParsedInt parsedNum(nbcardsStr, NULL, source);
return _("Discard " + parsedNum.getStringValue() + " at random").c_str();
}
return "Discard Random";
}
@@ -6803,6 +6839,11 @@ int AAttackSetCost::destroy()
const string AAttackSetCost::getMenuText()
{
if(number.size())
{
WParsedInt parsedNum(number, NULL, source);
return _("Pay " + parsedNum.getStringValue() + " to attack").c_str();
}
return "Attack Cost";
}
@@ -6847,6 +6888,11 @@ int ABlockSetCost::destroy()
const string ABlockSetCost::getMenuText()
{
if(number.size())
{
WParsedInt parsedNum(number, NULL, source);
return _("Pay " + parsedNum.getStringValue() + " to block").c_str();
}
return "Block Cost";
}