moved the level varible from MTGcard to MTGprimitive.
This commit is contained in:
@@ -29,6 +29,7 @@ class CardPrimitive {
|
||||
string spellTargetType;
|
||||
int power;
|
||||
int toughness;
|
||||
int level;
|
||||
vector<int>types;
|
||||
CardPrimitive();
|
||||
CardPrimitive(CardPrimitive * source);
|
||||
@@ -74,6 +75,8 @@ class CardPrimitive {
|
||||
int getPower();
|
||||
void setToughness(int _toughness);
|
||||
int getToughness();
|
||||
void setMaxLevel(int _level);
|
||||
int getMaxLevel();
|
||||
|
||||
const vector<string>& formattedText();
|
||||
};
|
||||
|
||||
@@ -26,7 +26,6 @@ class MTGCard {
|
||||
int init();
|
||||
|
||||
public:
|
||||
int LevelUp;
|
||||
int setId;
|
||||
CardPrimitive * data;
|
||||
|
||||
@@ -36,13 +35,11 @@ class MTGCard {
|
||||
|
||||
void setMTGId(int id);
|
||||
void setRarity(char _rarity);
|
||||
void setLevelcap(int _levelupcap);
|
||||
//void setImageName( char * value);
|
||||
void setPrimitive(CardPrimitive * cp);
|
||||
|
||||
int getMTGId() const;
|
||||
int getId() const;
|
||||
int getLevelcap() const;
|
||||
char getRarity() const;
|
||||
char * getImageName();
|
||||
};
|
||||
|
||||
@@ -247,8 +247,8 @@ int AIAction::getEfficiency(){
|
||||
currentlevel = targetCounter->nb;
|
||||
}
|
||||
}
|
||||
if (currentlevel < _target->LevelUp){
|
||||
efficiency = 65;
|
||||
if (currentlevel < _target->level){
|
||||
efficiency = 85;
|
||||
efficiency += currentlevel;//increase the efficeincy of leveling up by a small amount equal to current level.
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -31,6 +31,7 @@ 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)
|
||||
@@ -330,3 +331,11 @@ void CardPrimitive::setToughness(int _toughness){
|
||||
int CardPrimitive::getToughness(){
|
||||
return toughness;
|
||||
}
|
||||
|
||||
void CardPrimitive::setMaxLevel(int _levelcap){
|
||||
level = _levelcap;
|
||||
}
|
||||
|
||||
int CardPrimitive::getMaxLevel(){
|
||||
return level;
|
||||
}
|
||||
@@ -26,7 +26,6 @@ MTGCard::MTGCard(int set_id){
|
||||
MTGCard::MTGCard(MTGCard * source){
|
||||
|
||||
strcpy(image_name, source->image_name);
|
||||
LevelUp = source->LevelUp;
|
||||
rarity = source->rarity;
|
||||
mtgid = source->mtgid;
|
||||
setId = source->setId;
|
||||
@@ -38,7 +37,6 @@ int MTGCard::init(){
|
||||
mtgid = 0;
|
||||
data = NULL;
|
||||
rarity = Constants::RARITY_C;
|
||||
LevelUp = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -66,14 +64,6 @@ void MTGCard::setRarity(char _rarity){
|
||||
rarity = _rarity;
|
||||
}
|
||||
|
||||
int MTGCard::getLevelcap() const{
|
||||
return LevelUp;
|
||||
}
|
||||
|
||||
void MTGCard::setLevelcap(int levelupcap){
|
||||
LevelUp = levelupcap;
|
||||
}
|
||||
|
||||
char * MTGCard::getImageName() {
|
||||
return image_name;
|
||||
}
|
||||
|
||||
@@ -112,8 +112,8 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
||||
break;
|
||||
|
||||
case 'l': //Levelup, this is just to give Ai an idea when to stop leveling a creature.
|
||||
if(!card) card = NEW MTGCard();
|
||||
card->setLevelcap(atoi(val));
|
||||
if (!primitive) primitive = NEW CardPrimitive();
|
||||
primitive->setMaxLevel(atoi(val));
|
||||
break;
|
||||
|
||||
case 'o': //othercost
|
||||
|
||||
Reference in New Issue
Block a user