1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00
Files
vcmi/docs/modders/Bonus/Bonus_Limiters.md

154 lines
2.6 KiB
Markdown
Raw Normal View History

2024-07-16 20:29:20 +02:00
# Bonus Limiters
2023-08-13 00:17:38 +03:00
## Predefined Limiters
The limiters take no parameters:
- SHOOTER_ONLY
- DRAGON_NATURE
- IS_UNDEAD
- CREATURE_NATIVE_TERRAIN
- CREATURE_FACTION
- SAME_FACTION
- CREATURES_ONLY
- OPPOSITE_SIDE
2023-08-13 00:17:38 +03:00
Example:
```json
2023-08-13 00:17:38 +03:00
"limiters" : [ "SHOOTER_ONLY" ]
```
## Customizable Limiters
### HAS_ANOTHER_BONUS_LIMITER
Bonus is only active if affected entity has another bonus that meets conditions
2023-08-13 00:17:38 +03:00
Parameters:
- Bonus type
- bonus subtype
- bonus sourceType and sourceId in struct
All parameters are optional. Values that don't need checking can be replaces with `null`
Examples:
- Adele specialty: active if unit has any bonus from Bless spell
2023-08-13 00:17:38 +03:00
```json
2023-08-13 00:17:38 +03:00
"limiters" : [
{
"type" : "HAS_ANOTHER_BONUS_LIMITER",
"parameters" : [
null,
null,
2023-08-13 00:17:38 +03:00
{
"type" : "SPELL_EFFECT",
"id" : "spell.bless"
}
]
}
],
```
- Mutare specialty: active if unit has `DRAGON_NATURE` bonus
```json
"limiters" : [
{
"parameters" : [ "DRAGON_NATURE" ],
"type" : "HAS_ANOTHER_BONUS_LIMITER"
}
],
```
2023-08-13 00:17:38 +03:00
### CREATURE_TYPE_LIMITER
Bonus is only active on creatures of specified type
2023-08-13 00:17:38 +03:00
Parameters:
- Creature id (string)
- (optional) include upgrades - default is false. If creature has multiple upgrades, or upgrades have their own upgrades, all such creatures will be affected. Special upgrades such as upgrades via specialties (Dragon, Gelu) are not affected
Example:
```json
"limiters": [ {
"type":"CREATURE_TYPE_LIMITER",
"parameters": [ "angel", true ]
} ],
```
2023-08-13 00:17:38 +03:00
### CREATURE_ALIGNMENT_LIMITER
Bonus is only active on creatures of factions of specified alignment
2023-08-13 00:17:38 +03:00
Parameters:
- Alignment identifier, `good`, `evil`, or `neutral`
2023-08-13 00:17:38 +03:00
### CREATURE_LEVEL_LIMITER
If parameters is empty, level limiter works as CREATURES_ONLY limiter
Parameters:
- Minimal level
- Maximal level
### FACTION_LIMITER
2023-08-13 00:17:38 +03:00
Parameters:
- Faction identifier
2023-08-13 00:17:38 +03:00
### CREATURE_TERRAIN_LIMITER
Parameters:
- Terrain identifier
2023-08-13 00:17:38 +03:00
Example:
```json
2023-08-13 00:17:38 +03:00
"limiters" : [ {
"type" : "CREATURE_TERRAIN_LIMITER",
"parameters" : ["sand"]
} ]
```
### UNIT_ON_HEXES
Parameters:
- List of affected battlefield hexes
For reference on tiles indexes see image below:
![Battlefield Hexes Layout](../../images/Battle_Field_Hexes.svg)
2023-08-13 00:17:38 +03:00
## Aggregate Limiters
The following limiters must be specified as the first element of a list,
and operate on the remaining limiters in that list:
- allOf (default when no aggregate limiter is specified)
- anyOf
- noneOf
2023-08-13 00:17:38 +03:00
Example:
```json
2023-08-13 00:17:38 +03:00
"limiters" : [
"noneOf",
"IS_UNDEAD",
{
"type" : "HAS_ANOTHER_BONUS_LIMITER",
"parameters" : [ "SIEGE_WEAPON" ]
}
]
```