turned the "ai hint" for level up creatures into an MTGAbility.
this fixes a bug(?) that had high priority and maintains same effect as before. removed all traces of the "bugged(?) hint" from CardPrimitive. Issue: 498
This commit is contained in:
@@ -246,7 +246,7 @@ int AIAction::getEfficiency(){
|
||||
currentlevel = targetCounter->nb;
|
||||
}
|
||||
}
|
||||
if (currentlevel < _target->level){
|
||||
if (currentlevel < _target->MaxLevelUp){
|
||||
efficiency = 85;
|
||||
efficiency += currentlevel;//increase the efficeincy of leveling up by a small amount equal to current level.
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ CardPrimitive::CardPrimitive(CardPrimitive * source){
|
||||
|
||||
power = source->power;
|
||||
toughness = source->toughness;
|
||||
level = source->level;
|
||||
|
||||
magicText = source->magicText;
|
||||
for(map<string,string>::const_iterator it = source->magicTexts.begin(); it != source->magicTexts.end(); ++it)
|
||||
@@ -312,11 +311,3 @@ void CardPrimitive::setToughness(int _toughness){
|
||||
int CardPrimitive::getToughness(){
|
||||
return toughness;
|
||||
}
|
||||
|
||||
void CardPrimitive::setMaxLevel(int _levelcap){
|
||||
level = _levelcap;
|
||||
}
|
||||
|
||||
int CardPrimitive::getMaxLevel(){
|
||||
return level;
|
||||
}
|
||||
@@ -1585,6 +1585,23 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
return a;
|
||||
}
|
||||
|
||||
//frozen, next untap this does not untap.
|
||||
found = s.find("maxlevel:");
|
||||
if (found != string::npos){
|
||||
size_t start = s.find(":",found);
|
||||
size_t end = s.find(" ",start);
|
||||
int value;
|
||||
if (end != string::npos){
|
||||
value = atoi(s.substr(start+1,end-start-1).c_str());
|
||||
}
|
||||
else{
|
||||
value = atoi(s.substr(start+1).c_str());
|
||||
}
|
||||
MTGAbility * a = NEW AAWhatsMax(id,card,card,NULL,0,value);
|
||||
a->oneShot = 1;
|
||||
return a;
|
||||
}
|
||||
|
||||
//switch targest power with toughness
|
||||
found = s.find("swap");
|
||||
if (found != string::npos){
|
||||
|
||||
@@ -105,12 +105,6 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
||||
cost->kicker = ManaCost::parseManaCost(value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l': //Levelup, this is just to give Ai an idea when to stop leveling a creature.
|
||||
if (!primitive) primitive = NEW CardPrimitive();
|
||||
primitive->setMaxLevel(atoi(val));
|
||||
break;
|
||||
|
||||
case 'o': //othercost
|
||||
if (!primitive) primitive = NEW CardPrimitive();
|
||||
if (ManaCost * cost = primitive->getManaCost())
|
||||
|
||||
Reference in New Issue
Block a user