added countertrack(counterstring) MTGAbility
what this does currently is remove a counter of the type counterstring and when the ability is destroyed it puts the counter back for us.
meant for weapons used as follows.
auto=teach(creature) countertrack(0/0,1,hand)
when the creature is equipped with this weapon it will remove a hand counter from the creature, when you remove the weapon, or the weapon is destroyed or whatever...it will put a hand counter back on the creature.
added dualwielding thisdescriptor...
auto=this(dualwielding) 2/2
auto=this(dualwielding) firststrike
enabled "restriction{" on phasebased triggers @next and @each...
i will work more on countertrack to extend it to domains if it currently isnt possible to use it in this case(haven't tested it on domains)....
This commit is contained in:
@@ -2062,7 +2062,20 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
MTGAbility * a = NEW ACounterShroud(id, card, target,counter);
|
||||
return a;
|
||||
}
|
||||
|
||||
//use counters to track by counters to track an efect by counter name.
|
||||
vector<string> splitCounterTracking = parseBetween(s, "countertrack(", ")");
|
||||
if (splitCounterTracking.size())
|
||||
{
|
||||
string splitCounterTrack = splitCounterTracking[1];
|
||||
Counter * counter = NULL;
|
||||
counter = parseCounter(splitCounterTrack, target, spell);
|
||||
if (!counter)
|
||||
{
|
||||
DebugTrace("MTGAbility: can't parse counter:" << s);
|
||||
return NULL;
|
||||
}
|
||||
return NEW ACounterTracker(id, card, target,counter);
|
||||
}
|
||||
//removes all counters of the specifified type.
|
||||
vector<string> splitRemoveCounter = parseBetween(s, "removeallcounters(", ")");
|
||||
if (splitRemoveCounter.size())
|
||||
@@ -4293,9 +4306,20 @@ TriggerAtPhase::TriggerAtPhase(int id, MTGCardInstance * source, Targetable * ta
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
if(castRestriction.size())
|
||||
{
|
||||
if(!source)
|
||||
result = 1;//can't check these restrictions without a source aka:in a rule.txt
|
||||
AbilityFactory af;
|
||||
int checkCond = af.parseCastRestrictions(source,source->controller(),castRestriction);
|
||||
if(!checkCond)
|
||||
result = 0;
|
||||
}
|
||||
|
||||
}
|
||||
if(once && activeTrigger)
|
||||
activeTrigger = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user