removed a compile error, variables that were unreferenced.

small add with big impact:
added the useage of castrestriction on triggers and activated abilities. 
this can be used to create such cards as library of alexandria. 
{t}:draw:1 restriction{type(*|myhand)~equalto~7}
and replace instances were we were putting false triggers on the stack from abilities which contained nested aslongas...
meaning cards like epic struggle, won't need to be triggered every turn even if you have no creatures...
for epic struggle here is an example of how to replace it
@each myupkeep restriction{type(creature|mybattlefield)~morethan~19}:wingame controller
any of the current cast and other restrictions can be used. this includes turn:1 <===and various others such as phase based checking.
syntax is 
restriction{ whatever casting/other restriction you want }
a nice quality of life fix for false triggers (which don't mean theyre incorrect, just annoying when they trigger when they will do nothing)
another example would be the triggers on cards like 
skullcage.
auto=@each opponent upkeep:aslongas(*|opponenthand) damage:2 opponent >4
auto=@each opponent upkeep:aslongas(*|opponenthand) damage:2 opponent <3
becomes
auto=@each opponent upkeep restriction{type(*|opponenthand)~morethan~4}:damage:2 opponent
auto=@each opponent upkeep restriction{type(*|opponenthand)~lessthan~3}:damage:2 opponent

now instead of triggering every opponent upkeep even without a resolve...it will only triggers when the restriction requirement is met.

enjoy :)
note:all test pass.
This commit is contained in:
omegablast2002@yahoo.com
2011-09-09 10:34:05 +00:00
parent 4e3a1ff862
commit 1fefc33777
5 changed files with 54 additions and 22 deletions

View File

@@ -244,6 +244,7 @@ public:
virtual int resolve() = 0;
virtual TriggeredAbility* clone() const = 0;
virtual ostream& toString(ostream& out) const;
string castRestriction;
};
@@ -333,8 +334,9 @@ public:
MTGAbility* sa;
string usesBeforeSideEffects;
int uses;
string castRestriction;
ActivatedAbility(int id, MTGCardInstance* card, ManaCost* _cost = NULL, int _restrictions = NO_RESTRICTION, string limit = "", MTGAbility* sideEffect = NULL, string usesBeforeSideEffects = "");
ActivatedAbility(int id, MTGCardInstance* card, ManaCost* _cost = NULL, int _restrictions = NO_RESTRICTION, string limit = "", MTGAbility* sideEffect = NULL, string usesBeforeSideEffects = "",string castRestriction = "");
virtual ~ActivatedAbility();
virtual void Update(float dt)
@@ -358,8 +360,8 @@ public:
class TargetAbility : public ActivatedAbility, public NestedAbility
{
public:
TargetAbility(int id, MTGCardInstance * card, TargetChooser * _tc,ManaCost * _cost = NULL, int _playerturnonly = 0);
TargetAbility(int id, MTGCardInstance * card,ManaCost * _cost = NULL, int _playerturnonly = 0);
TargetAbility(int id, MTGCardInstance * card, TargetChooser * _tc,ManaCost * _cost = NULL, int _playerturnonly = 0, string castRestriction = "");
TargetAbility(int id, MTGCardInstance * card,ManaCost * _cost = NULL, int _playerturnonly = 0, string castRestriction = "");
~TargetAbility();
virtual int reactToClick(MTGCardInstance * card);