Revert "multi tokens images on same source"

This reverts commit 8c9d2d6f1d.
This commit is contained in:
Anthony Calosa
2016-08-08 11:20:25 +08:00
parent 8c9d2d6f1d
commit 9807ca99f9
2 changed files with 5 additions and 25 deletions
+1 -15
View File
@@ -3547,7 +3547,6 @@ public:
vector<MTGAbility *> currentAbilities; vector<MTGAbility *> currentAbilities;
MTGAbility * andAbility; MTGAbility * andAbility;
Player * tokenReciever; Player * tokenReciever;
string cID;
//by id //by id
ATokenCreator(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable *, ManaCost * _cost, int tokenId,string starfound, WParsedInt * multiplier = NULL, ATokenCreator(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable *, ManaCost * _cost, int tokenId,string starfound, WParsedInt * multiplier = NULL,
int who = 0,bool aLivingWeapon = false) : int who = 0,bool aLivingWeapon = false) :
@@ -3558,7 +3557,6 @@ public:
if (card) name = card->data->getName(); if (card) name = card->data->getName();
battleReady = false; battleReady = false;
andAbility = NULL; andAbility = NULL;
cID = "";
} }
//by name, card still require valid card.dat info, this just makes the primitive code far more readable. token(Eldrazi scion) instead of token(-1234234)... //by name, card still require valid card.dat info, this just makes the primitive code far more readable. token(Eldrazi scion) instead of token(-1234234)...
ATokenCreator(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable *, ManaCost * _cost, string cardName, string starfound, WParsedInt * multiplier = NULL, ATokenCreator(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable *, ManaCost * _cost, string cardName, string starfound, WParsedInt * multiplier = NULL,
@@ -3571,11 +3569,10 @@ public:
if (card) name = card->data->getName(); if (card) name = card->data->getName();
battleReady = false; battleReady = false;
andAbility = NULL; andAbility = NULL;
cID = "";
} }
//by construction //by construction
ATokenCreator(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable *, ManaCost * _cost, string sname, string stypes, int _power, int _toughness, ATokenCreator(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable *, ManaCost * _cost, string sname, string stypes, int _power, int _toughness,
string sabilities, string starfound,WParsedInt * multiplier = NULL, int _who = 0,bool aLivingWeapon = false,string spt = "", string tnum = "") : string sabilities, string starfound,WParsedInt * multiplier = NULL, int _who = 0,bool aLivingWeapon = false,string spt = "") :
ActivatedAbility(observer, _id, _source, _cost, 0),sabilities(sabilities),starfound(starfound), multiplier(multiplier), who(_who),aLivingWeapon(aLivingWeapon),spt(spt) ActivatedAbility(observer, _id, _source, _cost, 0),sabilities(sabilities),starfound(starfound), multiplier(multiplier), who(_who),aLivingWeapon(aLivingWeapon),spt(spt)
{ {
power = _power; power = _power;
@@ -3585,7 +3582,6 @@ public:
aType = MTGAbility::STANDARD_TOKENCREATOR; aType = MTGAbility::STANDARD_TOKENCREATOR;
battleReady = false; battleReady = false;
andAbility = NULL; andAbility = NULL;
cID = tnum;
if (!multiplier) this->multiplier = NEW WParsedInt(1); if (!multiplier) this->multiplier = NEW WParsedInt(1);
//TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class; //TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class;
@@ -3687,16 +3683,6 @@ public:
} }
} }
string tokenText = ""; string tokenText = "";
if(!cID.empty())
{
string customId = "";
ostringstream tokID;
tokID << abs(myToken->getId());
customId.append(""+tokID.str()+cID);
customId = cReplaceString(customId," ","");
WParsedInt newID(customId, NULL, source);
myToken->setMTGId(-newID.getValue());
}
if(sabilities.find("token(") == string::npos) if(sabilities.find("token(") == string::npos)
{ {
tokenText = "("; tokenText = "(";
+4 -10
View File
@@ -2420,21 +2420,15 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
string sname = tokenParameters[0]; string sname = tokenParameters[0];
string stypes = tokenParameters[1]; string stypes = tokenParameters[1];
string spt = tokenParameters[2]; string spt = tokenParameters[2];
string cID = "";
//reconstructing string abilities from the split version, //reconstructing string abilities from the split version,
// then we re-split it again in the token constructor, // then we re-split it again in the token constructor,
// this needs to be improved // this needs to be improved
string sabilities = (tokenParameters.size() > 3)? tokenParameters[3] : ""; string sabilities = (tokenParameters.size() > 3)? tokenParameters[3] : "";
for (size_t i = 4; i < tokenParameters.size(); ++i) for (size_t i = 4; i < tokenParameters.size(); ++i)
{ {
string tnum = tokenParameters[i]; sabilities.append(",");
if(tnum.find("tnum:")) sabilities.append(tokenParameters[i]);
cID = cReplaceString(tnum,"tnum:","");
else
{
sabilities.append(",");
sabilities.append(tokenParameters[i]);
}
} }
int value = 0; int value = 0;
if (spt.find("xx/xx") != string::npos) if (spt.find("xx/xx") != string::npos)
@@ -2447,7 +2441,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
ATokenCreator * tok = NEW ATokenCreator( ATokenCreator * tok = NEW ATokenCreator(
observer, id, card,target, NULL, sname, stypes, power + value, toughness + value, observer, id, card,target, NULL, sname, stypes, power + value, toughness + value,
sabilities, starfound, multiplier, who, aLivingWeapon, spt, cID); sabilities, starfound, multiplier, who, aLivingWeapon, spt);
tok->oneShot = 1; tok->oneShot = 1;
if(aLivingWeapon) if(aLivingWeapon)
tok->forceDestroy = 1; tok->forceDestroy = 1;