attempt to fix "notatarget"

notatarget must be allowed to target untargettable cards.
This commit is contained in:
Anthony Calosa
2015-09-23 12:14:47 +08:00
parent df659f648e
commit 7db5345f9a
4 changed files with 11 additions and 4 deletions

View File

@@ -240,6 +240,7 @@ public:
int swapT; int swapT;
bool isSwitchedPT; bool isSwitchedPT;
bool isACopier; bool isACopier;
bool bypassTC;
void eventattacked(); void eventattacked();
void eventattackedAlone(); void eventattackedAlone();

View File

@@ -1330,7 +1330,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
tcString = splitTarget[1]; tcString = splitTarget[1];
if (!isTarget) if (!isTarget)
{
tc->targetter->bypassTC = true;
tc->targetter = NULL; tc->targetter = NULL;
}
else
tc->targetter->bypassTC = false;
sWithoutTc = splitTarget[0]; sWithoutTc = splitTarget[0];
sWithoutTc.append(splitTarget[2]); sWithoutTc.append(splitTarget[2]);
} }

View File

@@ -57,6 +57,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
isCDA = false; isCDA = false;
isSwitchedPT = false; isSwitchedPT = false;
isACopier = false; isACopier = false;
bypassTC = false;
} }
MTGCardInstance * MTGCardInstance::createSnapShot() MTGCardInstance * MTGCardInstance::createSnapShot()

View File

@@ -855,10 +855,10 @@ bool TargetChooser::canTarget(Targetable * target, bool withoutProtections)
if (source && targetter && card->isInPlay(observer) && !withoutProtections) if (source && targetter && card->isInPlay(observer) && !withoutProtections)
{ {
if (card->has(Constants::SHROUD)) return false; if (card->has(Constants::SHROUD)) return targetter->bypassTC;
if (card->protectedAgainst(targetter)) return false; if (card->protectedAgainst(targetter)) return targetter->bypassTC;
if (card->CantBeTargetby(targetter)) return false; if (card->CantBeTargetby(targetter)) return targetter->bypassTC;
if ((targetter->controller() != card->controller()) && card->has(Constants::OPPONENTSHROUD)) return false; if ((targetter->controller() != card->controller()) && card->has(Constants::OPPONENTSHROUD)) return targetter->bypassTC;
} }
return true; return true;
} }