Merge pull request #14 from FreshDumbledore/develop
Start EP can be set
This commit is contained in:
commit
31def0dc1a
|
@ -1958,6 +1958,10 @@ void Unit::born(const CommandType *ct) {
|
||||||
//printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
|
//printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
|
||||||
}
|
}
|
||||||
addItemToVault(&this->hp,this->hp);
|
addItemToVault(&this->hp,this->hp);
|
||||||
|
|
||||||
|
//set ep from start-ep tag
|
||||||
|
checkItemInVault(&this->ep,this->ep);
|
||||||
|
this->ep= type->getStartEp();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::kill() {
|
void Unit::kill() {
|
||||||
|
|
|
@ -126,6 +126,7 @@ UnitType::UnitType() : ProducibleType() {
|
||||||
maxUnitCount= 0;
|
maxUnitCount= 0;
|
||||||
maxHp=0;
|
maxHp=0;
|
||||||
maxEp=0;
|
maxEp=0;
|
||||||
|
startEp=0;
|
||||||
armor=0;
|
armor=0;
|
||||||
sight=0;
|
sight=0;
|
||||||
size=0;
|
size=0;
|
||||||
|
@ -247,6 +248,14 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree,
|
||||||
}
|
}
|
||||||
addItemToVault(&(this->epRegeneration),this->epRegeneration);
|
addItemToVault(&(this->epRegeneration),this->epRegeneration);
|
||||||
|
|
||||||
|
//startEp
|
||||||
|
|
||||||
|
if(parametersNode->hasChild("start-ep")) {
|
||||||
|
//checkItemInVault(&(this->startEp),this->startEp);
|
||||||
|
startEp= parametersNode->getChild("start-ep")->getAttribute("value")->getIntValue();
|
||||||
|
}
|
||||||
|
addItemToVault(&(this->startEp),this->startEp);
|
||||||
|
|
||||||
//maxUnitCount
|
//maxUnitCount
|
||||||
if(parametersNode->hasChild("max-unit-count")) {
|
if(parametersNode->hasChild("max-unit-count")) {
|
||||||
//checkItemInVault(&(this->maxUnitCount),this->maxUnitCount);
|
//checkItemInVault(&(this->maxUnitCount),this->maxUnitCount);
|
||||||
|
@ -1100,6 +1109,7 @@ std::string UnitType::toString() const {
|
||||||
result += " maxHp = " + intToStr(maxHp);
|
result += " maxHp = " + intToStr(maxHp);
|
||||||
result += " hpRegeneration = " + intToStr(hpRegeneration);
|
result += " hpRegeneration = " + intToStr(hpRegeneration);
|
||||||
result += " maxEp = " + intToStr(maxEp);
|
result += " maxEp = " + intToStr(maxEp);
|
||||||
|
result += " startEp = " + intToStr(startEp);
|
||||||
result += " epRegeneration = " + intToStr(epRegeneration);
|
result += " epRegeneration = " + intToStr(epRegeneration);
|
||||||
result += " maxUnitCount = " + intToStr(getMaxUnitCount());
|
result += " maxUnitCount = " + intToStr(getMaxUnitCount());
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,7 @@ private:
|
||||||
int maxHp;
|
int maxHp;
|
||||||
int hpRegeneration;
|
int hpRegeneration;
|
||||||
int maxEp;
|
int maxEp;
|
||||||
|
int startEp;
|
||||||
int epRegeneration;
|
int epRegeneration;
|
||||||
int maxUnitCount;
|
int maxUnitCount;
|
||||||
|
|
||||||
|
@ -180,6 +181,7 @@ public:
|
||||||
inline int getHpRegeneration() const {return hpRegeneration;}
|
inline int getHpRegeneration() const {return hpRegeneration;}
|
||||||
inline int getMaxEp() const {return maxEp;}
|
inline int getMaxEp() const {return maxEp;}
|
||||||
inline int getEpRegeneration() const {return epRegeneration;}
|
inline int getEpRegeneration() const {return epRegeneration;}
|
||||||
|
inline int getStartEp() const {return startEp;}
|
||||||
inline int getMaxUnitCount() const {return maxUnitCount;}
|
inline int getMaxUnitCount() const {return maxUnitCount;}
|
||||||
inline bool getField(Field field) const {return fields[field];}
|
inline bool getField(Field field) const {return fields[field];}
|
||||||
inline Field getField() const {return field;}
|
inline Field getField() const {return field;}
|
||||||
|
|
Loading…
Reference in New Issue