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:
@@ -44,9 +44,11 @@ void CardDisplay::init(MTGGameZone * zone)
|
||||
resetObjects();
|
||||
if (!zone) return;
|
||||
start_item = 0;
|
||||
for (int i = 0; i < zone->nb_cards; i++)
|
||||
vector<MTGCardInstance*> newCD (zone->cards.rbegin(), zone->cards.rend());
|
||||
for (int i = 0; i < zone->nb_cards; i++)//invert display so the top will always be the first one to show
|
||||
{
|
||||
AddCard(zone->cards[i]);
|
||||
//AddCard(zone->cards[i]);
|
||||
AddCard(newCD[i]);
|
||||
}
|
||||
if (mObjects.size()) mObjects[0]->Entering();
|
||||
}
|
||||
@@ -78,7 +80,8 @@ void CardDisplay::Update(float dt)
|
||||
bool update = false;
|
||||
|
||||
if (zone)
|
||||
{
|
||||
{//invert display so the top will always be the first one to show
|
||||
vector<MTGCardInstance*> newCD (zone->cards.rbegin(), zone->cards.rend());
|
||||
int size = zone->cards.size();
|
||||
for (int i = start_item; i < start_item + nb_displayed_items && i < (int)(mObjects.size()); i++)
|
||||
{
|
||||
@@ -88,7 +91,7 @@ void CardDisplay::Update(float dt)
|
||||
break;
|
||||
}
|
||||
CardGui * cardg = (CardGui *) mObjects[i];
|
||||
if (cardg->card != zone->cards[i]) update = true;
|
||||
if (cardg->card != newCD[i]) update = true;
|
||||
}
|
||||
}
|
||||
PlayGuiObjectController::Update(dt);
|
||||
|
||||
Reference in New Issue
Block a user