1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-27 00:41:08 +02:00

[Spells] Added basic support for icons and sounds

* few changes in spell format
* save format changed
This commit is contained in:
alexvins
2014-03-10 16:00:58 +00:00
parent 9f01a92f4c
commit 065b8366fb
22 changed files with 404 additions and 501 deletions

View File

@ -313,6 +313,13 @@ const std::string& CSpell::getIconImmune() const
return iconImmune;
}
const std::string& CSpell::getCastSound() const
{
return castSound;
}
si32 CSpell::getCost(const int skillLevel) const
{
return costs[skillLevel];
@ -693,11 +700,6 @@ CSpell * CSpellHandler::loadFromJson(const JsonNode& json)
//by default all flags are set to false in constructor
if(flags["summoning"].Bool())
{
logGlobal->warnStream() << spell->name << ": summoning flag in unimplemented";
}
spell->isDamage = flags["damage"].Bool(); //do this before "offensive"
if(flags["offensive"].Bool())
@ -767,6 +769,16 @@ CSpell * CSpellHandler::loadFromJson(const JsonNode& json)
const JsonNode & graphicsNode = json["graphics"];
spell->iconImmune = graphicsNode["iconImmune"].String();
spell->iconBook = graphicsNode["iconBook"].String();
spell->iconEffect = graphicsNode["iconEffect"].String();
spell->iconScenarioBonus = graphicsNode["iconScenarioBonus"].String();
spell->iconScroll = graphicsNode["iconScroll"].String();
const JsonNode & soundsNode = json["sounds"];
spell->castSound = soundsNode["cast"].String();
//load level attributes