- fix for issue 756 (cycling not working for first 7 drawn cards)
- minor cleanup of MTGGameZones.cpp
This commit is contained in:
@@ -23,7 +23,6 @@ auto=vampirerule
|
|||||||
auto=unearthrule
|
auto=unearthrule
|
||||||
auto=lifelinkrule
|
auto=lifelinkrule
|
||||||
auto=deathtouchrule
|
auto=deathtouchrule
|
||||||
auto=otherabilitiesrule
|
|
||||||
|
|
||||||
[PLAYERS]
|
[PLAYERS]
|
||||||
life:18
|
life:18
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ auto=vampirerule
|
|||||||
auto=unearthrule
|
auto=unearthrule
|
||||||
auto=lifelinkrule
|
auto=lifelinkrule
|
||||||
auto=deathtouchrule
|
auto=deathtouchrule
|
||||||
auto=otherabilitiesrule
|
|
||||||
|
|
||||||
[PLAYERS]
|
[PLAYERS]
|
||||||
life:20
|
life:20
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ void DuelLayers::init(GameObserver* go)
|
|||||||
mCardSelector = NEW CardSelector(go, this);
|
mCardSelector = NEW CardSelector(go, this);
|
||||||
//1 Action Layer
|
//1 Action Layer
|
||||||
action = NEW ActionLayer(go);
|
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
|
//Other display elements
|
||||||
action->Add(NEW HUDDisplay(go, -1));
|
action->Add(NEW HUDDisplay(go, -1));
|
||||||
|
|
||||||
|
|||||||
@@ -895,13 +895,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
observer->addObserver(NEW MTGDeathtouchRule(observer, -1));
|
observer->addObserver(NEW MTGDeathtouchRule(observer, -1));
|
||||||
return NULL;
|
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
|
//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
|
//TODO: store string values of "&&" so we can remove the classes added just to add support
|
||||||
|
|||||||
@@ -213,31 +213,14 @@ void MTGPlayerCards::drawFromLibrary()
|
|||||||
{
|
{
|
||||||
if (!library->nb_cards)
|
if (!library->nb_cards)
|
||||||
{
|
{
|
||||||
int cantlosers = 0;
|
if (inPlay->hasAbility(Constants::CANTLOSE)
|
||||||
MTGGameZone * z = library->owner->game->inPlay;
|
|| inPlay->hasAbility(Constants::CANTMILLLOSE)
|
||||||
int nbcards = z->nb_cards;
|
|| owner->opponent()->game->inPlay->hasAbility(Constants::CANTWIN))
|
||||||
for (int i = 0; i < nbcards; ++i)
|
|
||||||
{
|
{
|
||||||
MTGCardInstance * c = z->cards[i];
|
return;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
library->owner->getObserver()->gameOver = library->owner;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MTGCardInstance * toMove = library->cards[library->nb_cards - 1];
|
MTGCardInstance * toMove = library->cards[library->nb_cards - 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user