- fix issue 153 (Tokens should go to graveyard)
- "token" keyword can now be used in the parser with things such as Creature[-token] for "noncreature token"
- Let's stop using "token" as a type
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-01-03 10:08:36 +00:00
parent 69c5dee979
commit 23fe54ae6f
12 changed files with 110 additions and 7 deletions

View File

@@ -516,6 +516,36 @@ HUDDisplay::~HUDDisplay(){
}
MTGTokensCleanup::MTGTokensCleanup(int _id):MTGAbility(_id, NULL){}
int MTGTokensCleanup::receiveEvent(WEvent * e){
if (WEventZoneChange* event = dynamic_cast<WEventZoneChange*>(e)){
if (!event->card->isToken) return 0;
if (event->to == game->players[0]->game->inPlay || event->to == game->players[1]->game->inPlay) return 0;
if (event->to == game->players[0]->game->garbage || event->to == game->players[1]->game->garbage) return 0;
list.push_back(event->card);
return 1;
}
return 0;
}
int MTGTokensCleanup::testDestroy(){return 0;}
void MTGTokensCleanup::Update(float dt){
MTGAbility::Update(dt);
for(size_t i= 0; i < list.size(); ++i){
MTGCardInstance * c = list[i];
c->controller()->game->putInZone(c,c->currentZone, c->controller()->game->garbage);
}
list.clear();
}
MTGTokensCleanup * MTGTokensCleanup::clone() const{
MTGTokensCleanup * a = NEW MTGTokensCleanup(*this);
a->isClone = 1;
return a;
}
/* Legend Rule */
MTGLegendRule::MTGLegendRule(int _id):ListMaintainerAbility(_id){};