untap target as cost.
This commit is contained in:
@@ -173,6 +173,15 @@ public:
|
|||||||
virtual int doPay();
|
virtual int doPay();
|
||||||
virtual TapTargetCost * clone() const;
|
virtual TapTargetCost * clone() const;
|
||||||
};
|
};
|
||||||
|
//untap a target as cost
|
||||||
|
class UnTapTargetCost : public ExtraCost
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
UnTapTargetCost(TargetChooser *_tc = NULL);
|
||||||
|
virtual int isPaymentSet();
|
||||||
|
virtual int doPay();
|
||||||
|
virtual UnTapTargetCost * clone() const;
|
||||||
|
};
|
||||||
|
|
||||||
//exile as cost
|
//exile as cost
|
||||||
class ExileTargetCost : public ExtraCost
|
class ExileTargetCost : public ExtraCost
|
||||||
|
|||||||
@@ -469,6 +469,49 @@ int TapTargetCost::doPay()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//untap other as a cost
|
||||||
|
UnTapTargetCost * UnTapTargetCost::clone() const
|
||||||
|
{
|
||||||
|
UnTapTargetCost * ec = NEW UnTapTargetCost(*this);
|
||||||
|
if (tc)
|
||||||
|
ec->tc = tc->clone();
|
||||||
|
return ec;
|
||||||
|
}
|
||||||
|
|
||||||
|
UnTapTargetCost::UnTapTargetCost(TargetChooser *_tc)
|
||||||
|
: ExtraCost("Untap Target", _tc)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int UnTapTargetCost::isPaymentSet()
|
||||||
|
{
|
||||||
|
if (target && !target->isTapped())
|
||||||
|
{
|
||||||
|
tc->removeTarget(target);
|
||||||
|
target->isExtraCostTarget = false;
|
||||||
|
target = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (target)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int UnTapTargetCost::doPay()
|
||||||
|
{
|
||||||
|
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||||
|
source->storedCard = target;
|
||||||
|
if (target)
|
||||||
|
{
|
||||||
|
_target->untap();
|
||||||
|
target = NULL;
|
||||||
|
if (tc)
|
||||||
|
tc->initTargets();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//exile as cost
|
//exile as cost
|
||||||
ExileTargetCost * ExileTargetCost::clone() const
|
ExileTargetCost * ExileTargetCost::clone() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -159,10 +159,15 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'q':
|
case 'q':
|
||||||
|
if(value == "q")
|
||||||
{
|
{
|
||||||
manaCost->addExtraCost(NEW UnTapCost);
|
manaCost->addExtraCost(NEW UnTapCost);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
manaCost->addExtraCost(NEW UnTapTargetCost(tc));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'c': //Counters or cycle
|
case 'c': //Counters or cycle
|
||||||
{
|
{
|
||||||
if(value == "chosencolor")
|
if(value == "chosencolor")
|
||||||
|
|||||||
Reference in New Issue
Block a user