Difference between revisions of "Bonus Format"

From VCMI Project Wiki
Jump to: navigation, search
(Full format)
(Full format)
Line 22: Line 22:
 
"sourceID" : 0,
 
"sourceID" : 0,
 
"effectRange" : "EFFECT_RANGE",
 
"effectRange" : "EFFECT_RANGE",
"limiters" : [["LIMITER_TYPE", optional_parameters (...)]]
+
"limiters" : [
 +
"PREDEFINED_LIMITER", optional_parameters (...), //whhich one is preferred?
 +
{"type" : LIMITER_TYPE, "parameters" : [1,2,3]}
 +
]
 
"propagator" : ["PROPAGATOR_TYPE", optional_parameters (...)]
 
"propagator" : ["PROPAGATOR_TYPE", optional_parameters (...)]
 
"description" : ""
 
"description" : ""

Revision as of 09:59, 16 January 2013

Enumerative parameters are described in HeroBonus.h file.

Short format

{
["BONUS_TYPE", val, subtype, additionalInfo]
}

Full format

All parameters but type are optional.

{
	"type": 	"BONUS_TYPE",
	"subtype": 	0,
	"val" : 	0,
	"valueType": 	"VALUE_TYPE",
	"addInfo" : 	0,

	"duration" : 	"BONUS_DURATION", //or "BONUS_DURATION1 BONUS_DURATION2 ..."
	"turns" : 	0,

	"sourceType" : 	"SOURCE_TYPE",
	"sourceID" : 	0,
	"effectRange" : "EFFECT_RANGE",
	"limiters" : 	[
				"PREDEFINED_LIMITER", optional_parameters (...), //whhich one is preferred?
				{"type" : LIMITER_TYPE, "parameters" : [1,2,3]}
			]
	"propagator" : 	["PROPAGATOR_TYPE", optional_parameters (...)]
	"description" : ""
}

Subtype resolution

All string identifiers of items can be used in "subtype" field. This allows cross-referencing between the mods and make config file more readable.

Available prefixes

  • creature.
  • artifact.
  • skill.
"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"
  • resource.

Possible values:

 "wood", "mercury", "ore", "sulfur", "crystal", "gems", "gold", "mithril"
  • hero.
  • faction.

Example

"bonus" :
{
	"type" : "HATE",
	"subtype" : "creature.enchanter",
	"val" : 50
}

This bonus makes creature do 50% more damage to Enchanters.

Bonus string constants

Additional links

Bonus system