ai bug fixes, minor refactor of phaseaction/phaseactionmulti/upcost/upcostmulti, counter cost was safed wrong, sorry!, and fixed parsing of upcost..it was chopping the last bracket of the cost when used for things like echo, it required us to add {0} to those cost...that is no longer required.

This commit is contained in:
omegablast2002@yahoo.com
2011-09-14 20:35:04 +00:00
parent 9c9ce69259
commit d04b4eca38
4 changed files with 111 additions and 181 deletions
+6 -5
View File
@@ -621,16 +621,17 @@ int CounterCost::isPaymentSet()
int CounterCost::canPay()
{
// if target needs to be chosen, then move on.
if(!target)
return 0;
if (tc)
return 1;
if (counter->nb >= 0)
return 1; //add counters always possible
// otherwise, move on only if target has enough counters
Counter * targetCounter = target->counters->hasCounter(counter->name.c_str(), counter->power, counter->toughness);
if (targetCounter && targetCounter->nb >= -counter->nb)
return 1;
if(target)
{
Counter * targetCounter = target->counters->hasCounter(counter->name.c_str(), counter->power, counter->toughness);
if (targetCounter && targetCounter->nb >= -counter->nb)
return 1;
}
return 0;
}