Difference between revisions of "Bonus Format"

From VCMI Project Wiki
Jump to: navigation, search
(Full format)
(20 intermediate revisions by 4 users not shown)
Line 13: Line 13:
 
"subtype": 0,
 
"subtype": 0,
 
"val" : 0,
 
"val" : 0,
"valueType", "VALUE_TYPE",
+
"valueType": "VALUE_TYPE",
"addInfo" : 0,
+
"addInfo" : 0, // or [1, 2, ...]
  
"duration" : "BONUS_DURATION",
+
"duration" : "BONUS_DURATION", //or ["BONUS_DURATION1", "BONUS_DURATION2", ...]"
 
"turns" : 0,
 
"turns" : 0,
  
Line 22: Line 22:
 
"sourceID" : 0,
 
"sourceID" : 0,
 
"effectRange" : "EFFECT_RANGE",
 
"effectRange" : "EFFECT_RANGE",
"limiter" : ["LIMITER_TYPE", optional_parameters (...)]
+
"limiters" : [
"propagator" : ["PROPAGATOR_TYPE", optional_parameters (...)]
+
"PREDEFINED_LIMITER", optional_parameters (...), //whhich one is preferred?
 +
{"type" : LIMITER_TYPE, "parameters" : [1,2,3]}
 +
],
 +
"propagator" : ["PROPAGATOR_TYPE", optional_parameters (...)],
 +
"updater" : {Bonus Updater},
 
"description" : ""
 
"description" : ""
 
}
 
}
Line 30: Line 34:
 
== Subtype resolution ==
 
== 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:
+
All string identifiers of items can be used in "subtype" field. This allows cross-referencing between the mods and make config file more readable.
* [creature.]
+
=== Available prefixes ===
* [artifact.]
+
* creature.
* [skill.]
+
* artifact.
 +
* skill.
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
"pathfinding",  "archery",      "logistics",    "scouting",    "diplomacy",
 
"pathfinding",  "archery",      "logistics",    "scouting",    "diplomacy",
Line 42: Line 47:
 
"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.
 +
* spell.
 +
* primSkill
 +
<syntaxhighlight lang="javascript">
 +
"attack", "defence", "spellpower", "knowledge"
 +
</syntaxhighlight>
 +
* terrain (since 0.99)
 +
<syntaxhighlight lang="javascript">
 +
"dirt", "sand", "grass", "snow", "swamp", "rough", "subterra", "lava", "water", "rock"
 +
</syntaxhighlight>
  
== Bonus string constants ==
+
=== Example ===
*[[Bonus Format]]
+
<syntaxhighlight lang="javascript">
*[[List of all bonus types]]
+
"bonus" :
*[[List of bonus value types]]
+
{
*[[List of bonus range types]]
+
"type" : "HATE",
*[[List of bonus duration types]]
+
"subtype" : "creature.enchanter",
*[[List of bonus sources]]
+
"val" : 50
*[[List of bonus limiters]]
+
}
*[[List of bonus propagators]]
+
</syntaxhighlight>
 +
This bonus makes creature do 50% more damage to Enchanters.
  
= Additional links =
+
{{Bonuses}}
[[Bonus system]]
 

Revision as of 01:33, 18 March 2018

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, // or [1, 2, ...]

	"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 (...)],
	"updater" :	{Bonus Updater},
	"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.
  • spell.
  • primSkill
 "attack", "defence", "spellpower", "knowledge"
  • terrain (since 0.99)
 "dirt", "sand", "grass", "snow", "swamp", "rough", "subterra", "lava", "water", "rock"

Example

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

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

Bonus string constants

Additional links