Erwan
-fix for issue 604 (Land play limitation should not apply in all cases) -- this adds a "castMehod" variable to MTGCardInstance. IF this variable is 0, the card was not "cast" (or for lands, "put into play" as part of the lands rule), but "added" to the battlefield with some other effect. On the other hand, if this variable is set, it means the card was cast -- as we discussed, I did not touch the "alternateCostPaid" variable, as I'm still not really sure these two concepts are actually the same
This commit is contained in:
@@ -4746,7 +4746,7 @@ public:
|
||||
{
|
||||
|
||||
counter = NEW TypeTargetChooser("land");
|
||||
landsPlayedThisTurn = source->controller()->game->inPlay->seenThisTurn(counter);
|
||||
landsPlayedThisTurn = source->controller()->game->inPlay->seenThisTurn(counter, Constants::CAST_ALL);
|
||||
PlayRestrictions * restrictions = source->controller()->game->playRestrictions;
|
||||
landsRestriction = restrictions->getMaxPerTurnRestrictionByTargetChooser(counter);
|
||||
restrictions->removeRestriction(landsRestriction);
|
||||
@@ -4764,7 +4764,7 @@ public:
|
||||
|
||||
int trigger()
|
||||
{
|
||||
int landsPlayedThisTurnUpdated = source->controller()->game->inPlay->seenThisTurn(counter);
|
||||
int landsPlayedThisTurnUpdated = source->controller()->game->inPlay->seenThisTurn(counter, Constants::CAST_ALL);
|
||||
if (landsPlayedThisTurnUpdated > 1 && landsPlayedThisTurnUpdated > landsPlayedThisTurn)
|
||||
{
|
||||
landsPlayedThisTurn = landsPlayedThisTurnUpdated;
|
||||
|
||||
@@ -46,6 +46,7 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
|
||||
int XX;
|
||||
int alternateCostPaid[ManaCost::MANA_PAID_WITH_RETRACE + 1];
|
||||
int paymenttype;
|
||||
int castMethod; /* Tells if the card reached its current zone by being cast or not (brought into the zone by an effect). non 0 == cast, 0 == not cast */
|
||||
int frozen;
|
||||
int sunburst;
|
||||
int equipment;
|
||||
@@ -94,6 +95,9 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
|
||||
MTGCardInstance * next;
|
||||
int doDamageTest;
|
||||
int summoningSickness;
|
||||
|
||||
bool matchesCastFilter(int castMethod);
|
||||
|
||||
// The recommended method to test for summoning Sickness !
|
||||
int hasSummoningSickness();
|
||||
MTGCardInstance * changeController(Player * newcontroller);
|
||||
|
||||
@@ -228,6 +228,23 @@ SNOWSWAMPWALK = 90,
|
||||
|
||||
};
|
||||
|
||||
enum{
|
||||
NOT_CAST = 0,
|
||||
CAST_NORMALLY = 1,
|
||||
CAST_WITH_KICKER = 2,
|
||||
CAST_WITH_ALTERNATIVE = 3,
|
||||
CAST_WITH_BUYBACK = 4,
|
||||
CAST_WITH_FLASHBACK = 5,
|
||||
CAST_WITH_RETRACE = 6,
|
||||
CAST_WITH_MORPH = 7,
|
||||
CAST_WITH_SUSPEND = 8,
|
||||
|
||||
CAST_ALTERNATE = -1, //matches all alternate costs, including itself
|
||||
CAST_ALL = -2, // matches everything except NOT_CAST
|
||||
CAST_DONT_CARE = -3 //matches everything
|
||||
|
||||
};
|
||||
|
||||
static char MTGColorChars[];
|
||||
static const char* MTGColorStrings[];
|
||||
static int _r[], _g[], _b[];
|
||||
|
||||
@@ -99,8 +99,8 @@ class MTGGameZone {
|
||||
int hasX();
|
||||
|
||||
//How many cards matching a TargetChooser have been put in this zone during the turn
|
||||
int seenThisTurn(TargetChooser * tc);
|
||||
int seenThisTurn(string s);
|
||||
int seenThisTurn(TargetChooser * tc, int castFilter = Constants::CAST_DONT_CARE);
|
||||
int seenThisTurn(string s, int castFilter = Constants::CAST_DONT_CARE);
|
||||
|
||||
void setOwner(Player * player);
|
||||
MTGCardInstance * lastCardDrawn;
|
||||
|
||||
Reference in New Issue
Block a user