extended countertrack and teach( to creatures for use with countertracking...isolated equipment rule that states it can't equip a card it can't target in testDestroy(we want the equipments to stay on a creature even after it's hands are full :)

I'll take a stab at coding the current cards for the mod this evening.
This commit is contained in:
omegablast2002@yahoo.com
2011-09-17 23:27:00 +00:00
parent c5203a9caf
commit 4ab6dfd3da
6 changed files with 81 additions and 30 deletions
+29 -10
View File
@@ -2245,14 +2245,26 @@ public:
aType = MTGAbility::STANDARD_TEACH;
}
int canBeInList(MTGCardInstance * card)
{
if(card->isPhased || source->isPhased)
int canBeInList(MTGCardInstance * card)
{
if(card->isPhased || source->isPhased)
return 0;
if(tc->canTarget(card) && card != tc->source)
{
if ((tc->source->hasSubtype(Subtypes::TYPE_AURA) || tc->source->hasSubtype(Subtypes::TYPE_EQUIPMENT) || tc->source->hasSubtype("instant")
|| tc->source->hasSubtype("sorcery")) && card == tc->source->target )
return 1;
if(tc->source->hasSubtype(Subtypes::TYPE_CREATURE))
{
for(size_t myChild = 0; myChild < tc->source->parentCards.size();++myChild)
{
if(tc->source->parentCards[myChild] == card)
return 1;
}
}
}
return 0;
if ((tc->source->hasSubtype(Subtypes::TYPE_AURA) || tc->source->hasSubtype(Subtypes::TYPE_EQUIPMENT) || tc->source->hasSubtype("instant")
|| tc->source->hasSubtype("sorcery")) && tc->canTarget(card) && card == tc->source->target && card != tc->source) return 1;
return 0;
}
}
int resolve()
{
@@ -2289,7 +2301,10 @@ public:
}
else
{
return 0;
if(tc->source->hasSubtype(Subtypes::TYPE_CREATURE))
a->target = d;
else
return 0;
}
if (a->oneShot)
@@ -2426,8 +2441,11 @@ public:
{
if (source->target && !game->isInPlay(source->target))
unequip();
if(!game->connectRule)
{
if (source->target && TargetAbility::tc && !TargetAbility::tc->canTarget((Targetable *)source->target,true))
unequip();
}
return TargetAbility::testDestroy();
}
@@ -3543,11 +3561,12 @@ public:
class ACounterTracker: public MTGAbility
{
public:
Counter * counter;
string scounter;
int removed;
ACounterTracker(int id, MTGCardInstance * source, MTGCardInstance * target, Counter * counter = NULL);
ACounterTracker(int id, MTGCardInstance * source, MTGCardInstance * target, string scounter = "");
int addToGame();
int destroy();
int testDestroy();
ACounterTracker * clone() const;
~ACounterTracker();
};