Trinisphere

TODO: Morph and Kicker... Morph can be done but how to implement the
increased total cost with kicker? multi kicker? manual kicker??? Count
the mana pool if you can pay the cost+kicker if less than 3 increase
it???
This commit is contained in:
Anthony Calosa
2016-06-05 12:39:11 +08:00
parent acfdab7dbb
commit 52de1e7b02
4 changed files with 51 additions and 8 deletions

View File

@@ -105485,6 +105485,13 @@ mana={5}
type=Artifact
[/card]
[card]
name=Trinisphere
auto=this(untapped) lord(*[-land]|hand,library,exile,graveyard) trinisphere forcedalive
text=As long as Trinisphere is untapped, each spell that would cost less than three mana to cast costs three mana to cast. (Additional mana in the cost may be paid with any color of mana or colorless mana. For example, a spell that would cost {1}{B} to cast costs {2}{B} to cast instead.)
mana={3}
type=Artifact
[/card]
[card]
name=Trinket Mage
auto=may moveTo(myhand) target(artifact[manacost<=1]|mylibrary)
text=When Trinket Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 1 or less, reveal that card, and put it into your hand. If you do, shuffle your library.

View File

@@ -255,7 +255,8 @@ public:
bool isTargetter();
int cardistargetter;
int myconvertedcost;
ManaCost * computeNewCost(MTGCardInstance * card,ManaCost * oldCost, ManaCost * refCost,bool onlyTrinisphere = false);
ManaCost * computeNewCost(MTGCardInstance * card,ManaCost * oldCost, ManaCost * refCost,bool noTrinisphere = false);
int countTrini;
void eventattacked();
void eventattackedAlone();

View File

@@ -1137,6 +1137,25 @@ void GameObserver::Affinity()
card->getManaCost()->remove(color,1);
}
}//end3
//trinisphere... now how to implement kicker recomputation
if(card->has(Constants::TRINISPHERE))
{
for(int jj = card->getManaCost()->getConvertedCost(); jj < 3; jj++)
{
card->getManaCost()->add(Constants::MTG_COLOR_ARTIFACT, 1);
card->countTrini++;
}
}
else
{
if(card->countTrini)
{
card->getManaCost()->remove(Constants::MTG_COLOR_ARTIFACT, card->countTrini);
card->countTrini=0;
}
}
SAFE_DELETE(original);
}//end
}

View File

@@ -198,6 +198,7 @@ void MTGCardInstance::initMTGCI()
storedSourceCard = NULL;
myPair = NULL;
miracle = false;
countTrini = 0;
for (int i = 0; i < ManaCost::MANA_PAID_WITH_SUSPEND +1; i++)
alternateCostPaid[i] = 0;
@@ -922,12 +923,11 @@ JQuadPtr MTGCardInstance::getIcon()
return WResourceManager::Instance()->RetrieveCard(this, CACHE_THUMB);
}
ManaCost * MTGCardInstance::computeNewCost(MTGCardInstance * card,ManaCost * newCost, ManaCost * refCost, bool onlyTrinisphere)
ManaCost * MTGCardInstance::computeNewCost(MTGCardInstance * card,ManaCost * newCost, ManaCost * refCost, bool noTrinisphere)
{
if(!card)
return NULL;
if(!onlyTrinisphere)
{
if(card->getIncreasedManaCost()->getConvertedCost())
newCost->add(card->getIncreasedManaCost());
if(card->getReducedManaCost()->getConvertedCost())
@@ -1013,11 +1013,27 @@ ManaCost * MTGCardInstance::computeNewCost(MTGCardInstance * card,ManaCost * new
newCost->remove(color,1);
}//end3
SAFE_DELETE(original);
if(!noTrinisphere)
{
//trinisphere... now how to implement kicker recomputation
if(card->has(Constants::TRINISPHERE))
{
for(int jj = newCost->getConvertedCost(); jj < 3; jj++)
{
newCost->add(Constants::MTG_COLOR_ARTIFACT, 1);
card->countTrini++;
}
}
else
{
if(card->countTrini)
{
newCost->remove(Constants::MTG_COLOR_ARTIFACT, card->countTrini);
card->countTrini=0;
}
}
}
/*//trinisphere must be here below//
if(card->has(Constants::TRINISPHERE))
for(int jj = newCost->getConvertedCost(); jj < 3; jj++)
newCost->add(Constants::MTG_COLOR_ARTIFACT, 1);*/
return newCost;
}