mirror of
https://github.com/glest/glest-source.git
synced 2025-08-24 08:52:49 +02:00
- added a new skill to toggle fog of war for any command.
This commit is contained in:
@@ -373,8 +373,14 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
|||||||
name= sn->getChild("name")->getAttribute("value")->getRestrictedValue();
|
name= sn->getChild("name")->getAttribute("value")->getRestrictedValue();
|
||||||
|
|
||||||
//ep cost
|
//ep cost
|
||||||
mpCost= sn->getChild("ep-cost")->getAttribute("value")->getIntValue();
|
if(sn->hasChild("ep-cost") == true) {
|
||||||
if (sn->hasChild("hp-cost")) {
|
mpCost = sn->getChild("ep-cost")->getAttribute("value")->getIntValue();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mpCost = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sn->hasChild("hp-cost") == true) {
|
||||||
hpCost = sn->getChild("hp-cost")->getAttribute("value")->getIntValue();
|
hpCost = sn->getChild("hp-cost")->getAttribute("value")->getIntValue();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -382,10 +388,20 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//speed
|
//speed
|
||||||
speed= sn->getChild("speed")->getAttribute("value")->getIntValue();
|
if(sn->hasChild("speed") == true) {
|
||||||
|
speed = sn->getChild("speed")->getAttribute("value")->getIntValue();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
speed = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//anim speed
|
//anim speed
|
||||||
animSpeed= sn->getChild("anim-speed")->getAttribute("value")->getIntValue();
|
if(sn->hasChild("anim-speed") == true) {
|
||||||
|
animSpeed = sn->getChild("anim-speed")->getAttribute("value")->getIntValue();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
animSpeed = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//model
|
//model
|
||||||
string currentPath = dir;
|
string currentPath = dir;
|
||||||
@@ -397,6 +413,7 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
|||||||
animationRandomCycleMaxcount = randomCycleCountNode->getAttribute("value")->getIntValue();
|
animationRandomCycleMaxcount = randomCycleCountNode->getAttribute("value")->getIntValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sn->hasChild("animation") == true) {
|
||||||
//string path= sn->getChild("animation")->getAttribute("path")->getRestrictedValue(currentPath);
|
//string path= sn->getChild("animation")->getAttribute("path")->getRestrictedValue(currentPath);
|
||||||
vector<XmlNode *> animationList = sn->getChildList("animation");
|
vector<XmlNode *> animationList = sn->getChildList("animation");
|
||||||
for(unsigned int i = 0; i < animationList.size(); ++i) {
|
for(unsigned int i = 0; i < animationList.size(); ++i) {
|
||||||
@@ -427,6 +444,7 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
|||||||
snprintf(szBuf,8096,"Error no animations found for skill [%s] for parentLoader [%s]",name.c_str(),parentLoader.c_str());
|
snprintf(szBuf,8096,"Error no animations found for skill [%s] for parentLoader [%s]",name.c_str(),parentLoader.c_str());
|
||||||
throw megaglest_runtime_error(szBuf);
|
throw megaglest_runtime_error(szBuf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//particles
|
//particles
|
||||||
if(sn->hasChild("particles")) {
|
if(sn->hasChild("particles")) {
|
||||||
@@ -456,6 +474,7 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//sound
|
//sound
|
||||||
|
if(sn->hasChild("sound")) {
|
||||||
const XmlNode *soundNode= sn->getChild("sound");
|
const XmlNode *soundNode= sn->getChild("sound");
|
||||||
if(soundNode->getAttribute("enabled")->getBoolValue()) {
|
if(soundNode->getAttribute("enabled")->getBoolValue()) {
|
||||||
soundStartTime= soundNode->getAttribute("start-time")->getFloatValue();
|
soundStartTime= soundNode->getAttribute("start-time")->getFloatValue();
|
||||||
@@ -470,6 +489,7 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
|||||||
sounds[i]= sound;
|
sounds[i]= sound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// attack-boost
|
// attack-boost
|
||||||
|
Reference in New Issue
Block a user