Fixed some primitives from issue #1085 and from Discord channel, fixed all curses primitives and targets, added new keywords "oppotgt" and "ctrltgt" to check wich player has been targeted from a card, fixed an issue on "chooseaname" ability.

This commit is contained in:
Vittorio Alfieri
2023-07-13 17:24:11 +02:00
parent c170733af6
commit fbfcb7d3ac
9 changed files with 298 additions and 174 deletions

View File

@@ -2289,12 +2289,18 @@ bool TriggerTargetChooser::equals(TargetChooser * tc)
}
/*my curses */
bool myCursesChooser::canTarget(Targetable * target,bool)
bool myCursesChooser::canTarget(Targetable * target, bool)
{
for(unsigned int i = 0;i < source->controller()->curses.size();++i)
for (int j = source->controller()->game->battlefield->nb_cards - 1; j >= 0; --j)
{
MTGCardInstance * compare = source->controller()->curses[i];
if(compare == dynamic_cast<MTGCardInstance*>(target))
MTGCardInstance * compare = source->controller()->game->battlefield->cards[j];
if(compare->hasType("Curse") && compare->playerTarget == source->controller() && compare == dynamic_cast<MTGCardInstance*>(target))
return true;
}
for (int j = source->controller()->opponent()->game->battlefield->nb_cards - 1; j >= 0; --j)
{
MTGCardInstance * compare = source->controller()->opponent()->game->battlefield->cards[j];
if(compare->hasType("Curse") && compare->playerTarget == source->controller() && compare == dynamic_cast<MTGCardInstance*>(target))
return true;
}
return false;