you can't pay life which you do not have as life payments.
This commit is contained in:
@@ -57,7 +57,7 @@ public:
|
|||||||
class LifeCost: public ExtraCost{
|
class LifeCost: public ExtraCost{
|
||||||
public:
|
public:
|
||||||
LifeCost(TargetChooser *_tc = NULL);
|
LifeCost(TargetChooser *_tc = NULL);
|
||||||
|
virtual int canPay();
|
||||||
virtual int doPay();
|
virtual int doPay();
|
||||||
virtual LifeCost * clone() const;
|
virtual LifeCost * clone() const;
|
||||||
};
|
};
|
||||||
@@ -66,6 +66,7 @@ class LifeorManaCost: public ExtraCost{
|
|||||||
public:
|
public:
|
||||||
LifeorManaCost(TargetChooser *_tc = NULL,string manaType = "");
|
LifeorManaCost(TargetChooser *_tc = NULL,string manaType = "");
|
||||||
string manaType;
|
string manaType;
|
||||||
|
virtual int canPay();
|
||||||
virtual int doPay();
|
virtual int doPay();
|
||||||
virtual LifeorManaCost * clone() const;
|
virtual LifeorManaCost * clone() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -74,6 +74,16 @@ LifeCost::LifeCost(TargetChooser *_tc) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LifeCost::canPay()
|
||||||
|
{
|
||||||
|
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||||
|
if(_target->controller()->life <= 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int LifeCost::doPay()
|
int LifeCost::doPay()
|
||||||
{
|
{
|
||||||
if (!target)
|
if (!target)
|
||||||
@@ -101,6 +111,16 @@ LifeorManaCost::LifeorManaCost(TargetChooser *_tc,string manaType) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LifeorManaCost::canPay()
|
||||||
|
{
|
||||||
|
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||||
|
if(_target->controller()->life <= 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int LifeorManaCost::doPay()
|
int LifeorManaCost::doPay()
|
||||||
{
|
{
|
||||||
if (!target)
|
if (!target)
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ void GameObserver::gameStateBasedEffects()
|
|||||||
for (int j = 0; j < nbcards; ++j)
|
for (int j = 0; j < nbcards; ++j)
|
||||||
{
|
{
|
||||||
MTGCardInstance * c = z->cards[j];
|
MTGCardInstance * c = z->cards[j];
|
||||||
if (c->has(Constants::CANTLOSE) || (c->has(Constants::CANTLIFELOSE && players[i]->poisonCount < 10)))
|
if (c->has(Constants::CANTLOSE) || (c->has(Constants::CANTLIFELOSE) && players[i]->poisonCount < 10))
|
||||||
{
|
{
|
||||||
cantlosers++;
|
cantlosers++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user