Update this(X) so that it works with spells as well as activated abilities. Also fixed a bug were this(X) did not work with targeting.
Adds Martial Coup
This commit is contained in:
@@ -1971,6 +1971,7 @@ void TargetAbility::Render(){
|
||||
int TargetAbility::resolve(){
|
||||
Targetable * t = tc->getNextTarget();
|
||||
if (t && ability){
|
||||
source->X = abilityCost->Diff(cost)->hasX();
|
||||
ability->target = t;
|
||||
if (ability->oneShot) return ability->resolve();
|
||||
MTGAbility * a = ability->clone();
|
||||
|
||||
@@ -90,6 +90,7 @@ int MTGCardInstance::init(){
|
||||
MTGCard::init();
|
||||
CardPrimitive::init();
|
||||
data = this;
|
||||
X = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -212,6 +212,7 @@ MTGCardInstance * MTGGameZone::removeCard(MTGCardInstance * card, int createCopy
|
||||
copy->previous = card;
|
||||
copy->view = card->view;
|
||||
copy->isToken = card->isToken;
|
||||
copy->X = card->X;
|
||||
|
||||
//stupid bug with tokens...
|
||||
if (card->model == card)
|
||||
|
||||
@@ -70,6 +70,7 @@ int MTGPutInPlayRule::reactToClick(MTGCardInstance * card){
|
||||
}else{
|
||||
spell = game->mLayers->stackLayer()->addSpell(copy,NULL, spellCost, payResult);
|
||||
}
|
||||
copy->X = spell->computeX(copy);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -159,13 +159,11 @@ ThisDescriptor * ThisDescriptorFactory::createThisDescriptor(string s){
|
||||
}
|
||||
|
||||
ThisCounter::ThisCounter(Counter * _counter){
|
||||
compareAbility = 0;
|
||||
counter = _counter;
|
||||
comparisonCriterion = counter->nb;
|
||||
}
|
||||
|
||||
ThisCounter::ThisCounter(int power, int toughness, int nb, const char * name){
|
||||
compareAbility = 0;
|
||||
counter = NEW Counter(NULL,name,power,toughness);
|
||||
comparisonCriterion = nb;
|
||||
}
|
||||
@@ -197,7 +195,6 @@ ThisCounter::~ThisCounter() {
|
||||
}
|
||||
|
||||
ThisPower::ThisPower(int power){
|
||||
compareAbility = 0;
|
||||
comparisonCriterion = power;
|
||||
}
|
||||
|
||||
@@ -206,7 +203,6 @@ int ThisPower::match(MTGCardInstance * card){
|
||||
}
|
||||
|
||||
ThisToughness::ThisToughness(int toughness){
|
||||
compareAbility = 0;
|
||||
comparisonCriterion = toughness;
|
||||
}
|
||||
|
||||
@@ -215,7 +211,6 @@ int ThisToughness::match(MTGCardInstance * card){
|
||||
}
|
||||
|
||||
ThisCounterAny::ThisCounterAny(int nb){
|
||||
compareAbility = 0;
|
||||
comparisonCriterion = nb;
|
||||
}
|
||||
|
||||
@@ -229,9 +224,8 @@ int ThisCounterAny::match(MTGCardInstance * card){
|
||||
|
||||
ThisX::ThisX(int x){
|
||||
comparisonCriterion = x;
|
||||
compareAbility = 1;
|
||||
}
|
||||
|
||||
int ThisX::match(MTGAbility * ability){
|
||||
return matchValue(ability->cost->hasX());
|
||||
int ThisX::match(MTGCardInstance * card){
|
||||
return matchValue(card->X);
|
||||
}
|
||||
Reference in New Issue
Block a user