fix for cumulative upcost, extra cost were not being multiplied
[card]
name=Phyrexian Soulgorger
auto=cumulativeupcost[{S(creature|myBattlefield)}] sacrifice
text=Cumulative upkeep - Sacrifice a creature. (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)
mana={3}
type=Snow Artifact Creature
subtype=Construct
power=8
toughness=8
[/card]
was only charging you 1 sacrifice per upkeep.
added thisTargetComparison, this(cantargetcard(targetchooser))...its a thisdescriptor that compares if the card can be targeted by a target chooser...
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "Counters.h"
|
||||
#include "MTGCardInstance.h"
|
||||
#include "CardDescriptor.h"
|
||||
#include "AllAbilities.h"
|
||||
|
||||
ThisDescriptor::~ThisDescriptor()
|
||||
{
|
||||
@@ -330,10 +331,46 @@ ThisDescriptor * ThisDescriptorFactory::createThisDescriptor(GameObserver* obser
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
vector<string>splitTargetComparison = parseBetween(s,"cantargetcard(",")",false);
|
||||
if (splitTargetComparison.size())
|
||||
{
|
||||
TargetChooserFactory tf(observer);
|
||||
TargetChooser * tcc = tf.createTargetChooser(splitTargetComparison[1],NULL);
|
||||
ThisTargetCompare * td = NEW ThisTargetCompare(tcc);
|
||||
if (td)
|
||||
{
|
||||
return td;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ThisTargetCompare::ThisTargetCompare(TargetChooser * _tcc)
|
||||
{
|
||||
targetComp = _tcc;
|
||||
}
|
||||
|
||||
int ThisTargetCompare::match(MTGCardInstance * card)
|
||||
{
|
||||
if(targetComp->canTarget(card))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ThisTargetCompare::~ThisTargetCompare()
|
||||
{
|
||||
SAFE_DELETE(targetComp);
|
||||
}
|
||||
|
||||
ThisTargetCompare* ThisTargetCompare::clone() const
|
||||
{
|
||||
ThisTargetCompare * a = NEW ThisTargetCompare(*this);
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
ThisCounter::ThisCounter(Counter * _counter)
|
||||
{
|
||||
counter = _counter;
|
||||
|
||||
Reference in New Issue
Block a user