Difference between revisions of "List of bonus updaters"

From VCMI Project Wiki
Jump to: navigation, search
(Created page with "Note: This feature hasn't been merged yet. See https://github.com/vcmi/vcmi/pull/379. =List of Bonus Updaters= Updaters come in two forms: simple and complex. Simple updater...")
 
(List of Bonus Updaters)
Line 5: Line 5:
 
Updaters come in two forms: simple and complex. Simple updaters take no parameters and are specified as strings. Complex updaters do take parameters (sometimes optional), and are specified as structs.
 
Updaters come in two forms: simple and complex. Simple updaters take no parameters and are specified as strings. Complex updaters do take parameters (sometimes optional), and are specified as structs.
  
* GROWS_WITH_LEVEL
+
==GROWS_WITH_LEVEL==
** Type: Complex
+
* Type: Complex
** Parameters: valPer20, stepSize=1
+
* Parameters: valPer20, stepSize=1
** Effect: Updates val to
+
* Effect: Updates val to
 
     ceil(valPer20 * floor(heroLevel / stepSize) / 20)
 
     ceil(valPer20 * floor(heroLevel / stepSize) / 20)
 
Example: The following updater will cause a bonus to grow by 6 for every 40 levels. At first level, rounding will cause the bonus to be 0.
 
Example: The following updater will cause a bonus to grow by 6 for every 40 levels. At first level, rounding will cause the bonus to be 0.
Line 21: Line 21:
 
     }
 
     }
  
* TIMES_HERO_LEVEL
+
Remark: The rounding rules are designed to match the attack/defense bonus progression for heroes with creature specialties in HMM3.
* TIMES_STACK_LEVEL
+
 
 +
==TIMES_HERO_LEVEL==
 +
* Type: Simple
 +
* Effect: Updates val to
 +
    val * heroLevel
 +
Usage:
 +
    "updater" : "TIMES_HERO_LEVEL"
 +
 
 +
==TIMES_STACK_LEVEL==
 +
* Type: Simple
 +
* Effect: Updates val to
 +
    val * stackLevel
 +
Usage:
 +
    "updater" : "TIMES_STACK_LEVEL"

Revision as of 21:31, 19 September 2017

Note: This feature hasn't been merged yet. See https://github.com/vcmi/vcmi/pull/379.

List of Bonus Updaters

Updaters come in two forms: simple and complex. Simple updaters take no parameters and are specified as strings. Complex updaters do take parameters (sometimes optional), and are specified as structs.

GROWS_WITH_LEVEL

  • Type: Complex
  • Parameters: valPer20, stepSize=1
  • Effect: Updates val to
   ceil(valPer20 * floor(heroLevel / stepSize) / 20)

Example: The following updater will cause a bonus to grow by 6 for every 40 levels. At first level, rounding will cause the bonus to be 0.

   "updater" : {
       "parameters" : [ 6, 2 ],
       "type" : "GROWS_WITH_LEVEL"
   }

Example: The following updater will cause a bonus to grow by 3 for every 20 levels. At first level, rounding will cause the bonus to be 1.

   "updater" : {
       "parameters" : [ 3 ],
       "type" : "GROWS_WITH_LEVEL"
   }

Remark: The rounding rules are designed to match the attack/defense bonus progression for heroes with creature specialties in HMM3.

TIMES_HERO_LEVEL

  • Type: Simple
  • Effect: Updates val to
   val * heroLevel

Usage:

   "updater" : "TIMES_HERO_LEVEL"

TIMES_STACK_LEVEL

  • Type: Simple
  • Effect: Updates val to
   val * stackLevel

Usage:

   "updater" : "TIMES_STACK_LEVEL"