Separated PT Modifiers, Fixed Changeling, Modified Counter as a cost
CDA Todo
This commit is contained in:
@@ -56,8 +56,9 @@ int Counter::added()
|
||||
{
|
||||
if (power != 0 || toughness != 0)
|
||||
{
|
||||
target->power += power;
|
||||
target->addToToughness(toughness);
|
||||
target->pbonus += power;
|
||||
target->tbonus += toughness;
|
||||
target->applyPTL();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -66,8 +67,9 @@ int Counter::removed()
|
||||
{
|
||||
if (power != 0 || toughness != 0)
|
||||
{
|
||||
target->power -= power;
|
||||
target->addToToughness(-toughness);
|
||||
target->pbonus -= power;
|
||||
target->tbonus -= toughness;
|
||||
target->applyPTL();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -85,7 +87,7 @@ Counters::~Counters()
|
||||
}
|
||||
}
|
||||
|
||||
int Counters::addCounter(const char * _name, int _power, int _toughness)
|
||||
int Counters::addCounter(const char * _name, int _power, int _toughness, bool _noevent)
|
||||
{
|
||||
/*420.5n If a permanent has both a +1/+1 counter and a -1/-1 counter on it, N +1/+1 and N -1/-1 counters are removed from it, where N is the smaller of the number of +1/+1 and -1/-1 counters on it.*/
|
||||
GameObserver *g = target->getObserver();
|
||||
@@ -109,9 +111,12 @@ int Counters::addCounter(const char * _name, int _power, int _toughness)
|
||||
Counter * counter = NEW Counter(target, _name, _power, _toughness);
|
||||
counters.push_back(counter);
|
||||
counter->added();
|
||||
WEvent * w = NEW WEventCounters(this,_name,_power,_toughness,true,false);
|
||||
dynamic_cast<WEventCounters*>(w)->targetCard = this->target;
|
||||
g->receiveEvent(w);
|
||||
if (!_noevent)
|
||||
{
|
||||
WEvent * w = NEW WEventCounters(this,_name,_power,_toughness,true,false);
|
||||
dynamic_cast<WEventCounters*>(w)->targetCard = this->target;
|
||||
g->receiveEvent(w);
|
||||
}
|
||||
mCount++;
|
||||
this->target->doDamageTest = 1;
|
||||
this->target->afterDamage();
|
||||
@@ -122,7 +127,12 @@ int Counters::addCounter(const char * _name, int _power, int _toughness)
|
||||
|
||||
int Counters::addCounter(int _power, int _toughness)
|
||||
{
|
||||
return addCounter("", _power, _toughness);
|
||||
return addCounter("", _power, _toughness, false);
|
||||
}
|
||||
|
||||
int Counters::addCounter(int _power, int _toughness, bool _noevent)
|
||||
{
|
||||
return addCounter("", _power, _toughness, _noevent);
|
||||
}
|
||||
|
||||
int Counters::init()
|
||||
|
||||
Reference in New Issue
Block a user