Difference between revisions of "User:AVS/Secondary skill format"

From VCMI Project Wiki
Jump to: navigation, search
(Questions)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
= Questions =
 +
 +
* Should default values (with no skill level) be configured too?
 +
** {{todo}} Discuss with whole team
 +
* Can we avoid limitation of "at most one bonus if each type per skill level"? Current selector code for extract bonus from previous level:
 +
:*<syntaxhighlight lang="cpp">
 +
Selector::type(type).And(Selector::sourceType(Bonus::SECONDARY_SKILL))
 +
</syntaxhighlight>
 +
* Should commander skills be unified with hero skills?
 +
 +
* Should this be a part of HeroClass handler or separate handler?
 +
 
= Format =
 
= Format =
 +
== Skill format ==
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
  
Line 7: Line 20:
 
{
 
{
  
"basic":
+
//required for H3 skills, not allowed in mods (even if mod is overriding original skill) | number
{
+
//numeric id
// optional, number
+
"id": 42,
// most of sec skills use SECONDARY_SKILL_PREMY bonus with skillName subtype
 
// this is value for such case
 
"premyValue": 10,
 
  
//optional object, allows overriding by name
+
//required | string
"bonuses":
+
//translatable name
{
+
"name": "Skill Name",
"firstBonus":{[bonus format]},
 
"secondBonus":{[bonus format]}
 
}
 
  
},
+
//optional | default = false| boolean 
 +
//this skill cant be learned in usual way, overrides chance to get
 +
"special": true,
  
"advanced":
+
//optional| default 0| chance to learn by default for any Hero Class from any mod
{
+
"defaultChance": 3,
"premyValue": 20
 
},
 
  
"expert":
+
//optional | no default | string-numeric dictionary as json object
 +
//class-specific chance (reveresed version of Hero Class attribute)
 +
"chances":
 
{
 
{
"premyValue": 30
+
"core:hero.cleric": 5
 
}
 
}
  
}
+
//required | object
}
+
"levels":{
</syntaxhighlight>
 
  
= Full config =
+
"basic": { [Skill level format]},
  
<syntaxhighlight lang="javascript">
+
"advanced": { [Skill level format]},  
{
 
"pathfinding":
 
{
 
},
 
"archery":
 
{
 
},     
 
"logistics":
 
{
 
},   
 
"scouting":
 
{
 
},   
 
"diplomacy":
 
{
 
},
 
"navigation":
 
{
 
}, 
 
"leadership":
 
{
 
}, 
 
"wisdom":
 
{
 
},     
 
"mysticism":
 
{
 
},   
 
"luck":
 
{
 
},
 
"ballistics":
 
{
 
}, 
 
"eagleEye":
 
{
 
},    
 
"necromancy":
 
{
 
}, 
 
"estates":
 
{
 
},     
 
"fireMagic":
 
{
 
},
 
"airMagic":
 
{
 
},   
 
"waterMagic":
 
{
 
}, 
 
"earthMagic":
 
{
 
}, 
 
"scholar":
 
{
 
},     
 
"tactics":
 
{
 
},     
 
"artillery":
 
{
 
},   
 
"learning":
 
{
 
},   
 
"offence":
 
{
 
},     
 
"armorer":
 
{
 
},     
 
"intelligence":
 
{
 
},
 
"sorcery":
 
{
 
},     
 
"resistance":
 
{
 
}, 
 
"firstAid":
 
{
 
 
 
"basic":
 
{
 
  
 +
"expert": { [Skill level format]}
  
},
+
}
  
"advanced":
+
}
{
+
}
 +
</syntaxhighlight>
  
},
+
== Skill level format ==
 +
<syntaxhighlight lang="javascript">
  
"expert":
+
{
{
+
//optional| default auto-generated| string
 +
//translatable name
 +
"name": "Basic nothing",
  
}
+
//optional |no default| string-bonus dictionary as JSON object
 +
//there are skills handled only by skill level
 +
//and there might be skill that give bonus only on high level
 +
// (allows overriding by name)
 +
// !!! At most one bonus of each type
 +
"bonuses":
 +
{
 +
"firstBonus":{[bonus format]},
 +
"secondBonus":{[bonus format]}
  
 
}
 
}
}
+
},
 +
 
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 10:16, 30 January 2014

Questions

  • Should default values (with no skill level) be configured too?
    • [Todo] Discuss with whole team
  • Can we avoid limitation of "at most one bonus if each type per skill level"? Current selector code for extract bonus from previous level:
  • Selector::type(type).And(Selector::sourceType(Bonus::SECONDARY_SKILL))
    
  • Should commander skills be unified with hero skills?
  • Should this be a part of HeroClass handler or separate handler?

Format

Skill format

{
	"skillName":
	{

		//required for H3 skills, not allowed in mods (even if mod is overriding original skill) | number
		//numeric id
		"id": 42,

		//required | string 
		//translatable name
		"name": "Skill Name",		

		//optional | default = false| boolean  
		//this skill cant be learned in usual way, overrides chance to get
		"special": true,

		//optional| default 0| chance to learn by default for any Hero Class from any mod
		"defaultChance": 3,

		//optional | no default | string-numeric dictionary as json object
		//class-specific chance (reveresed version of Hero Class attribute)
		"chances":
		{
			"core:hero.cleric": 5
		}

		//required | object
		"levels":{

			"basic": { [Skill level format]}, 

			"advanced": { [Skill level format]}, 

			"expert": { [Skill level format]}

		}

	}
}

Skill level format

{
	//optional| default auto-generated| string
	//translatable name
	"name": "Basic nothing",

	//optional |no default| string-bonus dictionary as JSON object
	//there are skills handled only by skill level 
	//and there might be skill that give bonus only on high level 
	// (allows overriding by name)
	// !!! At most one bonus of each type
	"bonuses":
	{
		"firstBonus":{[bonus format]},
		"secondBonus":{[bonus format]}				

	}
},