Browse Source

Implemented loading of new spell configuration parameters

AlexVinS 11 years ago
parent
commit
242aa72796
1 changed files with 15 additions and 2 deletions
  1. 15 2
      lib/CSpellHandler.cpp

+ 15 - 2
lib/CSpellHandler.cpp

@@ -885,10 +885,23 @@ CSpell * CSpellHandler::loadFromJson(const JsonNode& json)
 	spell->iconScenarioBonus = graphicsNode["iconScenarioBonus"].String();
 	spell->iconScroll = graphicsNode["iconScroll"].String();
 
-
+	const JsonNode & animationNode = json["animation"];
+	spell->animationInfo.affect = animationNode["affect"].convertTo<CSpell::TAnimationQueue>();
+	spell->animationInfo.cast = animationNode["cast"].convertTo<CSpell::TAnimationQueue>();
+	spell->animationInfo.hit = animationNode["hit"].convertTo<CSpell::TAnimationQueue>();
+	
+	const JsonVector & projectile = animationNode["projectile"].Vector();
+	
+	for(const JsonNode & item : projectile)
+	{
+		CSpell::ProjectileInfo info;
+		info.defName = item["defName"].String();
+		info.minimumAngle = item["minimumAngle"].Float();
+		
+		spell->animationInfo.projectile.push_back(info);
+	}
 
 	const JsonNode & soundsNode = json["sounds"];
-
 	spell->castSound = soundsNode["cast"].String();