- deprecated the following keywords (see list below for new usage)
-- cantcreaturecast => auto=maxCast(creature)0
-- cantspellcast => auto=maxCast(*)0
-- onlyonecast => auto=maxCast(*)1
-- bothcantcast => auto=maxCast(*)0 auto=maxCast(*)0 opponent
-- bothnocreature => auto=maxCast(creature)0 auto=maxCast(creature)0 opponent
-- oneboth => auto=maxCast(*)1 auto=maxCast(*)1 opponent
Strangely enough, I couldn't find most of these keywords in mtg.txt?
I also removed variables such as "spellCastedThisTurn" and stuff like that... now if you want to know how many spells were cast in one turn by a given player, use player->game->stack->seenThisTurn("*").
seenThisTurn can take a string representing a TargetChooser, or better, a TargetChooser.
I can't guarantee I didn't break anything, but the test suite passes and the AI seems to run ok
109 lines
1.9 KiB
C++
109 lines
1.9 KiB
C++
#ifndef _PLAYER_H_
|
|
#define _PLAYER_H_
|
|
|
|
#include "JGE.h"
|
|
#include "MTGGameZones.h"
|
|
#include "Damage.h"
|
|
#include "Targetable.h"
|
|
|
|
class MTGDeck;
|
|
class MTGPlayerCards;
|
|
class MTGInPlay;
|
|
class ManaPool;
|
|
|
|
class Player: public Damageable
|
|
{
|
|
protected:
|
|
ManaPool * manaPool;
|
|
|
|
public:
|
|
enum ENUM_PLAY_MODE
|
|
{
|
|
MODE_TEST_SUITE,
|
|
MODE_HUMAN,
|
|
MODE_AI
|
|
};
|
|
|
|
JTexture * mAvatarTex;
|
|
JQuadPtr mAvatar;
|
|
int playMode;
|
|
bool nomaxhandsize;
|
|
bool isPoisoned;
|
|
MTGPlayerCards * game;
|
|
string deckFile;
|
|
string deckFileSmall;
|
|
string deckName;
|
|
|
|
Player(MTGDeck * deck, string deckFile, string deckFileSmall);
|
|
virtual ~Player();
|
|
|
|
virtual void End();
|
|
virtual int displayStack()
|
|
{
|
|
return 1;
|
|
}
|
|
const string getDisplayName() const;
|
|
int typeAsTarget()
|
|
{
|
|
return TARGET_PLAYER;
|
|
}
|
|
|
|
int afterDamage();
|
|
|
|
int gainLife(int value);
|
|
int loseLife(int value);
|
|
int gainOrLoseLife(int value);
|
|
|
|
int poisoned();
|
|
int damaged();
|
|
int prevented();
|
|
void unTapPhase();
|
|
MTGInPlay * inPlay();
|
|
ManaPool * getManaPool();
|
|
void takeMulligan();
|
|
|
|
void cleanupPhase();
|
|
virtual int Act(float dt)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
virtual int isAI()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
Player * opponent();
|
|
int getId();
|
|
JQuadPtr getIcon();
|
|
|
|
virtual int receiveEvent(WEvent * event)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
virtual void Render()
|
|
{
|
|
}
|
|
|
|
void loadAvatar(string file);
|
|
|
|
/**
|
|
** Returns the path to the stats file of currently selected deck.
|
|
*/
|
|
std::string GetCurrentDeckStatsFile();
|
|
};
|
|
|
|
class HumanPlayer: public Player
|
|
{
|
|
public:
|
|
HumanPlayer(MTGDeck * deck, string deckFile, string deckFileSmall);
|
|
HumanPlayer(string deckFile);
|
|
|
|
};
|
|
|
|
ostream& operator<<(ostream&, const Player&);
|
|
istream& operator>>(istream& in, Player& p);
|
|
|
|
#endif
|