fix produce color

when you produce the chosen color, add mana of that color.
This commit is contained in:
Anthony Calosa
2016-06-23 17:44:50 +08:00
parent 7c9d52abbf
commit 4d3277f41b
7 changed files with 113 additions and 61 deletions

View File

@@ -1119,14 +1119,20 @@ int ManaPool::remove(int color, int value)
return result;
}
int ManaPool::add(int color, int value, MTGCardInstance * source)
int ManaPool::add(int color, int value, MTGCardInstance * source, bool extra)
{
if (color == Constants::MTG_COLOR_ARTIFACT)
color = Constants::MTG_COLOR_WASTE;
int result = ManaCost::add(color, value);
for (int i = 0; i < value; ++i)
{
WEvent * e = NEW WEventEngageMana(color, source, this);
WEvent * e = NEW WEvent;
if(extra)
e = NEW WEventEngageManaExtra(color, source, this);
else
e = NEW WEventEngageMana(color, source, this);
player->getObserver()->receiveEvent(e);
}
return result;