add "recent" & "raidcount"

the recent attribute is to parse new cards entered play, then turns
itself to 0 if some stuff happened since it's already in play...
This commit is contained in:
Anthony Calosa
2016-08-25 02:45:51 +08:00
parent 6c836e0fde
commit 9bcc54c56c
10 changed files with 47 additions and 0 deletions
+1
View File
@@ -4008,6 +4008,7 @@ int AACloner::resolve()
spell->source->isToken = 1;
spell->resolve();
spell->source->fresh = 1;
spell->source->entersBattlefield = 1;
spell->source->model = spell->source;
spell->source->model->data = spell->source;
//if the token doesn't have cda/dynamic pt then allow this...
+10
View File
@@ -57,6 +57,11 @@ void CardDescriptor::unsecuresetfresh(int k)
fresh = k;
}
void CardDescriptor::unsecuresetrecent(int j)
{
entersBattlefield = j;
}
void CardDescriptor::setisMultiColored(int w)
{
isMultiColored = w;
@@ -218,6 +223,11 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
{
match = NULL;
}
if ((entersBattlefield == -1 && card->entersBattlefield) || (entersBattlefield == 1 && !card->entersBattlefield))
{
match = NULL;
}
if ((CDgeared == -1 && card->equipment > 0) || (CDgeared == 1 && card->equipment < 1))
{
+11
View File
@@ -1362,6 +1362,17 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
cd.unsecuresetfresh(1);
}
}
else if (attribute.find("recent") != string::npos)
{
if (minus)
{
cd.unsecuresetrecent(-1);
}
else
{
cd.unsecuresetrecent(1);
}
}
else if (attribute.find("geared") != string::npos)
{
if (minus)
+1
View File
@@ -690,6 +690,7 @@ void GameObserver::gameStateBasedEffects()
for (int j = zone->nb_cards - 1; j >= 0; j--)
{
MTGCardInstance * card = zone->cards[j];
card->entersBattlefield = 0;
card->LKIpower = card->power;
card->LKItoughness = card->toughness;
card->LKIbasicAbilities = card->basicAbilities;
+1
View File
@@ -258,6 +258,7 @@ void MTGCardInstance::initMTGCI()
canproduceB = 0;
canproduceW = 0;
canproduceC = 0;
entersBattlefield = 0;
currentimprintName = "";
imprintedNames.clear();
CountedObjects = 0;
+1
View File
@@ -3131,6 +3131,7 @@ int MTGUnearthRule::receiveEvent(WEvent * event)
if (e->to == e->card->controller()->game->battlefield)
{
e->card->fresh = 1;
e->card->entersBattlefield = 1;
}
if (card && card->basicAbilities[(int)Constants::UNEARTH])
+11
View File
@@ -486,6 +486,17 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
cd->unsecuresetfresh(1);
}
}
else if (attribute.find("recent") != string::npos)
{
if (minus)
{
cd->unsecuresetrecent(-1);
}
else
{
cd->unsecuresetrecent(1);
}
}
else if (attribute.find("geared") != string::npos)
{
if (minus)