- added a new skill to toggle fog of war for any command.
This commit is contained in:
parent
7b99501697
commit
4ea22920bf
|
@ -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,36 +413,38 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
||||||
animationRandomCycleMaxcount = randomCycleCountNode->getAttribute("value")->getIntValue();
|
animationRandomCycleMaxcount = randomCycleCountNode->getAttribute("value")->getIntValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
//string path= sn->getChild("animation")->getAttribute("path")->getRestrictedValue(currentPath);
|
if(sn->hasChild("animation") == true) {
|
||||||
vector<XmlNode *> animationList = sn->getChildList("animation");
|
//string path= sn->getChild("animation")->getAttribute("path")->getRestrictedValue(currentPath);
|
||||||
for(unsigned int i = 0; i < animationList.size(); ++i) {
|
vector<XmlNode *> animationList = sn->getChildList("animation");
|
||||||
string path= animationList[i]->getAttribute("path")->getRestrictedValue(currentPath);
|
for(unsigned int i = 0; i < animationList.size(); ++i) {
|
||||||
if(fileExists(path) == true) {
|
string path= animationList[i]->getAttribute("path")->getRestrictedValue(currentPath);
|
||||||
Model *animation= Renderer::getInstance().newModel(rsGame);
|
if(fileExists(path) == true) {
|
||||||
if(animation) {
|
Model *animation= Renderer::getInstance().newModel(rsGame);
|
||||||
animation->load(path, false, &loadedFileList, &parentLoader);
|
if(animation) {
|
||||||
}
|
animation->load(path, false, &loadedFileList, &parentLoader);
|
||||||
loadedFileList[path].push_back(make_pair(parentLoader,animationList[i]->getAttribute("path")->getRestrictedValue()));
|
}
|
||||||
|
loadedFileList[path].push_back(make_pair(parentLoader,animationList[i]->getAttribute("path")->getRestrictedValue()));
|
||||||
|
|
||||||
animations.push_back(animation);
|
animations.push_back(animation);
|
||||||
//printf("**FOUND ANIMATION [%s]\n",path.c_str());
|
//printf("**FOUND ANIMATION [%s]\n",path.c_str());
|
||||||
|
|
||||||
AnimationAttributes animationAttributeList;
|
AnimationAttributes animationAttributeList;
|
||||||
if(animationList[i]->getAttribute("minHp",false) != NULL && animationList[i]->getAttribute("maxHp",false) != NULL) {
|
if(animationList[i]->getAttribute("minHp",false) != NULL && animationList[i]->getAttribute("maxHp",false) != NULL) {
|
||||||
animationAttributeList.fromHp = animationList[i]->getAttribute("minHp")->getIntValue();
|
animationAttributeList.fromHp = animationList[i]->getAttribute("minHp")->getIntValue();
|
||||||
animationAttributeList.toHp = animationList[i]->getAttribute("maxHp")->getIntValue();
|
animationAttributeList.toHp = animationList[i]->getAttribute("maxHp")->getIntValue();
|
||||||
|
}
|
||||||
|
animationAttributes.push_back(animationAttributeList);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line %d] WARNING CANNOT LOAD MODEL [%s] for parentLoader [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),parentLoader.c_str());
|
||||||
}
|
}
|
||||||
animationAttributes.push_back(animationAttributeList);
|
|
||||||
}
|
}
|
||||||
else {
|
if(animations.empty() == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line %d] WARNING CANNOT LOAD MODEL [%s] for parentLoader [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),parentLoader.c_str());
|
char szBuf[8096]="";
|
||||||
|
snprintf(szBuf,8096,"Error no animations found for skill [%s] for parentLoader [%s]",name.c_str(),parentLoader.c_str());
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(animations.empty() == true) {
|
|
||||||
char szBuf[8096]="";
|
|
||||||
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
|
//particles
|
||||||
if(sn->hasChild("particles")) {
|
if(sn->hasChild("particles")) {
|
||||||
|
@ -456,18 +474,20 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
||||||
}
|
}
|
||||||
|
|
||||||
//sound
|
//sound
|
||||||
const XmlNode *soundNode= sn->getChild("sound");
|
if(sn->hasChild("sound")) {
|
||||||
if(soundNode->getAttribute("enabled")->getBoolValue()) {
|
const XmlNode *soundNode= sn->getChild("sound");
|
||||||
soundStartTime= soundNode->getAttribute("start-time")->getFloatValue();
|
if(soundNode->getAttribute("enabled")->getBoolValue()) {
|
||||||
sounds.resize(soundNode->getChildCount());
|
soundStartTime= soundNode->getAttribute("start-time")->getFloatValue();
|
||||||
for(int i = 0; i < soundNode->getChildCount(); ++i) {
|
sounds.resize(soundNode->getChildCount());
|
||||||
const XmlNode *soundFileNode= soundNode->getChild("sound-file", i);
|
for(int i = 0; i < soundNode->getChildCount(); ++i) {
|
||||||
string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true);
|
const XmlNode *soundFileNode= soundNode->getChild("sound-file", i);
|
||||||
|
string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true);
|
||||||
|
|
||||||
StaticSound *sound= new StaticSound();
|
StaticSound *sound= new StaticSound();
|
||||||
sound->load(path);
|
sound->load(path);
|
||||||
loadedFileList[path].push_back(make_pair(parentLoader,soundFileNode->getAttribute("path")->getRestrictedValue()));
|
loadedFileList[path].push_back(make_pair(parentLoader,soundFileNode->getAttribute("path")->getRestrictedValue()));
|
||||||
sounds[i]= sound;
|
sounds[i]= sound;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue