Add CD Blocked & some cards

cd "blocked" should fix Smite , Tattermunge Witch
This commit is contained in:
Anthony Calosa
2016-08-18 17:57:14 +08:00
parent ed838815ef
commit 892ef6b1b3
5 changed files with 110 additions and 3 deletions
+23
View File
@@ -25,6 +25,7 @@ CardDescriptor::CardDescriptor()
CDcontrollerDamaged = 0;
CDdamager = 0;
CDgeared = 0;
CDblocked = 0;
}
int CardDescriptor::init()
@@ -216,6 +217,28 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
{
match = NULL;
}
if (CDblocked == -1)
{
if(!card->isAttacker())
match = NULL;
else
{
if(card->isBlocked())
match = NULL;
}
}
if (CDblocked == 1)
{
if(!card->isAttacker())
match = NULL;
else
{
if(!card->isBlocked())
match = NULL;
}
}
if ((isMultiColored == -1 && card->isMultiColored) || (isMultiColored == 1 && !card->isMultiColored))
{
+12
View File
@@ -408,6 +408,18 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
cd->defenser = &MTGCardInstance::AnyCard;
}
}
//Blocked
else if (attribute.find("blocked") != string::npos)
{
if (minus)
{
cd->CDblocked = -1;
}
else
{
cd->CDblocked = 1;
}
}
//Tapped, untapped
else if (attribute.find("tapped") != string::npos)
{