mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Update bonuses docs
This commit is contained in:
@@ -6,29 +6,59 @@ All parameters but type are optional.
|
|||||||
|
|
||||||
``` javascript
|
``` javascript
|
||||||
{
|
{
|
||||||
|
// Type of the bonus. See Bonus Types for full list
|
||||||
"type": "BONUS_TYPE",
|
"type": "BONUS_TYPE",
|
||||||
|
|
||||||
|
// Subtype of the bonus. Function depends on bonus type.
|
||||||
"subtype": 0,
|
"subtype": 0,
|
||||||
|
|
||||||
|
// Value of the bonus. Function depends on bonus type.
|
||||||
"val" : 0,
|
"val" : 0,
|
||||||
|
|
||||||
|
// Describes how this bonus is accumulated with other bonuses of the same type
|
||||||
"valueType": "VALUE_TYPE",
|
"valueType": "VALUE_TYPE",
|
||||||
|
|
||||||
|
// Additional info that bonus might need. Function depends on bonus type.
|
||||||
"addInfo" : 0, // or [1, 2, ...]
|
"addInfo" : 0, // or [1, 2, ...]
|
||||||
|
|
||||||
|
// How long this bonus should be active until removal.
|
||||||
|
// May use multiple triggers, in which case first event will remove this bonus
|
||||||
"duration" : "BONUS_DURATION", //or ["BONUS_DURATION1", "BONUS_DURATION2", ...]"
|
"duration" : "BONUS_DURATION", //or ["BONUS_DURATION1", "BONUS_DURATION2", ...]"
|
||||||
|
|
||||||
|
// How long this bonus should remain, in days or battle turns (depending on bonus duration)
|
||||||
"turns" : 0,
|
"turns" : 0,
|
||||||
|
|
||||||
|
// TODO
|
||||||
"targetSourceType" : "SOURCE_TYPE",
|
"targetSourceType" : "SOURCE_TYPE",
|
||||||
|
|
||||||
|
// TODO
|
||||||
"sourceType" : "SOURCE_TYPE",
|
"sourceType" : "SOURCE_TYPE",
|
||||||
|
|
||||||
|
// TODO
|
||||||
"sourceID" : 0,
|
"sourceID" : 0,
|
||||||
|
|
||||||
|
// TODO
|
||||||
"effectRange" : "EFFECT_RANGE",
|
"effectRange" : "EFFECT_RANGE",
|
||||||
|
|
||||||
|
// TODO
|
||||||
"limiters" : [
|
"limiters" : [
|
||||||
"PREDEFINED_LIMITER", optional_parameters (...), //whhich one is preferred?
|
"PREDEFINED_LIMITER", optional_parameters (...), //whhich one is preferred?
|
||||||
{"type" : LIMITER_TYPE, "parameters" : [1,2,3]}
|
{"type" : LIMITER_TYPE, "parameters" : [1,2,3]}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// TODO
|
||||||
"propagator" : ["PROPAGATOR_TYPE", optional_parameters (...)],
|
"propagator" : ["PROPAGATOR_TYPE", optional_parameters (...)],
|
||||||
|
|
||||||
|
// TODO
|
||||||
"updater" : {Bonus Updater},
|
"updater" : {Bonus Updater},
|
||||||
|
|
||||||
|
// TODO
|
||||||
"propagationUpdater" : {Bonus Updater, but works during propagation},
|
"propagationUpdater" : {Bonus Updater, but works during propagation},
|
||||||
|
|
||||||
|
// TODO
|
||||||
"description" : "",
|
"description" : "",
|
||||||
|
|
||||||
|
// TODO
|
||||||
"stacking" : ""
|
"stacking" : ""
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -47,43 +77,7 @@ All parameters but type are optional.
|
|||||||
## 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 file more readable.
|
All string identifiers of items can be used in "subtype" field. This allows cross-referencing between the mods and make config file more readable.
|
||||||
|
See [Game Identifiers](Game_Identifiers.md) for full list of available identifiers
|
||||||
### Available prefixes
|
|
||||||
|
|
||||||
- creature.
|
|
||||||
- artifact.
|
|
||||||
- skill:
|
|
||||||
``` javascript
|
|
||||||
"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:
|
|
||||||
``` javascript
|
|
||||||
"wood", "mercury", "ore", "sulfur", "crystal", "gems", "gold", "mithril"
|
|
||||||
```
|
|
||||||
|
|
||||||
- hero.
|
|
||||||
- faction.
|
|
||||||
- spell.
|
|
||||||
- primarySkill
|
|
||||||
``` javascript
|
|
||||||
"attack", "defence", "spellpower", "knowledge"
|
|
||||||
```
|
|
||||||
|
|
||||||
- terrain:
|
|
||||||
``` javascript
|
|
||||||
"dirt", "sand", "grass", "snow", "swamp", "rough", "subterra", "lava", "water", "rock"
|
|
||||||
```
|
|
||||||
|
|
||||||
- spellSchool
|
|
||||||
```javascript
|
|
||||||
"any", "fire", "air", "water", "earth"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
@@ -3,6 +3,8 @@
|
|||||||
Work-in-progress page do describe all bonuses provided by town buildings
|
Work-in-progress page do describe all bonuses provided by town buildings
|
||||||
for future configuration.
|
for future configuration.
|
||||||
|
|
||||||
|
TODO: This page is outdated and may not represent VCMI 1.3 state
|
||||||
|
|
||||||
## unique buildings
|
## unique buildings
|
||||||
|
|
||||||
Hardcoded functionalities, selectable but not configurable. In future
|
Hardcoded functionalities, selectable but not configurable. In future
|
||||||
|
@@ -177,8 +177,6 @@ JsonNode Bonus::toJsonNode() const
|
|||||||
root["subtype"] = subtypeToJson(type, subtype);
|
root["subtype"] = subtypeToJson(type, subtype);
|
||||||
if(additionalInfo != CAddInfo::NONE)
|
if(additionalInfo != CAddInfo::NONE)
|
||||||
root["addInfo"] = additionalInfoToJson(type, additionalInfo);
|
root["addInfo"] = additionalInfoToJson(type, additionalInfo);
|
||||||
if(turnsRemain != 0)
|
|
||||||
root["turns"].Integer() = turnsRemain;
|
|
||||||
if(source != BonusSource::OTHER)
|
if(source != BonusSource::OTHER)
|
||||||
root["sourceType"].String() = vstd::findKey(bonusSourceMap, source);
|
root["sourceType"].String() = vstd::findKey(bonusSourceMap, source);
|
||||||
if(targetSourceType != BonusSource::OTHER)
|
if(targetSourceType != BonusSource::OTHER)
|
||||||
|
Reference in New Issue
Block a user