Difference between revisions of "Bonus Format"

From VCMI Project Wiki
Jump to: navigation, search
(Example)
(Subtype resolution)
Line 31: Line 31:
  
 
All string identifiers of items can be used in "subtype" field. This allows cross-referencing between the mods and make config more rewadble. The following identifiers are supported:
 
All string identifiers of items can be used in "subtype" field. This allows cross-referencing between the mods and make config more rewadble. The following identifiers are supported:
* [creature.]
+
* creature.
* [artifact.]
+
* artifact.
* [skill.]
+
* skill.
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
"pathfinding",  "archery",      "logistics",    "scouting",    "diplomacy",
 
"pathfinding",  "archery",      "logistics",    "scouting",    "diplomacy",
Line 42: Line 42:
 
"sorcery",      "resistance",  "firstAid"
 
"sorcery",      "resistance",  "firstAid"
 
</syntaxhighlight>
 
</syntaxhighlight>
* [resource.]
+
* resource.
 
Possible values:
 
Possible values:
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
  "wood", "mercury", "ore", "sulfur", "crystal", "gems", "gold", "mithril"
 
  "wood", "mercury", "ore", "sulfur", "crystal", "gems", "gold", "mithril"
 
</syntaxhighlight>
 
</syntaxhighlight>
* [hero.]
+
* hero.
* [faction.]
+
* faction.
 
=== Example ===
 
=== Example ===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">

Revision as of 10:26, 26 December 2012

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",
	"turns" : 	0,

	"sourceType" : 	"SOURCE_TYPE",
	"sourceID" : 	0,
	"effectRange" : "EFFECT_RANGE",
	"limiter" : 	["LIMITER_TYPE", optional_parameters (...)]
	"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 more rewadble. The following identifiers are supported:

  • 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