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:
@@ -860,7 +860,6 @@ public:
|
|||||||
if (!e) return 0;
|
if (!e) return 0;
|
||||||
if (!tc->canTarget(e->card)) return 0;
|
if (!tc->canTarget(e->card)) return 0;
|
||||||
if (fromTc && !fromTc->canTarget(e->source)) return 0;
|
if (fromTc && !fromTc->canTarget(e->source)) return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
|
|||||||
int typeAsTarget(){return TARGET_CARD;}
|
int typeAsTarget(){return TARGET_CARD;}
|
||||||
const string getDisplayName() const;
|
const string getDisplayName() const;
|
||||||
MTGCardInstance * target;
|
MTGCardInstance * target;
|
||||||
MTGCardInstance * imprint;
|
Targetable * backupTargets[MAX_TARGETS];
|
||||||
|
|
||||||
|
|
||||||
//types
|
//types
|
||||||
|
|||||||
@@ -209,6 +209,11 @@ Interruptible(id), tc(tc), cost(_cost), payResult(payResult)
|
|||||||
mHeight = 40;
|
mHeight = 40;
|
||||||
type = ACTION_SPELL;
|
type = ACTION_SPELL;
|
||||||
from = _source->getCurrentZone();
|
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)
|
int Spell::computeX(MTGCardInstance * card)
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ void MTGCardInstance::initMTGCI()
|
|||||||
{
|
{
|
||||||
sample = "";
|
sample = "";
|
||||||
model = NULL;
|
model = NULL;
|
||||||
imprint = NULL;
|
|
||||||
isToken = false;
|
isToken = false;
|
||||||
lifeOrig = 0;
|
lifeOrig = 0;
|
||||||
doDamageTest = 1;
|
doDamageTest = 1;
|
||||||
|
|||||||
@@ -451,6 +451,16 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
size_t start = attribute.find("share!");
|
size_t start = attribute.find("share!");
|
||||||
size_t end = attribute.find("!");
|
size_t end = attribute.find("!");
|
||||||
string CDtype = attribute.substr(start + 6,end - start);
|
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( CDtype.find("name") != string::npos )
|
||||||
{
|
{
|
||||||
if(card->target)
|
if(card->target)
|
||||||
|
|||||||
Reference in New Issue
Block a user