diff --git a/projects/mtg/bin/Res/rules/hermit.txt b/projects/mtg/bin/Res/rules/hermit.txt index d52beb07c..5e38a02c2 100644 --- a/projects/mtg/bin/Res/rules/hermit.txt +++ b/projects/mtg/bin/Res/rules/hermit.txt @@ -23,7 +23,6 @@ auto=vampirerule auto=unearthrule auto=lifelinkrule auto=deathtouchrule -auto=otherabilitiesrule [PLAYERS] life:18 diff --git a/projects/mtg/bin/Res/rules/mtg.txt b/projects/mtg/bin/Res/rules/mtg.txt index 77b7d4e43..dee2d5cc2 100644 --- a/projects/mtg/bin/Res/rules/mtg.txt +++ b/projects/mtg/bin/Res/rules/mtg.txt @@ -27,7 +27,6 @@ auto=vampirerule auto=unearthrule auto=lifelinkrule auto=deathtouchrule -auto=otherabilitiesrule [PLAYERS] life:20 diff --git a/projects/mtg/src/DuelLayers.cpp b/projects/mtg/src/DuelLayers.cpp index 450a99847..89333bc5c 100644 --- a/projects/mtg/src/DuelLayers.cpp +++ b/projects/mtg/src/DuelLayers.cpp @@ -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)); diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index d132b3673..089dce1b2 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -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 diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index d838c3eaa..11b7790b8 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -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];