- Add a simple macro system for auto lines (the goal is to help mostly with repetitive card auto lines such as the ones we have in MotD mod) Check the MotD mod for examples.
-- I added an AbilityParser.cpp file, mid term goal is to move AbilityFactory there, so that MTGAbility.cpp becomes a bit less big. -- I tried to add the file reference in Makefiles, but only tested windows compilation so far - Fixed bugs related to "castRestriction" variables in MTGAbility. these variables were declared in both the parent and children classes, leading to bugs and duplicate code/content The test suite passes
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "ThisDescriptor.h"
|
||||
#include "ExtraCost.h"
|
||||
#include "MTGRules.h"
|
||||
#include "AbilityParser.h"
|
||||
|
||||
|
||||
//Used for Lord/This parsing
|
||||
@@ -2777,6 +2778,9 @@ int AbilityFactory::getAbilities(vector<MTGAbility *> * v, Spell * spell, MTGCar
|
||||
size_t found;
|
||||
int result = id;
|
||||
|
||||
magicText = AutoLineMacro::Process(magicText);
|
||||
|
||||
|
||||
while (magicText.size())
|
||||
{
|
||||
found = magicText.find("\n");
|
||||
@@ -3891,13 +3895,13 @@ ostream& ActivatedAbility::toString(ostream& out) const
|
||||
}
|
||||
|
||||
TargetAbility::TargetAbility(GameObserver* observer, int id, MTGCardInstance * card, TargetChooser * _tc, ManaCost * _cost, int _playerturnonly, string castRestriction) :
|
||||
ActivatedAbility(observer, id, card, _cost, _playerturnonly, castRestriction), NestedAbility(NULL)
|
||||
ActivatedAbility(observer, id, card, _cost, _playerturnonly, "", NULL, "", castRestriction), NestedAbility(NULL) //Todo fix this mess, why do we have to pass "", NULL, "" here before cast restrictions?
|
||||
{
|
||||
tc = _tc;
|
||||
}
|
||||
|
||||
TargetAbility::TargetAbility(GameObserver* observer, int id, MTGCardInstance * card, ManaCost * _cost, int _playerturnonly, string castRestriction) :
|
||||
ActivatedAbility(observer, id, card, _cost, _playerturnonly, castRestriction), NestedAbility(NULL)
|
||||
ActivatedAbility(observer, id, card, _cost, _playerturnonly, "", NULL, "", castRestriction), NestedAbility(NULL) //Todo fix this mess, why do we have to pass "", NULL, "" here before cast restrictions?
|
||||
{
|
||||
tc = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user