-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:
wagic.the.homebrew@gmail.com
2011-03-02 13:41:24 +00:00
parent 8f9b1d5b8d
commit b021417324
12 changed files with 95 additions and 15 deletions
+14 -1
View File
@@ -43,6 +43,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
life = toughness;
preventable = 0;
flanked = 0;
castMethod = Constants::NOT_CAST;
}
void MTGCardInstance::copy(MTGCardInstance * card)
@@ -146,6 +147,8 @@ void MTGCardInstance::initMTGCI()
damageToController = false;
wasDealtDamage = false;
suspended = false;
castMethod = Constants::NOT_CAST;
for (int i = 0; i < ManaCost::MANA_PAID_WITH_RETRACE +1; i++)
alternateCostPaid[i] = 0;
@@ -883,7 +886,7 @@ int MTGCardInstance::toggleDefenser(MTGCardInstance * opponent)
{
if(opponent->view != NULL)
{
//todo: qoute wololo "change this into a cool blinking effects when opposing creature has cursor focus."
//todo: quote wololo "change this into a cool blinking effects when opposing creature has cursor focus."
opponent->view->actZ += .8f;
opponent->view->actT -= .2f;
}
@@ -896,6 +899,16 @@ int MTGCardInstance::toggleDefenser(MTGCardInstance * opponent)
return 0;
}
bool MTGCardInstance::matchesCastFilter(int castFilter) {
if(castFilter == Constants::CAST_DONT_CARE)
return true; //everything
if(castFilter == Constants::CAST_ALL)
return (castMethod != Constants::NOT_CAST); //everything except "not cast"
if (castFilter == Constants::CAST_ALTERNATE && castMethod > Constants::CAST_NORMALLY)
return true; //all alternate casts
return (castFilter == castMethod);
};
int MTGCardInstance::addProtection(TargetChooser * tc)
{
tc->targetter = NULL;