2024-07-16 20:29:20 +02:00
# Bonus Updaters
2023-09-26 12:22:36 +02:00
TODO: this page may be incorrect or outdated
2023-08-12 23:17:38 +02:00
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.
Check the files in *config/heroes/* for additional usage examples.
## GROWS_WITH_LEVEL
2024-11-30 22:20:15 +02:00
- Type: Complex
- Parameters: valPer20, stepSize=1
2024-12-01 13:15:13 +02:00
- Effect: Updates val to `ceil(valPer20 * floor(heroLevel / stepSize) / 20)`
2023-08-12 23:17:38 +02:00
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.
2024-11-30 22:20:15 +02:00
``` jsonc
"updater" : {
"parameters" : [ 6, 2 ],
"type" : "GROWS_WITH_LEVEL"
}
```
2023-08-12 23:17:38 +02:00
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.
2024-11-30 22:20:15 +02:00
``` jsonc
"updater" : {
"parameters" : [ 3 ],
"type" : "GROWS_WITH_LEVEL"
}
```
2023-08-12 23:17:38 +02:00
Remarks:
2024-11-30 22:20:15 +02:00
- The rounding rules are designed to match the attack/defense bonus
2023-08-12 23:17:38 +02:00
progression for heroes with creature specialties in HMM3.
2024-11-30 22:20:15 +02:00
- There is no point in specifying val for a bonus with a
2023-08-12 23:17:38 +02:00
GROWS_WITH_LEVEL updater.
## TIMES_HERO_LEVEL
2024-11-30 22:20:15 +02:00
- Type: Simple
2024-12-01 13:15:13 +02:00
- Effect: Updates val to `val * heroLevel`
2023-08-12 23:17:38 +02:00
2024-12-01 13:15:13 +02:00
Usage: `"updater" : "TIMES_HERO_LEVEL"`
2023-08-12 23:17:38 +02:00
Remark: This updater is redundant, in the sense that GROWS_WITH_LEVEL
can also express the desired scaling by setting valPer20 to 20\*val. It
has been added for convenience.
## TIMES_STACK_LEVEL
2024-11-30 22:20:15 +02:00
- Type: Simple
2024-12-01 13:15:13 +02:00
- Effect: Updates val to `val * stackLevel`
2023-08-12 23:17:38 +02:00
Usage:
2024-11-30 22:20:15 +02:00
`"updater" : "TIMES_STACK_LEVEL"`
2023-08-12 23:17:38 +02:00
Remark: The stack level for war machines is 0.
## ARMY_MOVEMENT
2024-11-30 22:20:15 +02:00
- Type: Complex
2024-12-01 13:15:13 +02:00
- Parameters: basePerSpeed, dividePerSpeed, additionalMultiplier, maxValue
- Effect: Updates val to `val+= max((floor(basePerSpeed / dividePerSpeed) * additionalMultiplier), maxValue)`
- Remark: this updater is designed for MOVEMENT bonus to match H3 army movement rules (in the example - actual movement updater, which produces values same as in default movement.txt).
2024-11-30 22:20:15 +02:00
- Example:
2023-08-12 23:17:38 +02:00
2024-11-30 22:20:15 +02:00
``` jsonc
"updater" : {
"parameters" : [ 20, 3, 10, 700 ],
"type" : "ARMY_MOVEMENT"
}
```
2023-09-12 18:58:15 +02:00
## BONUS_OWNER_UPDATER
2024-11-30 22:20:15 +02:00
TODO: document me