diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 453d544ff..03ddae5a6 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -781,53 +781,53 @@ private: } else if (s == "olandg") { - intValue = countManaProducedby(Constants::MTG_COLOR_GREEN, target->controller()->opponent()); + intValue = countManaProducedby(Constants::MTG_COLOR_GREEN, target, target->controller()->opponent()); } else if (s == "olandu") { - intValue = countManaProducedby(Constants::MTG_COLOR_BLUE, target->controller()->opponent()); + intValue = countManaProducedby(Constants::MTG_COLOR_BLUE, target, target->controller()->opponent()); } else if (s == "olandr") { - intValue = countManaProducedby(Constants::MTG_COLOR_RED, target->controller()->opponent()); + intValue = countManaProducedby(Constants::MTG_COLOR_RED, target, target->controller()->opponent()); } else if (s == "olandb") { - intValue = countManaProducedby(Constants::MTG_COLOR_BLACK, target->controller()->opponent()); + intValue = countManaProducedby(Constants::MTG_COLOR_BLACK, target, target->controller()->opponent()); } else if (s == "olandw") { - intValue = countManaProducedby(Constants::MTG_COLOR_WHITE, target->controller()->opponent()); + intValue = countManaProducedby(Constants::MTG_COLOR_WHITE, target, target->controller()->opponent()); } else if (s == "olandc") { - intValue = countManaProducedby(Constants::MTG_COLOR_ARTIFACT, target->controller()->opponent()) + - countManaProducedby(Constants::MTG_COLOR_WASTE, target->controller()->opponent()); + intValue = countManaProducedby(Constants::MTG_COLOR_ARTIFACT, target, target->controller()->opponent()) + + countManaProducedby(Constants::MTG_COLOR_WASTE, target, target->controller()->opponent()); } else if (s == "plandg") { - intValue = countManaProducedby(Constants::MTG_COLOR_GREEN, target->controller()); + intValue = countManaProducedby(Constants::MTG_COLOR_GREEN, target, target->controller()); } else if (s == "plandu") { - intValue = countManaProducedby(Constants::MTG_COLOR_BLUE, target->controller()); + intValue = countManaProducedby(Constants::MTG_COLOR_BLUE, target, target->controller()); } else if (s == "plandr") { - intValue = countManaProducedby(Constants::MTG_COLOR_RED, target->controller()); + intValue = countManaProducedby(Constants::MTG_COLOR_RED, target, target->controller()); } else if (s == "plandb") { - intValue = countManaProducedby(Constants::MTG_COLOR_BLACK, target->controller()); + intValue = countManaProducedby(Constants::MTG_COLOR_BLACK, target, target->controller()); } else if (s == "plandw") { - intValue = countManaProducedby(Constants::MTG_COLOR_WHITE, target->controller()); + intValue = countManaProducedby(Constants::MTG_COLOR_WHITE, target, target->controller()); } else if (s == "plandc") { - intValue = countManaProducedby(Constants::MTG_COLOR_ARTIFACT, target->controller()) + - countManaProducedby(Constants::MTG_COLOR_WASTE, target->controller()); + intValue = countManaProducedby(Constants::MTG_COLOR_ARTIFACT, target, target->controller()) + + countManaProducedby(Constants::MTG_COLOR_WASTE, target, target->controller()); } else if (s == "cantargetmycre")// can target my creature { @@ -1122,7 +1122,7 @@ public: return count; } - /*int countManaProducedby(int color, MTGCardInstance * target, Player * player) + int countManaProducedby(int color, MTGCardInstance * target, Player * player) { int count = 0; for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++) @@ -1134,9 +1134,9 @@ public: count += 1; } return count; - }*/ + } - int countManaProducedby(int color, Player * player) + /*int countManaProducedby(int color, Player * player) { int count = 0; for (int i = 0; i < player->game->battlefield->nb_cards; i++) @@ -1155,7 +1155,7 @@ public: count += 1; } return count; - } + }*/ WParsedInt(int value = 0) { @@ -2066,7 +2066,7 @@ class AACopier: public ActivatedAbility { public: bool isactivated; - vector currentAbilities; + //vector currentAbilities; MTGAbility * andAbility; AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL); int resolve(); diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index fbc671f99..bd2428cd2 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -711,25 +711,27 @@ void GameObserver::gameStateBasedEffects() card->myPair = NULL; } ///set basic land mana objects canproduce - for (size_t gg = 0; gg < mLayers->actionLayer()->manaObjects.size(); gg++) + /*for (size_t gg = 0; gg < mLayers->actionLayer()->manaObjects.size(); gg++) { MTGAbility * aa = ((MTGAbility *) mLayers->actionLayer()->manaObjects[gg]); //AManaProducer * amp = dynamic_cast (aa); - - if (dynamic_cast (aa) && (dynamic_cast (aa))->source->isLand() && (dynamic_cast (aa))->source == card) + if(aa != NULL) { - if (card->hasType("forest") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_GREEN)) - card->canproduceG = 1; - if (card->hasType("island") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_BLUE)) - card->canproduceU = 1; - if (card->hasType("mountain") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_RED)) - card->canproduceR = 1; - if (card->hasType("swamp") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_BLACK)) - card->canproduceB = 1; - if (card->hasType("plains") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_WHITE)) - card->canproduceW = 1; + if (dynamic_cast (aa) && (dynamic_cast (aa))->source->isLand() && (dynamic_cast (aa))->source == card) + { + if (card->hasType("forest") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_GREEN)) + card->canproduceG = 1; + if (card->hasType("island") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_BLUE)) + card->canproduceU = 1; + if (card->hasType("mountain") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_RED)) + card->canproduceR = 1; + if (card->hasType("swamp") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_BLACK)) + card->canproduceB = 1; + if (card->hasType("plains") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_WHITE)) + card->canproduceW = 1; + } } - } + }*/ ///clear imprints if(isInPlay(card) && card->imprintedCards.size()) {