- added maxCast and maxPlay abilities, this deprecates the following abilities: nospells,nocreatures,onlyonespell,land
I usually don't like to deprecate abilities, but the existing ones, despite having easy to remember names, were really not flexible enough.

If you want to use these old keywords, instead use:
-- nospells  =>  maxCast(*)0
-- onlyOneSpell => maxCast(*)1
--nocreatures => maxCast(creature)0
--land:1 => maxplay(land)+1

note maxPlay and maxCast. They follow similar rules, but maxPlay monitors the number of cards that are going on the Battlefield, while maxCast monitors the stack. In most cases, maxCast should be the one to use, but lands are a special case because they go directly to play.

I unfortunately cannot guarantee I didn't break anything, especially in the AI, but the test suite passes ,and I added a few additional tests yesterday and today, to feel more confident about the change.

next step is removing the creatures keywords that do the same kind of thing (cantcast, etc...) and replace them with maxCast
This commit is contained in:
wagic.the.homebrew@gmail.com
2011-02-13 08:01:13 +00:00
parent 2165a38d3b
commit 8eac9c587e
14 changed files with 333 additions and 364 deletions
+26 -40
View File
@@ -1280,22 +1280,41 @@ public:
int getNumCards();
};
//lands, allows to play more land during a turn:
class AMoreLandPlzUEOT: public InstantAbilityTP
class ACastRestriction: public AbilityTP
{
public:
WParsedInt *additional;
MaxPerTurnRestriction * landsRestriction;
WParsedInt *value; //"maxPerTurn" value
MaxPerTurnRestriction * existingRestriction; // a pointer to the restriction that is being modified or that has been created (for restriction deletion purpose)
TargetChooser * restrictionsScope; //a minimalist TargetChooser object describing the cards impacted by the restriction (for example: lands)
bool modifyExisting; //if set to true, means we want to modify an existing restriction, otherwise we create a new one
int zoneId; // identifier of the zone id impacted by the restriction
Player * targetPlayer; // Reference to the player impacted by the restriction (for restriction deletion purpose)
AMoreLandPlzUEOT(int _id, MTGCardInstance * card, Targetable * _target, WParsedInt * _additional, int who = TargetChooser::UNSET);
ACastRestriction(int _id, MTGCardInstance * card, Targetable * _target, TargetChooser * _restrictionsScope, WParsedInt * _value, bool _modifyExisting, int _zoneId, int who = TargetChooser::UNSET);
int addToGame();
int destroy();
const char * getMenuText();
AMoreLandPlzUEOT * clone() const;
~AMoreLandPlzUEOT();
ACastRestriction * clone() const;
~ACastRestriction();
};
class AInstantCastRestrictionUEOT: public InstantAbilityTP
{
public:
ACastRestriction * ability;
AInstantCastRestrictionUEOT(int _id, MTGCardInstance * card, Targetable * _target, TargetChooser * _restrictionsScope, WParsedInt * _value, bool _modifyExisting, int _zoneId, int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
AInstantCastRestrictionUEOT * clone() const;
~AInstantCastRestrictionUEOT();
};
/*Gives life to target controller*/
class AALifer: public ActivatedAbilityTP
{
@@ -2052,7 +2071,6 @@ public:
a->isClone = 1;
return a;
}
};
//Circle of Protections
@@ -5552,38 +5570,6 @@ public:
AAShuffle * clone() const;
};
//only 1 spell
class AAOnlyOne: public ActivatedAbilityTP
{
public:
AAOnlyOne(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int _tap = 0, int who =
TargetChooser::UNSET);
int resolve();
const char * getMenuText();
AAOnlyOne * clone() const;
};
//nospells
class AANoSpells: public ActivatedAbilityTP
{
public:
AANoSpells(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int _tap = 0, int who =
TargetChooser::UNSET);
int resolve();
const char * getMenuText();
AANoSpells * clone() const;
};
//NoCreature
class AANoCreatures: public ActivatedAbilityTP
{
public:
AANoCreatures(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int _tap = 0, int who =
TargetChooser::UNSET);
int resolve();
const char * getMenuText();
AANoCreatures * clone() const;
};
//Random Discard
class AARandomDiscarder: public ActivatedAbilityTP