notany attribute

anytypeofmana makes manacost colorless... wip
This commit is contained in:
Anthony Calosa
2017-01-23 18:32:58 +08:00
parent 7f6e96459c
commit 94aefa6dba
9 changed files with 323 additions and 286 deletions
+8 -1
View File
@@ -388,7 +388,14 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
}
//Counters
if (anyCounter)
if (anyCounter == -1)
{
if (card->counters->mCount)
{
match = NULL;
}
}
else if (anyCounter)
{
if (!(card->counters->mCount))
{
+20
View File
@@ -1119,6 +1119,26 @@ void GameObserver::Affinity()
///we handle trisnisphere seperately because its a desaster.
if(card->getManaCost())//make sure we check, abiliy$!/token dont have a mancost object.
{
//change cost to colorless for anytypeofmana ability
if(card->has(Constants::ANYTYPEOFMANA))
{
card->anymanareplacement = true;
int convertedC = card->getManaCost()->getConvertedCost();
card->getManaCost()->changeCostTo( NEW ManaCost(ManaCost::parseManaCost("{0}", NULL, card)) );
for (int jj = 0; jj < convertedC; jj++)
{
card->getManaCost()->add(Constants::MTG_COLOR_ARTIFACT, 1);
}
}
else
{
if (card->anymanareplacement)
{
card->getManaCost()->changeCostTo( card->model->data->getManaCost() );
card->anymanareplacement = false;
}
}
if (card->has(Constants::TRINISPHERE))
{
for (int jj = card->getManaCost()->getConvertedCost(); jj < 3; jj++)
+1
View File
@@ -241,6 +241,7 @@ void MTGCardInstance::initMTGCI()
miracle = false;
hasCopiedToken = false;
countTrini = 0;
anymanareplacement = false;
imprintedCards.clear();
attackCost = 0;
attackCostBackup = 0;
+2 -1
View File
@@ -175,7 +175,8 @@ const char* Constants::MTGBasicAbilities[] = {
"canblocktapped",
"oppnomaxhand",
"cantcrew",
"hiddenface"//test for facedown
"hiddenface",//test for facedown
"anytypeofmana"
};
map<string,int> Constants::MTGBasicAbilitiesMap;
+4
View File
@@ -746,6 +746,10 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
{
cd->anyCounter = 1;
}
else if (attribute.find("{notany}") != string::npos)
{
cd->anyCounter = -1;
}
else
{
size_t start = attribute.find("{");