1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00
vcmi/docs/modders/Bonus_Format.md

99 lines
2.5 KiB
Markdown
Raw Normal View History

< [Documentation](../Readme.md) / [Modding](Readme.md) / Bonus Format
2023-08-12 11:39:44 +02:00
2023-09-01 11:11:35 +02:00
## Full format
2023-08-12 11:39:44 +02:00
All parameters but type are optional.
``` javascript
{
2023-09-01 00:30:26 +02:00
"type": "BONUS_TYPE",
"subtype": 0,
"val" : 0,
"valueType": "VALUE_TYPE",
"addInfo" : 0, // or [1, 2, ...]
2023-08-12 11:39:44 +02:00
2023-09-01 00:30:26 +02:00
"duration" : "BONUS_DURATION", //or ["BONUS_DURATION1", "BONUS_DURATION2", ...]"
"turns" : 0,
2023-08-12 11:39:44 +02:00
"targetSourceType" : "SOURCE_TYPE",
2023-09-01 00:30:26 +02:00
"sourceType" : "SOURCE_TYPE",
"sourceID" : 0,
2023-08-12 11:39:44 +02:00
"effectRange" : "EFFECT_RANGE",
2023-09-01 00:30:26 +02:00
"limiters" : [
"PREDEFINED_LIMITER", optional_parameters (...), //whhich one is preferred?
{"type" : LIMITER_TYPE, "parameters" : [1,2,3]}
],
2023-08-12 11:39:44 +02:00
"propagator" : ["PROPAGATOR_TYPE", optional_parameters (...)],
2023-09-01 00:30:26 +02:00
"updater" : {Bonus Updater},
2023-08-12 11:39:44 +02:00
"propagationUpdater" : {Bonus Updater, but works during propagation},
"description" : "",
"stacking" : ""
}
```
2023-09-01 11:11:35 +02:00
## Supported bonus types
- [Bonus Duration Types](Bonus/Bonus_Duration_Types.md)
- [Bonus Sources](Bonus/Bonus_Sources.md)
- [Bonus Limiters](Bonus/Bonus_Limiters.md)
- [Bonus Types](Bonus/Bonus_Types.md)
- [Bonus Propagators](Bonus/Bonus_Propagators.md)
- [Bonus Updaters](Bonus/Bonus_Updaters.md)
- [Bonus Range Types](Bonus/Bonus_Range_Types.md)
- [Bonus Value Types](Bonus/Bonus_Value_Types.md)
2023-08-12 11:39:44 +02:00
## 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.
2023-08-12 11:39:44 +02:00
### Available prefixes
- creature.
- artifact.
2023-09-01 00:30:26 +02:00
- skill:
2023-08-12 11:39:44 +02:00
``` javascript
2023-09-01 00:30:26 +02:00
"pathfinding", "archery", "logistics", "scouting", "diplomacy",
2023-08-12 11:39:44 +02:00
"navigation", "leadership", "wisdom", "mysticism", "luck",
"ballistics", "eagleEye", "necromancy", "estates", "fireMagic",
"airMagic", "waterMagic", "earthMagic", "scholar", "tactics",
"artillery", "learning", "offence", "armorer", "intelligence",
"sorcery", "resistance", "firstAid"
```
2023-09-01 00:30:26 +02:00
- resource:
2023-08-12 11:39:44 +02:00
``` javascript
2023-09-01 00:30:26 +02:00
"wood", "mercury", "ore", "sulfur", "crystal", "gems", "gold", "mithril"
2023-08-12 11:39:44 +02:00
```
- hero.
- faction.
- spell.
2023-09-01 00:30:26 +02:00
- primarySkill
2023-08-12 11:39:44 +02:00
``` javascript
"attack", "defence", "spellpower", "knowledge"
```
2023-09-01 00:30:26 +02:00
- terrain:
2023-08-12 11:39:44 +02:00
``` javascript
"dirt", "sand", "grass", "snow", "swamp", "rough", "subterra", "lava", "water", "rock"
```
2023-09-07 12:09:41 +02:00
- spellSchool
```javascript
"any", "fire", "air", "water", "earth"
```
2023-08-12 11:39:44 +02:00
### Example
``` javascript
"bonus" :
{
"type" : "HATE",
"subtype" : "creature.enchanter",
"val" : 50
}
```
This bonus makes creature do 50% more damage to Enchanters.