I think I've figured parts of it out, but I've clearly missed something, because I attempted to test with something simple (Which probably isn't), getting the Rhox Faithmender working.
So, in AllAbilities.h I added the following:
Code: Select all
class ALifeMultiply: public TriggeredAbility
{
ALifeMultiply(GameObserver* observer, int _id, MTGCardInstance * _source, int _power = 1, int _toughness = 1) :
TriggeredAbility(observer, _id, _source)
{
}
int triggerOnEvent(WEvent * event)
{
if(WEventLife* le = dynamic_cast<WEventLife*>(event))
{
if (le->player == source->controller())
{
if (source->has(Constants::LIFEMULTIPLY))
{
return 0;
}
else
{
source->controller()->gainLife(le->amount);
le->amount = le->amount * 2;
return 1;
}
}
}
else
{
return 0;
}
}
};
And then obviously I added Rhox Faithmender to mtg.txt and removed it from unsupported.txt...
Code: Select all
[card]
name=Rhox Faithmender
abilities=lifelink,lifemultiply
text=Lifelink (Damage dealt by this creature also causes you to gain that much life.) -- If you would gain life, you gain twice that much life instead.
mana={3}{W}
type=Creature
subtype=Rhino Monk
power=1
toughness=5
[/card]
I should note that I'm totally guessing at most of this, based on a couple hours of looking through the code.