added new legend & pw rule, trigger & event

added new pw & legend rule (i just leave the old rules behind and
disabled it), added phasesin, faceup, copiedacard event, added facedup &
phasedin trigger.
This commit is contained in:
Anthony Calosa
2017-02-16 21:26:03 +08:00
parent da874738d6
commit 5e46016c4d
12 changed files with 408 additions and 73 deletions
+21
View File
@@ -169,6 +169,11 @@ void MTGCardInstance::copy(MTGCardInstance * card)
backupTargets = this->backupTargets;
storedCard = oldStored;
miracle = false;
//add event here copied a card...
WEvent * e = NEW WEventCardCopiedACard(this);
getObserver()->receiveEvent(e);
}
MTGCardInstance::~MTGCardInstance()
@@ -849,6 +854,22 @@ int MTGCardInstance::countDuplicateCardNames()
return count;
}
int MTGCardInstance::countDuplicateCardTypes()
{
int count = 0;
if(observer)
{
int nb_cards = controller()->game->battlefield->nb_cards;
for(int x = 0; x < nb_cards; x++)
{
if(controller()->game->battlefield->cards[x] != this && controller()->game->battlefield->cards[x]->types == this->types)
count+=1;
}
}
return count;
}
//check can produce mana
int MTGCardInstance::canproduceMana(int color)
{