3 changes
1st had to revise the syntax for my "type:" variable it is now type:blah:location, using the pipe line created nasty returns in some combinations of abilities as the parser confused the pipeline in type: with the one in TC. 2nd more of a correction then a bug fix, i noticed that upcost had instances where it could still trigger its effect in the draw phase becuase the condiational for the ability resolve was in the update, i left the class mostly untouched but move the resolve out of update and into a receiveEvent for upcost, which triggers only once after you declared that you are leaving the upkeep before draw step begins. 3rd reworked the construction of multiability to only produce a single multiability with all the abilities in the string instead of nested multiabilities, it is considerabily easier to debug and creates 1/3 less objects for the engine to deal with in comparison to the old method.
This commit is contained in:
@@ -84,13 +84,17 @@ public:
|
||||
}
|
||||
else if (s.find("type:") != string::npos)
|
||||
{
|
||||
size_t begins = s.find(":");
|
||||
string theType = s.substr(begins + 1);
|
||||
size_t zoned = theType.find("|");
|
||||
size_t begins = s.find("type:");
|
||||
string theType = s.substr(begins + 5);
|
||||
size_t zoned = theType.find(":");
|
||||
if(zoned == string::npos)
|
||||
{
|
||||
theType.append("|mybattlefield");
|
||||
}
|
||||
else
|
||||
{
|
||||
replace(theType.begin(), theType.end(), ':', '|');
|
||||
}
|
||||
TargetChooserFactory tf;
|
||||
TargetChooser * tc = tf.createTargetChooser(theType.c_str(),NULL);
|
||||
GameObserver * game = game->GetInstance();
|
||||
@@ -4089,7 +4093,8 @@ public:
|
||||
int currentage;
|
||||
|
||||
AUpkeep(int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int _tap = 0, int restrictions = 0, int _phase =
|
||||
Constants::MTG_PHASE_UPKEEP, int _once = 0,bool Cumulative = false);
|
||||
Constants::MTG_PHASE_UPKEEP, int _once = 0,bool Cumulative = false);
|
||||
int receiveEvent(WEvent * event);
|
||||
void Update(float dt);
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int resolve();
|
||||
|
||||
Reference in New Issue
Block a user