Improved Commander format card selection rule, added new keyword

"autocommandzone=" to trigger abilities from Command Zone (e.g. Commander Ninjutsu), added/fixed some primitives, added a new GUI Button to show Player's Sideboard.
This commit is contained in:
valfieri
2020-12-08 20:48:11 +01:00
parent d18232df10
commit 7c696ac213
25 changed files with 207 additions and 74 deletions
+1 -1
View File
@@ -429,7 +429,7 @@ private:
for (int i = 0; i < 2; i++)
{
Player * p = card->getObserver()->players[i];
MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->exile, p->game->sideboard, p->game->commandzone };//wish cards use sideboard
MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->exile, p->game->commandzone, p->game->sideboard };//wish cards use sideboard
for (int k = 0; k < 7; k++)
{
MTGGameZone * zone = zones[k];
+1
View File
@@ -133,6 +133,7 @@ class GameObserver{
int isInPlay(MTGCardInstance * card);
int isInGrave(MTGCardInstance * card);
int isInExile(MTGCardInstance * card);
int isInCommandZone(MTGCardInstance * card);
int isInHand(MTGCardInstance * card);
int isInLibrary(MTGCardInstance * card);
virtual void Update(float dt);
+2
View File
@@ -9,6 +9,7 @@ class GuiLibrary;
class GuiOpponentHand;
class GuiExile;
class GuiCommandZone;
class GuiSideboard;
class GuiAvatars: public GuiLayer
{
protected:
@@ -18,6 +19,7 @@ protected:
GuiOpponentHand *opponentHand;
GuiExile* selfExile, *opponentExile;
GuiCommandZone* selfCommandZone, *opponentCommandZone;
GuiSideboard* selfSideboard;
GuiAvatar* active;
public:
+10
View File
@@ -108,4 +108,14 @@ public:
virtual ostream& toString(ostream& out) const;
};
class GuiSideboard: public GuiGameZone
{
public:
Player * player;
GuiSideboard(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_
+1
View File
@@ -104,6 +104,7 @@ public:
bool handEffects;
bool graveEffects;
bool exileEffects;
bool commandZoneEffects;
bool suspended;
bool miracle;
bool hasCopiedToken;
+1
View File
@@ -23,6 +23,7 @@ typedef enum
GAME_TYPE_DEMO,
GAME_TYPE_STONEHEWER,
GAME_TYPE_HERMIT,
GAME_TYPE_COMMANDER,
#ifdef NETWORK_SUPPORT
GAME_TYPE_SLAVE,
+1 -1
View File
@@ -230,7 +230,7 @@ public:
MTGPlayerCards(MTGDeck * deck);
~MTGPlayerCards();
void initGame(int shuffle = 1, int draw = 1);
void OptimizedHand(Player * who,int amount = 7,int lands = 3,int creatures = 0,int othercards = 4);
void OptimizedHand(Player * who,int amount = 7,int lands = 3,int creatures = 0,int othercards = 4);
void setOwner(Player * player);
void discardRandom(MTGGameZone * from,MTGCardInstance * source);
void drawFromLibrary();
+1
View File
@@ -12,6 +12,7 @@
#define GUI_OPPONENTHAND 5
#define GUI_EXILE 6
#define GUI_COMMANDZONE 7
#define GUI_SIDEBOARD 8
#include <JGui.h>
#include "WEvent.h"