Fixed a bug on deck choosing menu when an AI deck has no avatar image (it will be used "baka.jpg"), added new default avatar images for AI decks (up to 200), fixed "_PROLIFERATE_" macro and fixed all primitives with "proliferate" ability, improved the "proliferation" keyword for target chooser in order to avoid targeting permanents or players without counters and/or with some protections (e.g. hexproof, shroud and similar).
This commit is contained in:
@@ -2180,13 +2180,41 @@ bool ProliferateChooser::canTarget(Targetable * target,bool withoutProtections)
|
||||
{
|
||||
if (MTGCardInstance * card = dynamic_cast<MTGCardInstance*>(target))
|
||||
{
|
||||
if (source && card->isInPlay(observer) && !withoutProtections)
|
||||
{
|
||||
if (card->has(Constants::SHROUD)) return source->bypassTC;
|
||||
if (card->protectedAgainst(source)) return source->bypassTC;
|
||||
if (card->CantBeTargetby(source)) return source->bypassTC;
|
||||
if ((source->controller() != card->controller()) && card->has(Constants::OPPONENTSHROUD)) return source->bypassTC;
|
||||
if (card->has(Constants::PROTECTIONFROMCOLOREDSPELLS)){
|
||||
if((source->spellTargetType.size()) && (source->hasColor(1)||source->hasColor(2)||source->hasColor(3)||source->hasColor(4)||source->hasColor(5)))
|
||||
return source->bypassTC;
|
||||
}
|
||||
}
|
||||
if(card->counters && card->counters->counters.empty())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
else if (Player * p = dynamic_cast<Player*>(target))
|
||||
{
|
||||
if(!p->poisonCount)
|
||||
if (source)
|
||||
{
|
||||
if ((source->controller() != source->controller()->opponent())
|
||||
&& (source->controller()->opponent()->game->inPlay->hasAbility(Constants::CONTROLLERSHROUD))
|
||||
&& source->controller() != target)
|
||||
return source->bypassTC;
|
||||
if ((source->controller()->opponent()->game->inPlay->hasAbility(Constants::PLAYERSHROUD))
|
||||
&& source->controller()->opponent() == target)
|
||||
return source->bypassTC;
|
||||
if ((source->controller()->game->inPlay->hasAbility(Constants::PLAYERSHROUD))
|
||||
&& source->controller() == target)
|
||||
return source->bypassTC;
|
||||
if(source->controller()->isAI() && p == source->controller() && p->poisonCount)
|
||||
return false; // prevent AI to target itself when it has some poison counters.
|
||||
if(source->controller()->isAI() && p != source->controller() && !p->poisonCount)
|
||||
return false; // prevent AI to target opponent when there are no poison counters.
|
||||
}
|
||||
if(!p->poisonCount && !p->energyCount && !p->experienceCount)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user