zpos and zone display
added zone position (adjust dynamically), also inverts the display of the zone so we always get the top/recent one... the library zpos is inverted so if we choose to target the top 5 zpos like target(*[zpos>=5|mylibrary), it will do from top to bottom... this is only for AI so we can add alternate code for them since they cant use reveal atm, we can make them target within allowed range... Also this commit disabled the new legend and planeswalker rule since it conflicts with reveal ability, unless I/We figure it out, I recommend to use the old one...
This commit is contained in:
@@ -3257,14 +3257,17 @@ int MTGLegendRule::added(MTGCardInstance * card)
|
||||
{
|
||||
map<MTGCardInstance *, bool>::iterator it;
|
||||
int destroy = 0;
|
||||
|
||||
vector<MTGCardInstance*>oldCards;
|
||||
for (it = cards.begin(); it != cards.end(); it++)
|
||||
{
|
||||
MTGCardInstance * comparison = (*it).first;
|
||||
if (comparison != card && comparison->controller() == card->controller() && !(comparison->getName().compare(card->getName())))
|
||||
if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer()))
|
||||
if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer()))
|
||||
{
|
||||
oldCards.push_back(comparison);
|
||||
destroy = 1;
|
||||
}
|
||||
}
|
||||
}/*
|
||||
if(destroy)
|
||||
{
|
||||
vector<MTGAbility*>selection;
|
||||
@@ -3287,6 +3290,27 @@ int MTGLegendRule::added(MTGCardInstance * card)
|
||||
SAFE_DELETE(LegendruleGeneric);
|
||||
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Legendary Rule");
|
||||
menuChoice->addToGame();
|
||||
}*/
|
||||
//reverted to old since this new code conflicts with reveal targetchooser
|
||||
if(destroy)
|
||||
{
|
||||
vector<MTGAbility*>selection;
|
||||
MultiAbility * multi = NEW MultiAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card, NULL);
|
||||
for(unsigned int i = 0;i < oldCards.size();i++)
|
||||
{
|
||||
AAMover *a = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New");
|
||||
a->oneShot = true;
|
||||
multi->Add(a);
|
||||
}
|
||||
multi->oneShot = 1;
|
||||
MTGAbility * a1 = multi;
|
||||
selection.push_back(a1);
|
||||
AAMover *b = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old");
|
||||
b->oneShot = true;
|
||||
MTGAbility * b1 = b;
|
||||
selection.push_back(b1);
|
||||
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule");
|
||||
menuChoice->addToGame();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -3341,9 +3365,12 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card)
|
||||
{
|
||||
MTGCardInstance * comparison = (*it).first;
|
||||
if (comparison != card && comparison->types == card->types && comparison->controller() == card->controller())
|
||||
if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer()))
|
||||
if (!(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer()))
|
||||
{
|
||||
oldCards.push_back(comparison);
|
||||
destroy = 1;
|
||||
}
|
||||
}
|
||||
}/*
|
||||
if (destroy)
|
||||
{
|
||||
vector<MTGAbility*>selection;
|
||||
@@ -3366,6 +3393,28 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card)
|
||||
SAFE_DELETE(PWruleGeneric);
|
||||
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), NULL, myClone,true,selection,card->controller(),"Planeswalker Uniqueness Rule");
|
||||
menuChoice->addToGame();
|
||||
}*/
|
||||
//reverted to old since this new code conflicts with reveal targetchooser
|
||||
if (destroy)
|
||||
{
|
||||
vector<MTGAbility*>selection;
|
||||
|
||||
MultiAbility * multi = NEW MultiAbility(game,game->mLayers->actionLayer()->getMaxId(), card, card, NULL);
|
||||
for(unsigned int i = 0;i < oldCards.size();i++)
|
||||
{
|
||||
AAMover *a = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New");
|
||||
a->oneShot = true;
|
||||
multi->Add(a);
|
||||
}
|
||||
multi->oneShot = 1;
|
||||
MTGAbility * a1 = multi;
|
||||
selection.push_back(a1);
|
||||
AAMover *b = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old");
|
||||
b->oneShot = true;
|
||||
MTGAbility * b1 = b;
|
||||
selection.push_back(b1);
|
||||
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Planeswalker Rule");
|
||||
menuChoice->addToGame();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user