- fix for issue 756 (cycling not working for first 7 drawn cards)

- minor cleanup of MTGGameZones.cpp
This commit is contained in:
wagic.the.homebrew
2011-11-12 10:14:27 +00:00
parent a94e0a11cf
commit d654b050df
5 changed files with 8 additions and 33 deletions
+2 -1
View File
@@ -19,7 +19,8 @@ void DuelLayers::init(GameObserver* go)
mCardSelector = NEW CardSelector(go, this);
//1 Action Layer
action = NEW ActionLayer(go);
action->Add(NEW MTGGamePhase(go, action->getMaxId()));
action->Add(NEW MTGGamePhase(go, action->getMaxId())); //Phases handler
action->Add(NEW OtherAbilitiesEventReceiver(go, -1)); //autohand, etc... handler
//Other display elements
action->Add(NEW HUDDisplay(go, -1));
-7
View File
@@ -895,13 +895,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
observer->addObserver(NEW MTGDeathtouchRule(observer, -1));
return NULL;
}
//this handles all other events reciever, this one is essential for the game to play.
found = s.find("otherabilitiesrule");
if(found != string::npos)
{
observer->addObserver(NEW OtherAbilitiesEventReceiver(observer, -1));
return NULL;
}
//need to remove the section inside the transforms ability from the string before parsing
//TODO: store string values of "&&" so we can remove the classes added just to add support
+6 -23
View File
@@ -213,31 +213,14 @@ void MTGPlayerCards::drawFromLibrary()
{
if (!library->nb_cards)
{
int cantlosers = 0;
MTGGameZone * z = library->owner->game->inPlay;
int nbcards = z->nb_cards;
for (int i = 0; i < nbcards; ++i)
if (inPlay->hasAbility(Constants::CANTLOSE)
|| inPlay->hasAbility(Constants::CANTMILLLOSE)
|| owner->opponent()->game->inPlay->hasAbility(Constants::CANTWIN))
{
MTGCardInstance * c = z->cards[i];
if (c->has(Constants::CANTLOSE) || c->has(Constants::CANTMILLLOSE))
{
cantlosers++;
}
}
MTGGameZone * k = library->owner->opponent()->game->inPlay;
int onbcards = k->nb_cards;
for (int m = 0; m < onbcards; ++m)
{
MTGCardInstance * e = k->cards[m];
if (e->has(Constants::CANTWIN))
{
cantlosers++;
}
}
if (cantlosers < 1)
{
library->owner->getObserver()->gameOver = library->owner;
return;
}
library->owner->getObserver()->gameOver = library->owner;
return;
}
MTGCardInstance * toMove = library->cards[library->nb_cards - 1];