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:
@@ -163,34 +163,41 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
|
||||
manaCost->addExtraCost(NEW UnTapCost);
|
||||
break;
|
||||
}
|
||||
case 'c': //Counters
|
||||
{
|
||||
size_t counter_start = value.find("(");
|
||||
size_t counter_end = value.find(")", counter_start);
|
||||
AbilityFactory abf(g);
|
||||
string counterString = value.substr(counter_start + 1, counter_end - counter_start - 1);
|
||||
Counter * counter = abf.parseCounter(counterString, c);
|
||||
size_t separator = value.find(",", counter_start);
|
||||
size_t separator2 = string::npos;
|
||||
if (separator != string::npos)
|
||||
case 'c': //Counters or cycle
|
||||
{
|
||||
separator2 = value.find(",", counter_end + 1);
|
||||
if(value == "cycle")
|
||||
{
|
||||
manaCost->addExtraCost(NEW CycleCost(tc));
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t counter_start = value.find("(");
|
||||
size_t counter_end = value.find(")", counter_start);
|
||||
AbilityFactory abf(g);
|
||||
string counterString = value.substr(counter_start + 1, counter_end - counter_start - 1);
|
||||
Counter * counter = abf.parseCounter(counterString, c);
|
||||
size_t separator = value.find(",", counter_start);
|
||||
size_t separator2 = string::npos;
|
||||
if (separator != string::npos)
|
||||
{
|
||||
separator2 = value.find(",", counter_end + 1);
|
||||
}
|
||||
SAFE_DELETE(tc);
|
||||
size_t target_start = string::npos;
|
||||
if (separator2 != string::npos)
|
||||
{
|
||||
target_start = value.find(",", counter_end + 1);
|
||||
}
|
||||
size_t target_end = value.length();
|
||||
if (target_start != string::npos && target_end != string::npos)
|
||||
{
|
||||
string target = value.substr(target_start + 1, target_end - 1 - target_start);
|
||||
tc = tcf.createTargetChooser(target, c);
|
||||
}
|
||||
manaCost->addExtraCost(NEW CounterCost(counter, tc));
|
||||
}
|
||||
break;
|
||||
}
|
||||
SAFE_DELETE(tc);
|
||||
size_t target_start = string::npos;
|
||||
if (separator2 != string::npos)
|
||||
{
|
||||
target_start = value.find(",", counter_end + 1);
|
||||
}
|
||||
size_t target_end = value.length();
|
||||
if (target_start != string::npos && target_end != string::npos)
|
||||
{
|
||||
string target = value.substr(target_start + 1, target_end - 1 - target_start);
|
||||
tc = tcf.createTargetChooser(target, c);
|
||||
}
|
||||
manaCost->addExtraCost(NEW CounterCost(counter, tc));
|
||||
break;
|
||||
}
|
||||
default: //uncolored cost and hybrid costs
|
||||
{
|
||||
int intvalue = atoi(value.c_str());
|
||||
|
||||
Reference in New Issue
Block a user