diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 01a99c442..4ac1fca45 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1543,11 +1543,10 @@ AACopier::AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, M int AACopier::resolve() { - bool tokencopied = false; - AbilityFactory af(game); MTGCardInstance * _target = (MTGCardInstance *) target; if (_target) { + bool tokencopied = false; if(_target->isToken || (_target->isACopier && _target->hasCopiedToken)) tokencopied = true; @@ -1557,38 +1556,6 @@ int AACopier::resolve() { source->copy(_target); } - //abilities - for(unsigned int i = 0;i < source->cardsAbilities.size();i++) - { - MTGAbility * a = dynamic_cast(source->cardsAbilities[i]); - - if(a) game->removeObserver(a); - } - source->cardsAbilities.clear(); - af.getAbilities(¤tAbilities, NULL, source); - for (size_t i = 0; i < currentAbilities.size(); ++i) - { - MTGAbility * a = currentAbilities[i]; - a->source = (MTGCardInstance *) source; - if (a) - { - if (a->oneShot) - { - a->resolve(); - SAFE_DELETE(a); - } - else - { - a->addToGame(); - MayAbility * dontAdd = dynamic_cast(a); - if(!dontAdd) - { - source->cardsAbilities.push_back(a); - } - } - } - } - // source->isACopier = true; source->hasCopiedToken = tokencopied; source->copiedID = _target->copiedID; @@ -1605,35 +1572,9 @@ int AACopier::resolve() source->basicAbilities.reset(); source->getManaCost()->resetCosts(); } - if(_target->TokenAndAbility) - {//the source copied a token with andAbility - MTGAbility * TokenandAbilityClone = _target->TokenAndAbility->clone(); - TokenandAbilityClone->target = source; - if(_target->TokenAndAbility->oneShot) - { - TokenandAbilityClone->resolve(); - SAFE_DELETE(TokenandAbilityClone); - } - else - { - TokenandAbilityClone->addToGame(); - } - } - if(andAbility) - { - MTGAbility * andAbilityClone = andAbility->clone(); - andAbilityClone->target = source; - if(andAbility->oneShot) - { - andAbilityClone->resolve(); - SAFE_DELETE(andAbilityClone); - } - else - { - andAbilityClone->addToGame(); - } - } - //source->mPropertiesChangedSinceLastUpdate = true; + //todo andAbility and tokenandAbility + // + // return 1; } return 0; diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index c9a4d8978..eb5381452 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -1069,7 +1069,7 @@ void GameObserver::checkLegendary(MTGCardInstance * card) { if(!foundlegendrule) return; - if(card->has(Constants::NOLEGEND)||card->controller()->opponent()->inPlay()->hasAbility(Constants::NOLEGENDRULE)||card->controller()->inPlay()->hasAbility(Constants::NOLEGENDRULE)) + if(card->isPhased||card->has(Constants::NOLEGEND)||card->controller()->opponent()->inPlay()->hasAbility(Constants::NOLEGENDRULE)||card->controller()->inPlay()->hasAbility(Constants::NOLEGENDRULE)) return; int destroy = 0; vectoroldCards; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 3a4a582c7..3cd879795 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1410,13 +1410,8 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG found = s.find("legendrule"); if(found != string::npos) { - //I replaced this rule since it broke cards with copy effects and with andability and other - //complex cards. So I moved it to gameobserver state based effects, if there are no more - //abilities that needs resolving then trigger this legend check... example bug: - //cast Phantasmal Image, then copy Vendilion Clique in play, after you choose target player - //there will be infinite menu for legendary rule that conflicts with Phantasmal andAbility - //observer->addObserver(NEW MTGLegendRule(observer, -1)); - observer->foundlegendrule = true; + observer->addObserver(NEW MTGLegendRule(observer, -1)); + //observer->foundlegendrule = true; return NULL; } //this handles the planeswalker named legend rule which is dramatically different from above. diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index e3226c544..0a2090804 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -139,11 +139,11 @@ void MTGCardInstance::copy(MTGCardInstance * card) int castMethodBackUP = this->castMethod; mtgid = source->getId(); MTGCardInstance * oldStored = this->storedSourceCard; - /*Spell * spell = NEW Spell(observer, this); + Spell * spell = NEW Spell(observer, this); observer = card->observer; AbilityFactory af(observer); af.addAbilities(observer->mLayers->actionLayer()->getMaxId(), spell); - delete spell;*/ + delete spell; if(observer->players[1]->playMode == Player::MODE_TEST_SUITE) mtgid = backupid; // there must be a way to get the token id... else @@ -151,14 +151,11 @@ void MTGCardInstance::copy(MTGCardInstance * card) mtgid = card->getMTGId(); /////////////////////////////////////////////////// setId = card->setId; // Copier/Cloner cards produces the same token...// rarity = card->getRarity(); /////////////////////////////////////////////////// - - setMTGId(card->copiedID); //**************sets copier image****************// } castMethod = castMethodBackUP; backupTargets = this->backupTargets; storedCard = oldStored; miracle = false; - mPropertiesChangedSinceLastUpdate = true; } MTGCardInstance::~MTGCardInstance()