converted cycling into a cost type to bring it more inline with MTGrules {cycle}, also added the cycled trigger @cycled(tc):

this cost type sends both the event for discard and the event for cycled trigger, it no longer automatically draws a card, that is part of this cost ability instead.
standard cycling is autohand={cycle}:draw:1 controller
its trigger is
auto=@cycled(*|myhand):damage:2 target(creature)
"whenever you cycle a card deal 2 damage to a target creature."
This commit is contained in:
omegablast2002@yahoo.com
2011-11-09 14:27:56 +00:00
parent db6c4795bf
commit d2752a5a22
7 changed files with 113 additions and 72 deletions
+33 -1
View File
@@ -225,8 +225,40 @@ int DiscardCost::doPay()
}
return 0;
}
//to library cost
//cycling
CycleCost * CycleCost::clone() const
{
CycleCost * ec = NEW CycleCost(*this);
if (tc)
ec->tc = tc->clone();
return ec;
}
CycleCost::CycleCost(TargetChooser *_tc) :
ExtraCost("Cycle", _tc)
{
}
int CycleCost::doPay()
{
MTGCardInstance * _source = (MTGCardInstance *) source;
if (_source)
{
WEvent * e = NEW WEventCardDiscard(target);//cycling sends 2 events one for the discard and one for the specific cycle trigger
GameObserver * game = _source->owner->getObserver();
game->receiveEvent(e);
WEvent * e2 = NEW WEventCardCycle(_source);
game->receiveEvent(e2);
_source->controller()->game->putInGraveyard(_source);
if (tc)
tc->initTargets();
return 1;
}
return 0;
}
//to library cost
ToLibraryCost * ToLibraryCost::clone() const
{
ToLibraryCost * ec = NEW ToLibraryCost(*this);