Fix Cost Increaser, Cost Reducer
Should fix most of them. TODO: Trinisphere and Morph...
This commit is contained in:
@@ -4174,13 +4174,11 @@ int AAlterCost::testDestroy()
|
||||
{
|
||||
if (amount > 0)
|
||||
{
|
||||
_target->getIncreasedManaCost()->remove(type,amount);
|
||||
refreshCost(_target);//special case for 0 cost.
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
_target->getReducedManaCost()->remove(type,abs(amount));
|
||||
refreshCost(_target);//special case for 0 cost.
|
||||
;
|
||||
}
|
||||
return MTGAbility::testDestroy();
|
||||
}
|
||||
@@ -4190,8 +4188,10 @@ void AAlterCost::refreshCost(MTGCardInstance * card)
|
||||
{
|
||||
ManaCost * original = NEW ManaCost();
|
||||
original->copy(card->model->data->getManaCost());
|
||||
original->add(card->getIncreasedManaCost());
|
||||
original->remove(card->getReducedManaCost());
|
||||
if(card->getIncreasedManaCost()->getConvertedCost())
|
||||
original->add(card->getIncreasedManaCost());
|
||||
if(card->getReducedManaCost()->getConvertedCost())
|
||||
original->remove(card->getReducedManaCost());
|
||||
card->getManaCost()->copy(original);
|
||||
delete original;
|
||||
return;
|
||||
@@ -4203,14 +4203,6 @@ void AAlterCost::increaseTheCost(MTGCardInstance * card)
|
||||
for(int k = Constants::MTG_COLOR_ARTIFACT; k < Constants::NB_Colors;k++)
|
||||
{
|
||||
card->getManaCost()->add(k,card->getIncreasedManaCost()->getCost(k));
|
||||
if (card->getManaCost()->getAlternative())
|
||||
{
|
||||
card->getManaCost()->getAlternative()->add(k,card->getIncreasedManaCost()->getCost(k));
|
||||
}
|
||||
if (card->getManaCost()->getBuyback())
|
||||
{
|
||||
card->getManaCost()->getBuyback()->add(k,card->getIncreasedManaCost()->getCost(k));
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -4223,14 +4215,6 @@ void AAlterCost::decreaseTheCost(MTGCardInstance * card)
|
||||
for(int k = Constants::MTG_COLOR_ARTIFACT; k < Constants::NB_Colors;k++)
|
||||
{
|
||||
card->getManaCost()->remove(k,card->getReducedManaCost()->getCost(k));
|
||||
if (card->getManaCost()->getAlternative())
|
||||
{
|
||||
card->getManaCost()->getAlternative()->remove(k,card->getReducedManaCost()->getCost(k));
|
||||
}
|
||||
if (card->getManaCost()->getBuyback())
|
||||
{
|
||||
card->getManaCost()->getBuyback()->remove(k,card->getReducedManaCost()->getCost(k));
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user