- added a new skill to toggle fog of war for any command.

This commit is contained in:
Mark Vejvoda 2013-01-11 18:26:30 +00:00
parent 7b99501697
commit 4ea22920bf
1 changed files with 59 additions and 39 deletions

View File

@ -373,8 +373,14 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
name= sn->getChild("name")->getAttribute("value")->getRestrictedValue();
//ep cost
mpCost= sn->getChild("ep-cost")->getAttribute("value")->getIntValue();
if (sn->hasChild("hp-cost")) {
if(sn->hasChild("ep-cost") == true) {
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();
}
else {
@ -382,10 +388,20 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
}
//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
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
string currentPath = dir;
@ -397,6 +413,7 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
animationRandomCycleMaxcount = randomCycleCountNode->getAttribute("value")->getIntValue();
}
if(sn->hasChild("animation") == true) {
//string path= sn->getChild("animation")->getAttribute("path")->getRestrictedValue(currentPath);
vector<XmlNode *> animationList = sn->getChildList("animation");
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());
throw megaglest_runtime_error(szBuf);
}
}
//particles
if(sn->hasChild("particles")) {
@ -456,6 +474,7 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
}
//sound
if(sn->hasChild("sound")) {
const XmlNode *soundNode= sn->getChild("sound");
if(soundNode->getAttribute("enabled")->getBoolValue()) {
soundStartTime= soundNode->getAttribute("start-time")->getFloatValue();
@ -470,6 +489,7 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
sounds[i]= sound;
}
}
}
// attack-boost