1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-28 23:06:24 +02:00

loading secondary skill bonuses from config/skills.json works (kind of)

This commit is contained in:
Henning Koehler 2017-08-22 21:40:10 +12:00
parent 9811fbe02c
commit 05cf95400c
4 changed files with 68 additions and 0 deletions

View File

@ -76,5 +76,9 @@
"config/spells/other.json",
"config/spells/timed.json",
"config/spells/ability.json"
],
"skills" :
[
"config/skills.json"
]
}

33
config/schemas/skill.json Normal file
View File

@ -0,0 +1,33 @@
{
"type":"object",
"$schema": "http://json-schema.org/draft-04/schema",
"title" : "VCMI skill format",
"description" : "Format used to replace bonuses provided by secondary skills in VCMI",
"definitions" : {
"skillBonus":{
"description": "Set of bonuses provided by skill at given level",
"type": "array",
"items":{
"$ref" : "vcmi:bonus"
}
},
"required" : ["basic", "advanced", "expert"],
"properties": {
"basic":{
"$ref" : "#/definitions/skillBonus"
},
"advanced":{
"$ref" : "#/definitions/skillBonus"
},
"expert":{
"$ref" : "#/definitions/skillBonus"
},
}
}
}

29
config/skills.json Normal file
View File

@ -0,0 +1,29 @@
{
"estates" : {
"index" : 13,
"basic" : [
{
"subtype" : 13,
"type" : "SECONDARY_SKILL_PREMY",
"val" : 250,
"valueType" : "BASE_NUMBER"
}
],
"advanced" : [
{
"subtype" : 13,
"type" : "SECONDARY_SKILL_PREMY",
"val" : 500,
"valueType" : "BASE_NUMBER"
}
],
"expert" : [
{
"subtype" : 13,
"type" : "SECONDARY_SKILL_PREMY",
"val" : 1000,
"valueType" : "BASE_NUMBER"
}
]
}
}

View File

@ -23,6 +23,7 @@
#include "CStopWatch.h"
#include "IHandlerBase.h"
#include "spells/CSpellHandler.h"
#include "CSkillHandler.h"
CIdentifierStorage::CIdentifierStorage():
state(LOADING)
@ -420,6 +421,7 @@ CContentHandler::CContentHandler()
handlers.insert(std::make_pair("objects", ContentTypeHandler(VLC->objtypeh, "object")));
handlers.insert(std::make_pair("heroes", ContentTypeHandler(VLC->heroh, "hero")));
handlers.insert(std::make_pair("spells", ContentTypeHandler(VLC->spellh, "spell")));
handlers.insert(std::make_pair("skills", ContentTypeHandler(VLC->skillh, "skill")));
handlers.insert(std::make_pair("templates", ContentTypeHandler((IHandlerBase *)VLC->tplh, "template")));
//TODO: any other types of moddables?