- fixed issue 595 (MaxCast not working). Root cause was the stupidest typo ever in the code (maxCost instead of maxCast...) - fixed an issue with Storm mentioned by zethfox (was counting only spells played by current player) - Moved "max lands per turn" rule outside of the code (yay!) Please be sure to update your Rules folder!
56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
#ifndef _PLAY_RESTRICTIONS_H_
|
|
#define _PLAY_RESTRICTIONS_H_
|
|
|
|
|
|
class TargetChooser;
|
|
class MTGCardInstance;
|
|
class MTGGameZone;
|
|
|
|
class PlayRestriction
|
|
{
|
|
|
|
public:
|
|
|
|
enum
|
|
{
|
|
CAN_PLAY,
|
|
CANT_PLAY,
|
|
NO_OPINION
|
|
};
|
|
|
|
TargetChooser * tc;
|
|
|
|
virtual int canPutIntoZone(MTGCardInstance * card, MTGGameZone * destZone) = 0;
|
|
|
|
PlayRestriction(TargetChooser * tc);
|
|
~PlayRestriction();
|
|
};
|
|
|
|
class MaxPerTurnRestriction: public PlayRestriction
|
|
{
|
|
public:
|
|
enum
|
|
{
|
|
NO_MAX = -1,
|
|
};
|
|
int maxPerTurn;
|
|
MTGGameZone * zone;
|
|
MaxPerTurnRestriction(TargetChooser * tc, int maxPerTurn, MTGGameZone * zone);
|
|
int canPutIntoZone(MTGCardInstance * card, MTGGameZone * destZone);
|
|
};
|
|
|
|
|
|
class PlayRestrictions
|
|
{
|
|
protected:
|
|
vector<PlayRestriction *>restrictions;
|
|
public:
|
|
MaxPerTurnRestriction * getMaxPerTurnRestrictionByTargetChooser(TargetChooser * tc);
|
|
|
|
void addRestriction(PlayRestriction * restriction);
|
|
void removeRestriction(PlayRestriction * restriction);
|
|
int canPutIntoZone(MTGCardInstance * card, MTGGameZone * destZone);
|
|
~PlayRestrictions();
|
|
|
|
};
|
|
#endif |