moved parsing of the power and toughness for token gen into the resolve.
This commit is contained in:
@@ -2907,6 +2907,7 @@ public:
|
|||||||
string name;
|
string name;
|
||||||
string sabilities;
|
string sabilities;
|
||||||
string starfound;
|
string starfound;
|
||||||
|
string spt;
|
||||||
WParsedInt * multiplier;
|
WParsedInt * multiplier;
|
||||||
int who;
|
int who;
|
||||||
bool aLivingWeapon;
|
bool aLivingWeapon;
|
||||||
@@ -2924,8 +2925,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
ATokenCreator(int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost, string sname, string stypes, int _power, int _toughness,
|
ATokenCreator(int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost, string sname, string stypes, int _power, int _toughness,
|
||||||
string sabilities, int _doTap, string starfound,WParsedInt * multiplier = NULL, int who = 0,bool aLivingWeapon = false) :
|
string sabilities, int _doTap, string starfound,WParsedInt * multiplier = NULL, int who = 0,bool aLivingWeapon = false,string spt = "") :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, _doTap),sabilities(sabilities),starfound(starfound), multiplier(multiplier), who(who),aLivingWeapon(aLivingWeapon)
|
ActivatedAbility(_id, _source, _cost, 0, _doTap),sabilities(sabilities),starfound(starfound), multiplier(multiplier), who(who),aLivingWeapon(aLivingWeapon),spt(spt)
|
||||||
{
|
{
|
||||||
power = _power;
|
power = _power;
|
||||||
toughness = _toughness;
|
toughness = _toughness;
|
||||||
@@ -2984,6 +2985,16 @@ public:
|
|||||||
SAFE_DELETE(multiplier);
|
SAFE_DELETE(multiplier);
|
||||||
multiplier = NEW WParsedInt(starfound, NULL, (MTGCardInstance *)source);
|
multiplier = NEW WParsedInt(starfound, NULL, (MTGCardInstance *)source);
|
||||||
}
|
}
|
||||||
|
if(!spt.empty())
|
||||||
|
{
|
||||||
|
vector<string> powertoughness = split( spt, '/');
|
||||||
|
WParsedInt * NewPow = NEW WParsedInt(powertoughness[0].c_str(),NULL,source);
|
||||||
|
WParsedInt * NewTou = NEW WParsedInt(powertoughness[1].c_str(),NULL,source);
|
||||||
|
power = NewPow->getValue();
|
||||||
|
toughness = NewTou->getValue();
|
||||||
|
SAFE_DELETE(NewPow);
|
||||||
|
SAFE_DELETE(NewTou);
|
||||||
|
}
|
||||||
for (int i = 0; i < multiplier->getValue(); ++i)
|
for (int i = 0; i < multiplier->getValue(); ++i)
|
||||||
{
|
{
|
||||||
//MTGCardInstance * myToken;
|
//MTGCardInstance * myToken;
|
||||||
|
|||||||
@@ -1818,7 +1818,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
who = 2;
|
who = 2;
|
||||||
}
|
}
|
||||||
ATokenCreator * tok = NEW ATokenCreator(id, card,target, NULL, sname, stypes, power + value, toughness + value, sabilities, 0,starfound,
|
ATokenCreator * tok = NEW ATokenCreator(id, card,target, NULL, sname, stypes, power + value, toughness + value, sabilities, 0,starfound,
|
||||||
multiplier, who,aLivingWeapon);
|
multiplier, who,aLivingWeapon,spt);
|
||||||
tok->oneShot = 1;
|
tok->oneShot = 1;
|
||||||
if(aLivingWeapon)
|
if(aLivingWeapon)
|
||||||
tok->forceDestroy = 1;
|
tok->forceDestroy = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user