diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 97c772451..7fe6ab0f7 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1462,103 +1462,19 @@ int AACopier::resolve() MTGCardInstance * _target = (MTGCardInstance *) target; if (_target) { - MTGCard* clone; - AbilityFactory af(game); + //MTGCard* clone; + //AbilityFactory af(game); if(_target->isToken || (_target->isACopier && _target->hasCopiedToken)) {//fix crash when copying token - clone = _target; + //clone = _target; tokencopied = true; } - else - clone = MTGCollection()->getCardById(_target->copiedID); + //else + //clone = MTGCollection()->getCardById(_target->copiedID); /////////////////////////////////////////////////////////////////////// - MTGCardInstance * myClone = NEW MTGCardInstance(clone, source->controller()->game); - //source->copy(myClone); - if(source->controller()->playMode != Player::MODE_TEST_SUITE) - { - source->setMTGId(myClone->getMTGId()); - source->setId = myClone->setId; - source->setRarity(myClone->getRarity()); - } - source->name = myClone->name; - source->setName(myClone->name); - source->getManaCost()->resetCosts(); - if(myClone->getManaCost()) - source->getManaCost()->copy(myClone->getManaCost()); - source->colors = myClone->colors; - source->types = myClone->types; - source->text = myClone->text; - source->formattedText = myClone->formattedText; - source->basicAbilities = myClone->model->data->basicAbilities; - source->modbasicAbilities = myClone->modbasicAbilities; - 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(); - source->magicText = myClone->magicText; - 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); - } - } - } - } - //power - int powerMod = 0; - int toughMod = 0; - bool powerlessThanOriginal = false; - bool toughLessThanOriginal = false; - if(source->power < source->origpower) - { - powerMod = source->origpower - source->power; - powerlessThanOriginal = true; - } - else - { - powerMod =source->power - source->origpower; - } - //toughness - if(source->toughness <= source->origtoughness) - { - toughMod = source->origtoughness - source->toughness; - toughLessThanOriginal = true; - } - else - { - toughMod =source->toughness - source->origtoughness; - } - if(!source->isCDA) - { - source->power = powerlessThanOriginal?myClone->power - powerMod:myClone->power + powerMod; - source->life = toughLessThanOriginal?myClone->toughness - toughMod:myClone->toughness + toughMod; - source->toughness = toughLessThanOriginal?myClone->toughness - toughMod:myClone->toughness + toughMod; - source->origpower = myClone->origpower; - source->origtoughness = myClone->origtoughness; - } - else - {//pbonus & tbonus are already computed except damage taken... - source->life -= source->damageCount; - } - SAFE_DELETE(myClone); + //MTGCardInstance * myClone = NEW MTGCardInstance(clone, source->controller()->game); + source->copy(_target->clone()); + //SAFE_DELETE(myClone); /////////////////////////////////////////////////////////////////////// source->isACopier = true; source->hasCopiedToken = tokencopied; @@ -1604,7 +1520,7 @@ int AACopier::resolve() andAbilityClone->addToGame(); } } - source->mPropertiesChangedSinceLastUpdate = true; + //source->mPropertiesChangedSinceLastUpdate = true; return 1; } return 0;