removed a unused variable and correct a bug with [share] spells tc's are deleted as they resolve so these effects couldnt take adventage of this type of targeting when the effect ability was a fizzle.

This commit is contained in:
omegablast2002@yahoo.com
2011-01-23 17:29:26 +00:00
parent 12bdaffac1
commit ee29fbc237
5 changed files with 16 additions and 3 deletions

View File

@@ -860,7 +860,6 @@ public:
if (!e) return 0;
if (!tc->canTarget(e->card)) return 0;
if (fromTc && !fromTc->canTarget(e->source)) return 0;
return 1;
}

View File

@@ -97,7 +97,7 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
int typeAsTarget(){return TARGET_CARD;}
const string getDisplayName() const;
MTGCardInstance * target;
MTGCardInstance * imprint;
Targetable * backupTargets[MAX_TARGETS];
//types

View File

@@ -209,6 +209,11 @@ Interruptible(id), tc(tc), cost(_cost), payResult(payResult)
mHeight = 40;
type = ACTION_SPELL;
from = _source->getCurrentZone();
for(int i = 0;i < MAX_TARGETS;i++)
{
if(tc && tc->targets[i] != NULL)
_source->backupTargets[i] = tc->targets[i];
}
}
int Spell::computeX(MTGCardInstance * card)

View File

@@ -110,7 +110,6 @@ void MTGCardInstance::initMTGCI()
{
sample = "";
model = NULL;
imprint = NULL;
isToken = false;
lifeOrig = 0;
doDamageTest = 1;

View File

@@ -451,6 +451,16 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
size_t start = attribute.find("share!");
size_t end = attribute.find("!");
string CDtype = attribute.substr(start + 6,end - start);
if(card->isSpell() && card->backupTargets[0]->typeAsTarget() == TARGET_STACKACTION)
{
//spells always store their targets in :targets[]
//however they are all erased as the spell resolves
//added a array to store these backups incase theyre needed
//again for effects such as these.
Spell * spell;
spell = (Spell*)card->backupTargets[0];
card->target = spell->source;
}
if( CDtype.find("name") != string::npos )
{
if(card->target)