fixed issue 632,633 ...

converted {t} into a extra cost. almost all original code to handle it outside remains intact, i plan on slowly migrating to just using the cost...but even just what i changed was a massive headache...anyways as a cost you wont ever have an random bugs where cards don't tap when the ability had {t} in its cost.
while i was at it, i added {q} untap cost.
This commit is contained in:
omegablast2002@yahoo.com
2011-04-18 17:21:06 +00:00
parent 388da9e4bb
commit bf68009674
6 changed files with 152 additions and 36 deletions

View File

@@ -312,6 +312,79 @@ int MillExileCost::doPay()
return 0;
}
//Tap cost
TapCost * TapCost::clone() const
{
TapCost * ec = NEW TapCost(*this);
return ec;
}
TapCost::TapCost() :
ExtraCost("Tap")
{
}
int TapCost::isPaymentSet()
{
if (source && (source->isTapped() || source->hasSummoningSickness()))
{
return 0;
}
return 1;
}
int TapCost::canPay()
{
return isPaymentSet();
}
int TapCost::doPay()
{
MTGCardInstance * _source = (MTGCardInstance *) source;
if (_source)
{
_source->tap();
return 1;
}
return 0;
}
//unTap cost
UnTapCost * UnTapCost::clone() const
{
UnTapCost * ec = NEW UnTapCost(*this);
return ec;
}
UnTapCost::UnTapCost() :
ExtraCost("UnTap")
{
}
int UnTapCost::isPaymentSet()
{
if (source && !source->isTapped())
{
return 0;
}
return 1;
}
int UnTapCost::canPay()
{
return isPaymentSet();
}
int UnTapCost::doPay()
{
MTGCardInstance * _source = (MTGCardInstance *) source;
if (_source)
{
_source->untap();
return 1;
}
return 0;
}
//Tap target cost
TapTargetCost * TapTargetCost::clone() const
{