Files
wagic/projects/mtg/include/GameStateDuel.h
omegablast2002@yahoo.com d078872dfc this is the first draft of a simple ai combo system,
format is as follows

HINT#combo hold(blah|myhand)^until(blah|mygraveyard)^until(blah|opponentshand)^restriction{type(creature|mybattlefield)~morethan~2}^cast(blah) targeting(blah|mygraveyard)^totalmananneeded({g}{g}{r}{u}{2})

the ai can be told to hold more then one card, until as many condiations as you want are met, until( is a TC and can basically be used in a fasion of saying "hold arbor elf until you have a lord of atlantas in play and a gaint growth in you hand" 

once the condiations are met you can later tell it to cast(gaint growth) targeting(arbor elf[fresh]|mybattlefield)...

I also included the whole of the games restrictions system...
so you can get really really creative with this so far.

the next thing I will do is ability targeting and card favoring.
2012-08-19 21:53:57 +00:00

115 lines
2.6 KiB
C++

#ifndef _GAME_STATE_DUEL_H_
#define _GAME_STATE_DUEL_H_
#include "GameState.h"
#include "SimpleMenu.h"
#include "SimplePopup.h"
#include "DeckMenu.h"
#include "MTGDeck.h"
#include "GameObserver.h"
#ifdef AI_CHANGE_TESTING
#include "Threading.h"
#endif //AI_CHANGE_TESTING
#define CHOOSE_OPPONENT 7
#ifdef TESTSUITE
class TestSuite;
#endif
class Credits;
#ifdef NETWORK_SUPPORT
class JNetwork;
#endif
class GameStateDuel: public GameState, public JGuiListener
{
private:
#ifdef TESTSUITE
TestSuite * testSuite;
#endif
Credits * credits;
int mGamePhase;
Player * mCurrentPlayer;
GameObserver * game;
DeckMenu * deckmenu;
DeckMenu * opponentMenu;
SimpleMenu * menu;
SimplePopup * popupScreen; // used for informational screens, modal
static int selectedPlayerDeckId;
static int selectedAIDeckId;
bool premadeDeck;
int OpponentsDeckid;
string musictrack;
bool MusicExist(string FileName);
void ConstructOpponentMenu(); //loads the opponentMenu if it doesn't exist
void initScroller();
void setGamePhase(int newGamePhase);
public:
GameStateDuel(GameApp* parent);
virtual ~GameStateDuel();
#ifdef TESTSUITE
void loadTestSuitePlayers();
#endif
#ifdef AI_CHANGE_TESTING
int startTime;
int totalTestGames;
int testPlayer2Victories;
int totalAIDecks;
static boost::mutex mMutex;
vector<boost::thread> mWorkerThread;
static void ThreadProc(void* inParam);
void handleResults(GameObserver* aGame){
mMutex.lock();
if (aGame->didWin(aGame->players[1]))
{
testPlayer2Victories++;
totalTestGames++;
}
else if( aGame->didWin(aGame->players[0]))
{
totalTestGames++;
}
mMutex.unlock();
};
#endif
virtual void ButtonPressed(int ControllerId, int ControlId);
virtual void Start();
virtual void End();
virtual void Update(float dt);
virtual void Render();
void initRand(unsigned seed = 0);
void OnScroll(int inXVelocity, int inYVelocity);
enum ENUM_DUEL_STATE_MENU_ITEM
{
MENUITEM_CANCEL = kCancelMenuID,
MENUITEM_NEW_DECK = -10,
MENUITEM_RANDOM_PLAYER = kRandomPlayerMenuID,
MENUITEM_RANDOM_AI = kRandomAIPlayerMenuID,
MENUITEM_MAIN_MENU = -13,
MENUITEM_EVIL_TWIN = kEvilTwinMenuID,
MENUITEM_MULLIGAN = -15,
MENUITEM_UNDO = -16,
#ifdef TESTSUITE
MENUITEM_LOAD = -17,
#endif
#ifdef NETWORK_SUPPORT
MENUITEM_REMOTE_CLIENT = -18,
MENUITEM_REMOTE_SERVER = -19,
#endif
MENUITEM_MORE_INFO = kInfoMenuID
};
};
#endif