exile zone
player only, todo opponent and ability activation for exile
This commit is contained in:
@@ -19622,8 +19622,8 @@ toughness=4
|
||||
[/card]
|
||||
[card]
|
||||
name=Cranial Archive
|
||||
auto={2}{E}:name(shuffle graveyard) target(player) donothing && moveto(ownerlibrary) and!(shuffle)! all(*|targetedpersonsgraveyard)
|
||||
text={2}, Exile Cranial Archive: Target player shuffles his or her graveyard into his or her library.
|
||||
auto={2}{E}:name(shuffle graveyard) target(player) donothing && moveto(ownerlibrary) and!(shuffle && draw:1 controller)! all(*|targetedpersonsgraveyard)
|
||||
text={2}, Exile Cranial Archive: Target player shuffles his or her graveyard into his or her library. Draw a card.
|
||||
mana={2}
|
||||
type=Artifact
|
||||
[/card]
|
||||
@@ -74363,6 +74363,7 @@ type=Sorcery
|
||||
[/card]
|
||||
[card]
|
||||
name=Preyseizer Dragon
|
||||
abilities=flying
|
||||
auto=may target(<anyamount>other creature|mybattlefield) sacrifice && counter(1/1,2) all(this)
|
||||
auto=@combat(attacking) source(this)::target(creature,player) dynamicability<!chargestrike!>
|
||||
text=Flying -- Devour 2 (As this enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with twice that many +1/+1 counters on it.) -- Whenever Preyseizer Dragon attacks, it deals damage to target creature or player equal to the number of +1/+1 counters on Preyseizer Dragon.
|
||||
|
||||
@@ -7,6 +7,7 @@ struct GuiAvatar;
|
||||
class GuiGraveyard;
|
||||
class GuiLibrary;
|
||||
class GuiOpponentHand;
|
||||
class GuiExile;
|
||||
class GuiAvatars: public GuiLayer
|
||||
{
|
||||
protected:
|
||||
@@ -14,6 +15,7 @@ protected:
|
||||
GuiGraveyard* selfGraveyard, *opponentGraveyard;
|
||||
GuiLibrary* selfLibrary, *opponentLibrary;
|
||||
GuiOpponentHand *opponentHand;
|
||||
GuiExile* selfExile, *opponentExile;
|
||||
GuiAvatar* active;
|
||||
|
||||
public:
|
||||
|
||||
@@ -88,4 +88,14 @@ public:
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
};
|
||||
|
||||
class GuiExile: public GuiGameZone
|
||||
{
|
||||
public:
|
||||
Player * player;
|
||||
GuiExile(float _x, float _y, bool hasFocus, Player * player, GuiAvatars* parent);
|
||||
int receiveEventPlus(WEvent*);
|
||||
int receiveEventMinus(WEvent*);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
};
|
||||
|
||||
#endif // _GUISTATIC_H_
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#define GUI_GRAVEYARD 3
|
||||
#define GUI_LIBRARY 4
|
||||
#define GUI_OPPONENTHAND 5
|
||||
#define GUI_EXILE 6
|
||||
|
||||
#include <JGui.h>
|
||||
#include "WEvent.h"
|
||||
|
||||
@@ -1134,6 +1134,8 @@ void GameObserver::ButtonPressed(PlayGuiObject * target)
|
||||
}
|
||||
else if (GuiGraveyard* graveyard = dynamic_cast<GuiGraveyard*>(target))
|
||||
graveyard->toggleDisplay();
|
||||
else if (GuiExile* exile = dynamic_cast<GuiExile*>(target))
|
||||
exile->toggleDisplay();
|
||||
//opponenthand
|
||||
else if (GuiOpponentHand* opponentHand = dynamic_cast<GuiOpponentHand*>(target))
|
||||
if (opponentHand->showCards)
|
||||
|
||||
@@ -14,6 +14,7 @@ GuiAvatars::GuiAvatars(DuelLayers* duelLayers) :
|
||||
self->zoom = 0.9f;
|
||||
Add(selfGraveyard = NEW GuiGraveyard(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 1, false, mpDuelLayers->getRenderedPlayer(), this));
|
||||
Add(selfLibrary = NEW GuiLibrary(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 5 + GuiGameZone::Height + 5, false, mpDuelLayers->getRenderedPlayer(), this));
|
||||
Add(selfExile = NEW GuiExile(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 + 20, SCREEN_HEIGHT - GuiAvatar::Height, false, mpDuelLayers->getRenderedPlayer(), this));
|
||||
|
||||
Add(opponent = NEW GuiAvatar(0, 0, false, mpDuelLayers->getRenderedPlayerOpponent(), GuiAvatar::TOP_LEFT, this));
|
||||
opponent->zoom = 0.9f;
|
||||
@@ -28,12 +29,13 @@ GuiAvatars::GuiAvatars(DuelLayers* duelLayers) :
|
||||
|
||||
observer->getCardSelector()->Add(self);
|
||||
observer->getCardSelector()->Add(selfGraveyard);
|
||||
observer->getCardSelector()->Add(selfExile);
|
||||
observer->getCardSelector()->Add(selfLibrary);
|
||||
observer->getCardSelector()->Add(opponent);
|
||||
observer->getCardSelector()->Add(opponentGraveyard);
|
||||
observer->getCardSelector()->Add(opponentLibrary);
|
||||
observer->getCardSelector()->Add(opponentHand);
|
||||
selfGraveyard->alpha = selfLibrary->alpha = opponentGraveyard->alpha = opponentLibrary->alpha = opponentHand->alpha = 0;
|
||||
selfGraveyard->alpha = selfExile->alpha = selfLibrary->alpha = opponentGraveyard->alpha = opponentLibrary->alpha = opponentHand->alpha = 0;
|
||||
}
|
||||
|
||||
float GuiAvatars::LeftBoundarySelf()
|
||||
@@ -56,9 +58,9 @@ void GuiAvatars::Activate(PlayGuiObject* c)
|
||||
active = opponent;
|
||||
opponent->zoom = 1.2f;
|
||||
}
|
||||
else if ((selfGraveyard == c) || (selfLibrary == c) || (self == c))
|
||||
else if ((selfGraveyard == c) || (selfExile == c) || (selfLibrary == c) || (self == c))
|
||||
{
|
||||
selfGraveyard->alpha = selfLibrary->alpha = 128.0f;
|
||||
selfGraveyard->alpha = selfExile->alpha = selfLibrary->alpha = 128.0f;
|
||||
self->zoom = 1.0f;
|
||||
active = self;
|
||||
}
|
||||
@@ -75,9 +77,9 @@ void GuiAvatars::Deactivate(PlayGuiObject* c)
|
||||
opponent->zoom = 0.9f;
|
||||
active = NULL;
|
||||
}
|
||||
else if ((selfGraveyard == c) || (selfLibrary == c) || (self == c))
|
||||
else if ((selfGraveyard == c) || (selfExile == c) || (selfLibrary == c) || (self == c))
|
||||
{
|
||||
selfGraveyard->alpha = selfLibrary->alpha = 0;
|
||||
selfGraveyard->alpha = selfExile->alpha = selfLibrary->alpha = 0;
|
||||
self->zoom = 0.5f;
|
||||
active = NULL;
|
||||
}
|
||||
@@ -85,12 +87,13 @@ void GuiAvatars::Deactivate(PlayGuiObject* c)
|
||||
|
||||
int GuiAvatars::receiveEventPlus(WEvent* e)
|
||||
{
|
||||
return selfGraveyard->receiveEventPlus(e) | opponentGraveyard->receiveEventPlus(e) | opponentHand->receiveEventPlus(e);
|
||||
return selfGraveyard->receiveEventPlus(e) | selfExile->receiveEventPlus(e) | opponentGraveyard->receiveEventPlus(e) | opponentHand->receiveEventPlus(e);
|
||||
}
|
||||
|
||||
int GuiAvatars::receiveEventMinus(WEvent* e)
|
||||
{
|
||||
selfGraveyard->receiveEventMinus(e);
|
||||
selfExile->receiveEventMinus(e);
|
||||
opponentGraveyard->receiveEventMinus(e);
|
||||
opponentHand->receiveEventMinus(e);
|
||||
return 1;
|
||||
@@ -104,6 +107,8 @@ bool GuiAvatars::CheckUserInput(JButton key)
|
||||
return true;
|
||||
if (selfGraveyard->CheckUserInput(key))
|
||||
return true;
|
||||
if (selfExile->CheckUserInput(key))
|
||||
return true;
|
||||
if (opponentGraveyard->CheckUserInput(key))
|
||||
return true;
|
||||
if (opponentHand->CheckUserInput(key))
|
||||
@@ -120,6 +125,7 @@ void GuiAvatars::Update(float dt)
|
||||
self->Update(dt);
|
||||
opponent->Update(dt);
|
||||
selfGraveyard->Update(dt);
|
||||
selfExile->Update(dt);
|
||||
opponentHand->Update(dt);
|
||||
opponentGraveyard->Update(dt);
|
||||
selfLibrary->Update(dt);
|
||||
|
||||
@@ -298,6 +298,52 @@ ostream& GuiGraveyard::toString(ostream& out) const
|
||||
return out << "GuiGraveyard :::";
|
||||
}
|
||||
|
||||
GuiExile::GuiExile(float x, float y, bool hasFocus, Player * player, GuiAvatars* parent) :
|
||||
GuiGameZone(x, y, hasFocus, player->game->exile, parent), player(player)
|
||||
{
|
||||
type = GUI_EXILE;
|
||||
}
|
||||
|
||||
int GuiExile::receiveEventPlus(WEvent* e)
|
||||
{
|
||||
if (WEventZoneChange* event = dynamic_cast<WEventZoneChange*>(e))
|
||||
if (event->to == zone)
|
||||
{
|
||||
CardView* t;
|
||||
if (event->card->view)
|
||||
t = NEW CardView(CardView::nullZone, event->card, *(event->card->view));
|
||||
else
|
||||
t = NEW CardView(CardView::nullZone, event->card, x, y);
|
||||
t->x = x + Width / 2;
|
||||
t->y = y + Height / 2;
|
||||
t->zoom = 0.6f;
|
||||
t->alpha = 0;
|
||||
cards.push_back(t);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GuiExile::receiveEventMinus(WEvent* e)
|
||||
{
|
||||
if (WEventZoneChange* event = dynamic_cast<WEventZoneChange*>(e))
|
||||
if (event->from == zone)
|
||||
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
|
||||
if (event->card->previous == (*it)->card)
|
||||
{
|
||||
CardView* cv = *it;
|
||||
cards.erase(it);
|
||||
zone->owner->getObserver()->mTrash->trash(cv);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ostream& GuiExile::toString(ostream& out) const
|
||||
{
|
||||
return out << "GuiExile :::";
|
||||
}
|
||||
|
||||
//opponenthand begins
|
||||
GuiOpponentHand::GuiOpponentHand(float x, float y, bool hasFocus, Player * player, GuiAvatars* parent) :
|
||||
GuiGameZone(x, y, hasFocus, player->game->hand, parent), player(player)
|
||||
|
||||
Reference in New Issue
Block a user