protection from colored spells
This commit is contained in:
@@ -78,6 +78,11 @@ int Damage::resolve()
|
||||
damage = 0;
|
||||
//rulings = 10/4/2004 The damage prevention ability works even if it has no counters, as long as some effect keeps its toughness above zero.
|
||||
//these creature are essentially immune to damage. however 0/-1 effects applied through lords or counters can kill them.
|
||||
if ((_target)->has(Constants::PROTECTIONFROMCOLOREDSPELLS))
|
||||
{//damage is prevented as long as the damage source is a spell on the stack...
|
||||
if((source->currentZone == source->controller()->opponent()->game->stack||source->currentZone == source->controller()->game->stack) && (source->hasColor(1)||source->hasColor(2)||source->hasColor(3)||source->hasColor(4)||source->hasColor(5)))
|
||||
damage = 0;
|
||||
}
|
||||
if ((_target)->has(Constants::PHANTOM))
|
||||
{
|
||||
damage = 0;
|
||||
|
||||
@@ -144,7 +144,8 @@ const char* Constants::MTGBasicAbilities[] = {
|
||||
"nolifegain",
|
||||
"nolifegainopponent",
|
||||
"auraward",
|
||||
"madness"
|
||||
"madness",
|
||||
"protectionfromcoloredspells"
|
||||
};
|
||||
|
||||
map<string,int> Constants::MTGBasicAbilitiesMap;
|
||||
|
||||
@@ -859,6 +859,11 @@ bool TargetChooser::canTarget(Targetable * target, bool withoutProtections)
|
||||
if (card->protectedAgainst(targetter)) return targetter->bypassTC;
|
||||
if (card->CantBeTargetby(targetter)) return targetter->bypassTC;
|
||||
if ((targetter->controller() != card->controller()) && card->has(Constants::OPPONENTSHROUD)) return targetter->bypassTC;
|
||||
if (card->has(Constants::PROTECTIONFROMCOLOREDSPELLS))
|
||||
{//a spell that has no target=criteria means it's not targetted unless its a workaround card...
|
||||
if((targetter->spellTargetType.size()) && (targetter->hasColor(1)||targetter->hasColor(2)||targetter->hasColor(3)||targetter->hasColor(4)||targetter->hasColor(5)))
|
||||
return targetter->bypassTC;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user