added "offerinterruptonphase=blah" to the parsing of the rules.txt files...the reason i want to handle it inside the rules.txt.... originally i was going to use the options variable for this, then i realized that if i use that variable, it would apply it to every game mode and peoples custom games...so instead i added the parsing in the actual rules.txt files, this way, if we want to offer interrupt on phase blah to MTG, but NOT have this interrupt offered in a mod or different mode, or if the different mod or mode should offer you a chance to interrupt ai in a different phase ...you can set each rule to interrupt in the phase you want... now for the reason i added it in the first place...previously we were allowed an interrupt when the opponent drew a card in the draw step, this gave us a chance to do stuff on opponents turn.... recently wololo i beleave made draw actions not use the stack anymore(which was a good change, since as per MTG rules the actions of drawing is not a stack action)...but as a side-effect, we lose our chance to interrupt ai and do stuff on ais turn.... also, changed the ingame bonus thing, to start recording stuff towards bonuses on turn 2+...this solves reported issues with story mode "setting up" causing massive bonuses to be gained for doing nothing.....
111 lines
1.9 KiB
C++
111 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;
|
|
MTGDeck * mDeck;
|
|
string deckFile;
|
|
string deckFileSmall;
|
|
string deckName;
|
|
string phaseRing;
|
|
int offerInterruptOnPhase;
|
|
Player(string deckFile, string deckFileSmall, MTGDeck * deck = NULL);
|
|
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(string deckFile, string deckFileSmall, MTGDeck * deck = NULL);
|
|
HumanPlayer(string deckFile);
|
|
|
|
};
|
|
|
|
ostream& operator<<(ostream&, const Player&);
|
|
istream& operator>>(istream& in, Player& p);
|
|
|
|
#endif
|