Erwan - fizzle spells that have invalid targets

This commit is contained in:
wagic.the.homebrew@gmail.com
2009-08-09 11:18:05 +00:00
parent 58c90c47ca
commit 4f76f50cdd
9 changed files with 94 additions and 48 deletions

View File

@@ -838,7 +838,14 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
MTGCardInstance * card = spell->source;
if (spell->cursor==1) card->target = spell->getNextCardTarget();
if (spell->getNbTargets()==1){
card->target = spell->getNextCardTarget();
if (card->target && !spell->tc->canTarget(card->target)){
MTGPlayerCards * zones = card->controller()->game;
zones->putInGraveyard(card);
return; //fizzle
}
}
_id = magicText(_id, spell);
GameObserver * game = GameObserver::GetInstance();
@@ -1242,7 +1249,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
}
case 1192: //BrainGeyser
{
Player * player = ((Player * )spell->targets[0]);
Player * player = spell->getNextPlayerTarget();
int x = spell->cost->getConvertedCost() - 2;
for (int i = 0; i < x ; i++){
player->game->drawFromLibrary();