| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- {
- "type" : "object",
- "$schema" : "http://json-schema.org/draft-04/schema",
- "title" : "VCMI bonus system format",
- "description" : "Subsection of several formats, used to add generic bonuses to objects",
- "required" : ["type"],
- "definitions" :
- {
- "nestedLimiter" : {
- "allOf" : [
- {
- "if" : {
- "type" : "string"
- },
- "then" : {
- "enum" : [ "allOf", "anyOf", "noneOf", "SHOOTER_ONLY", "DRAGON_NATURE", "IS_UNDEAD", "CREATURE_NATIVE_TERRAIN", "CREATURES_ONLY", "OPPOSITE_SIDE" ],
- "description" : "parameterless limiter or boolean operator at start of array"
- }
- },
- {
- "if" : {
- "type" : "object",
- "required" : [ "type" ],
- "properties" : {
- "type" : { "type" : "string", "const" : "CREATURE_TYPE_LIMITER" }
- }
- },
- "then" : {
- "additionalProperties" : false,
- "required" : [ "type", "creature" ],
- "properties" : {
- "type" : { "type" : "string", "const" : "CREATURE_TYPE_LIMITER" },
- "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
- "creature" : { "type" : "string" },
- "includeUpgrades" : { "type" : "boolean" }
- }
- }
- },
- {
- "if" : {
- "type" : "object",
- "required" : [ "type" ],
- "properties" : {
- "type" : { "type" : "string", "const" : "HAS_ANOTHER_BONUS_LIMITER" }
- }
- },
- "then" : {
- "additionalProperties" : false,
- "properties" : {
- "type" : { "type" : "string", "const" : "HAS_ANOTHER_BONUS_LIMITER" },
- "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
- "bonusType" : { "type" : "string" },
- "bonusSubtype" : { "type" : "string" },
- "bonusSourceType" : { "type" : "string" },
- "bonusSourceID" : { "type" : "string" }
- }
- }
- },
- {
- "if" : {
- "type" : "object",
- "properties" : {
- "type" : { "type" : "string", "const" : "CREATURE_ALIGNMENT_LIMITER" }
- }
- },
- "then" : {
- "additionalProperties" : false,
- "properties" : {
- "type" : { "type" : "string", "const" : "CREATURE_ALIGNMENT_LIMITER" },
- "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
- "alignment" : { "type" : "string", "enum" : [ "good", "evil", "neutral" ] }
- }
- }
- },
- {
- "if" : {
- "type" : "object",
- "required" : [ "type" ],
- "properties" : {
- "type" : { "type" : "string", "enum" : [ "CREATURE_FACTION_LIMITER", "FACTION_LIMITER" ] }
- }
- },
- "then" : {
- "additionalProperties" : false,
- "properties" : {
- "type" : { "type" : "string", "enum" : [ "CREATURE_FACTION_LIMITER", "FACTION_LIMITER" ] },
- "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
- "faction" : { "type" : "string" }
- }
- }
- },
- {
- "if" : {
- "type" : "object",
- "required" : [ "type" ],
- "properties" : {
- "type" : { "type" : "string", "const" : "CREATURE_LEVEL_LIMITER" }
- }
- },
- "then" : {
- "additionalProperties" : false,
- "properties" : {
- "type" : { "type" : "string", "const" : "CREATURE_LEVEL_LIMITER" },
- "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
- "minLevel" : { "type" : "number" },
- "maxlevel" : { "type" : "number" }
- }
- }
- },
- {
- "if" : {
- "type" : "object",
- "required" : [ "type" ],
- "properties" : {
- "type" : { "type" : "string", "enum" : [ "CREATURE_TERRAIN_LIMITER", "TERRAIN_LIMITER" ] }
- }
- },
- "then" : {
- "additionalProperties" : false,
- "properties" : {
- "type" : { "type" : "string", "enum" : [ "CREATURE_TERRAIN_LIMITER", "TERRAIN_LIMITER" ] },
- "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
- "terrain" : { "type" : "string" }
- }
- }
- },
- {
- "if" : {
- "type" : "object",
- "required" : [ "type" ],
- "properties" : {
- "type" : { "type" : "string", "const" : "UNIT_ON_HEXES" }
- }
- },
- "then" : {
- "additionalProperties" : false,
- "properties" : {
- "type" : { "type" : "string", "const" : "UNIT_ON_HEXES" },
- "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
- "hexes" : { "type" : "array", "items" : { "type" : "number" } }
- }
- }
- },
- {
- "if" : {
- "type" : "object",
- "required" : [ "type" ],
- "properties" : {
- "type" : { "type" : "string", "const" : "HAS_CHARGES_LIMITER" }
- }
- },
- "then" : {
- "additionalProperties" : false,
- "properties" : {
- "type" : { "type" : "string", "const" : "HAS_CHARGES_LIMITER" },
- "parameters" : { "type" : "array", "description" : "parameters", "additionalItems" : true },
- "cost" : { "type" : "number" }
- }
- }
- },
- {
- "if" : {
- "type" : "array"
- },
- "then" : {
- "items" : {
- "$ref" : "#/definitions/nestedLimiter",
- "description" : "nested limiters optionally prefixed with boolean operator"
- }
- }
- }
- ]
- },
- "updater" :
- {
- "anyOf" : [
- {
- "type" : "string",
- "enum" : [ "TIMES_HERO_LEVEL", "TIMES_STACK_LEVEL", "DIVIDE_STACK_LEVEL", "BONUS_OWNER_UPDATER", "TIMES_STACK_SIZE", "TIMES_HERO_LEVEL_DIVIDE_STACK_LEVEL" ]
- },
- {
- "description" : "GROWS_WITH_LEVEL updater",
- "type" : "object",
- "required" : ["type", "valPer20", "stepSize"],
- "additionalProperties" : false,
- "properties" : {
- "type" : {
- "type" : "string",
- "const" : "GROWS_WITH_LEVEL"
- },
- "valPer20" : {
- "type" : "integer",
- "description" : "Bonus value for each 20 steps"
- },
- "stepSize" : {
- "type" : "integer",
- "minimum" : 1,
- "description" : "Size of each step, in levels"
- }
- }
- },
- {
- "description" : "TIMES_HERO_LEVEL updater",
- "type" : "object",
- "required" : ["type"],
- "additionalProperties" : false,
- "properties" : {
- "type" : {
- "type" : "string",
- "const" : "TIMES_HERO_LEVEL"
- },
- "stepSize" : {
- "type" : "integer",
- "minimum" : 1,
- "description" : "Size of each step, in levels"
- }
- }
- },
- {
- "description" : "TIMES_STACK_SIZE updater",
- "type" : "object",
- "required" : ["type"],
- "additionalProperties" : false,
- "properties" : {
- "type" : {
- "type" : "string",
- "const" : "TIMES_STACK_SIZE"
- },
- "stepSize" : {
- "type" : "integer",
- "minimum" : 1,
- "description" : "Size of each step, in levels"
- },
- "minimum" : {
- "type" : "integer",
- "description" : "Minimal bonus value"
- },
- "maximum" : {
- "type" : "integer",
- "description" : "Maximal bonus value"
- }
- }
- },
- {
- "description" : "TIMES_ARMY_SIZE updater",
- "type" : "object",
- "required" : ["type"],
- "additionalProperties" : false,
- "properties" : {
- "type" : {
- "type" : "string",
- "const" : "TIMES_ARMY_SIZE"
- },
- "stepSize" : {
- "type" : "integer",
- "minimum" : 1,
- "description" : "Size of each step, in levels"
- },
- "minimum" : {
- "type" : "integer",
- "description" : "Minimal bonus value"
- },
- "maximum" : {
- "type" : "integer",
- "description" : "Maximal bonus value"
- },
- "filteredLevel" : {
- "type" : "integer",
- "description" : "Level of units to count"
- },
- "filteredFaction" : {
- "type" : "string",
- "description" : "Faction of units to count"
- },
- "filteredCreature" : {
- "type" : "string",
- "description" : "Specific unit to count"
- }
- }
- }
- ]
- }
- },
- "additionalProperties" : false,
- "properties" : {
- "type" : {
- "type" : "string",
- "description" : "type"
- },
- "subtype" : {
- "type" : "string",
- "description" : "subtype"
- },
- "sourceID" : {
- "type" : "number",
- "description" : "sourceID"
- },
- "sourceType" : {
- "type" : "string",
- "enum" : [ "ARTIFACT", "ARTIFACT_INSTANCE", "OBJECT_TYPE", "OBJECT_INSTANCE", "CREATURE_ABILITY", "TERRAIN_NATIVE", "TERRAIN_OVERLAY", "SPELL_EFFECT", "TOWN_STRUCTURE", "HERO_BASE_SKILL", "SECONDARY_SKILL", "HERO_SPECIAL", "ARMY", "CAMPAIGN_BONUS", "STACK_EXPERIENCE", "COMMANDER", "GLOBAL", "OTHER" ],
- "description" : "sourceType"
- },
- "targetSourceType" : {
- "type" : "string",
- "enum" : [ "ARTIFACT", "ARTIFACT_INSTANCE", "OBJECT_TYPE", "OBJECT_INSTANCE", "CREATURE_ABILITY", "TERRAIN_NATIVE", "TERRAIN_OVERLAY", "SPELL_EFFECT", "TOWN_STRUCTURE", "HERO_BASE_SKILL", "SECONDARY_SKILL", "HERO_SPECIAL", "ARMY", "CAMPAIGN_BONUS", "STACK_EXPERIENCE", "COMMANDER", "GLOBAL", "OTHER" ],
- "description" : "targetSourceType"
- },
- "propagator" : {
- "description" : "propagator",
- "type" : "string",
- "enum" : [ "BATTLE_WIDE", "TOWN_AND_VISITOR", "PLAYER", "HERO", "TOWN", "ARMY", "TEAM", "GLOBAL_EFFECT" ]
- },
- "updater" : {
- "$ref" : "#/definitions/updater"
- },
- "propagationUpdater" : {
- "$ref" : "#/definitions/updater"
- },
- "limiters" : {
- "$ref" : "#/definitions/nestedLimiter",
- "description" : "limiter"
- },
- "effectRange" : {
- "type" : "string",
- "enum" : [ "NO_LIMIT", "ONLY_DISTANCE_FIGHT", "ONLY_MELEE_FIGHT" ],
- "description" : "effectRange"
- },
- "val" : {
- "type" : "number",
- "description" : "val"
- },
- "valueType" : {
- "type" : "string",
- "enum" : ["ADDITIVE_VALUE", "BASE_NUMBER", "PERCENT_TO_ALL", "PERCENT_TO_BASE", "PERCENT_TO_SOURCE", "PERCENT_TO_TARGET_TYPE", "INDEPENDENT_MAX", "INDEPENDENT_MIN" ],
- "description" : "valueType"
- },
- "addInfo" : {
- "anyOf" : [
- { "type" : "string" },
- { "type" : "number" },
- {
- "type" : "array",
- "items" : {
- "anyof" : [
- { "type" : "string" },
- { "type" : "number" }
- ]
- }
- }
- ],
- "description" : "addInfo"
- },
- "duration" : {
- "anyOf" : [
- {
- "type" : "string",
- "enum" : ["PERMANENT", "ONE_BATTLE", "ONE_DAY", "ONE_WEEK", "N_TURNS", "N_DAYS", "UNTIL_BEING_ATTACKED", "UNTIL_ATTACK", "STACK_GETS_TURN", "COMMANDER_KILLED", "UNTIL_OWN_ATTACK" ]
- },
- {
- "type" : "array",
- "items" : {
- "type" : "string",
- "enum" : ["PERMANENT", "ONE_BATTLE", "ONE_DAY", "ONE_WEEK", "N_TURNS", "N_DAYS", "UNTIL_BEING_ATTACKED", "UNTIL_ATTACK", "STACK_GETS_TURN", "COMMANDER_KILLED", "UNTIL_OWN_ATTACK" ]
- }
- }
- ],
- "description" : "duration"
- },
- "turns" : {
- "type" : "number",
- "description" : "turns"
- },
- "stacking" : {
- "type" : "string",
- "description" : "stacking"
- },
- "icon" : {
- "type" : "string",
- "description" : "Optional, custom icons to show in creature window",
- "format" : "imageFile"
- },
- "description" : {
- "anyOf" : [
- { "type" : "string" },
- { "type" : "number" }
- ],
- "description" : "description"
- },
- "hidden" : {
- "type" : "boolean",
- "description" : "Optional, hide bonus in creature window"
- }
- }
- }
|