| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708 |
- {
- "type" : "object",
- "$schema" : "http://json-schema.org/draft-04/schema",
- "title" : "VCMI spell format",
- "description" : "Format used to define new spells in VCMI",
- "definitions" : {
- "animationQueue" : {
- "type" : "array",
- "items" : {
- "anyOf" :[
- {
- //dummy animation, pause, Value - frame count
- "type" : "number"
- },
- {
- //assumed verticalPosition: top
- "type" : "string",
- "format" : "animationFile"
- },
- {
- "type" : "object",
- "properties" : {
- "verticalPosition" : {"type" : "string", "enum" :["top","bottom"]},
- "defName" : {"type" : "string", "format" : "animationFile"},
- "effectName" : { "type" : "string" },
- "transparency" : {"type" : "number", "minimum" : 0, "maximum" : 1}
- },
- "additionalProperties" : false
- }
- ]
- }
- },
- "animation" : {
- "type" : "object",
- "additionalProperties" : false,
- "properties" : {
- "affect" : {"$ref" : "#/definitions/animationQueue"},
- "hit" : {"$ref" : "#/definitions/animationQueue"},
- "cast" : {"$ref" : "#/definitions/animationQueue"},
- "projectile" : {
- "type" : "array",
- "items" : {
- "type" : "object",
- "properties" : {
- "defName" : {"type" : "string", "format" : "animationFile"},
- "minimumAngle" : {"type" : "number", "minimum" : 0}
- },
- "additionalProperties" : false
- }
- }
- }
- },
- "adventureEffect" : {
- "type" : "object",
- "required" : [ "type" ],
- "properties" : {
- "type" : {
- "type" : "string",
- "enum" : [ "generic", "dimensionDoor", "removeObject", "summonBoat", "townPortal", "viewWorld" ]
- },
- "castsPerDay" : { "type" : "number" },
- "castsPerDayXL" : { "type" : "number" },
- "bonuses" : { "additionalProperties" : { "$ref" : "bonusInstance.json" }}
- },
- "allOf" : [
- {
- "if" : { "properties" : { "type" : { "const" : "dimensionDoor" } } },
- "then" : {
- "properties" : {
- "castsPerDay" : {},
- "castsPerDayXL" : {},
- "bonuses" : {},
- "type" : {},
- "rangeX" : { "type" : "number" },
- "rangeY" : { "type" : "number" },
- "ignoreFow" : { "type" : "boolean" },
- "cursor" : { "type" : "string" },
- "cursorGuarded" : { "type" : "string" },
- "movementPointsRequired" : { "type" : "number" },
- "movementPointsTaken" : { "type" : "number" },
- "waterLandFailureTakesPoints" : { "type" : "boolean" },
- "exposeFow" : { "type" : "boolean" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "removeObject" } } },
- "then" : {
- "properties" : {
- "castsPerDay" : {},
- "castsPerDayXL" : {},
- "bonuses" : {},
- "type" : {},
- "rangeX" : { "type" : "number" },
- "rangeY" : { "type" : "number" },
- "ignoreFow" : { "type" : "boolean" },
- "cursor" : { "type" : "string" },
- "objects" : { "additionalProperties" : { "type" : "boolean" } }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "summonBoat" } } },
- "then" : {
- "properties" : {
- "castsPerDay" : {},
- "castsPerDayXL" : {},
- "bonuses" : {},
- "type" : {},
- "useExistingBoat" : { "type" : "boolean" },
- "createdBoat" : { "type" : "string" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "townPortal" } } },
- "then" : {
- "properties" : {
- "castsPerDay" : {},
- "castsPerDayXL" : {},
- "bonuses" : {},
- "type" : {},
- "movementPointsRequired" : { "type" : "number" },
- "movementPointsTaken" : { "type" : "number" },
- "allowTownSelection" : { "type" : "boolean" },
- "skipOccupiedTowns" : { "type" : "boolean" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "viewWorld" } } },
- "then" : {
- "properties" : {
- "castsPerDay" : {},
- "castsPerDayXL" : {},
- "bonuses" : {},
- "type" : {},
- "showTerrain" : { "type" : "boolean" },
- "objects" : { "additionalProperties" : { "type" : "boolean" } }
- },
- "additionalProperties" : false
- }
- }
- ]
- },
- "battleEffect" : {
- "type" : "object",
- "required" : [ "type" ],
- "properties" : {
- "type" : {
- "type" : "string",
- "enum" : [
- "core:catapult",
- "core:clone",
- "core:damage",
- "core:demonSummon",
- "core:dispel",
- "core:heal",
- "core:moat",
- "core:obstacle",
- "core:removeObstacle",
- "core:sacrifice",
- "core:summon",
- "core:teleport",
- "core:timed"
- ]
- },
- "indirect" : { "type" : "boolean" },
- "optional" : { "type" : "boolean" }
- },
- "allOf" : [
- {
- "if" : { "properties" : { "type" : { "const" : "core:catapult" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "targetsToAttack" : { "type" : "number" },
- "chanceToHitKeep" : { "type" : "number" },
- "chanceToHitGate" : { "type" : "number" },
- "chanceToHitTower" : { "type" : "number" },
- "chanceToHitWall" : { "type" : "number" },
- "chanceToNormalHit" : { "type" : "number" },
- "chanceToCrit" : { "type" : "number" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:clone" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "ignoreImmunity" : { "type" : "boolean" },
- "chainLength" : { "type" : "number" },
- "chainFactor" : { "type" : "number" },
- "maxTier" : { "type" : "number" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:damage" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "ignoreImmunity" : { "type" : "boolean" },
- "chainLength" : { "type" : "number" },
- "chainFactor" : { "type" : "number" },
- "killByPercentage" : { "type" : "boolean" },
- "killByCount" : { "type" : "boolean" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:demonSummon" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "ignoreImmunity" : { "type" : "boolean" },
- "chainLength" : { "type" : "number" },
- "chainFactor" : { "type" : "number" },
- "id" : { "type" : "string" },
- "permanent" : { "type" : "boolean" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:dispel" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "ignoreImmunity" : { "type" : "boolean" },
- "chainLength" : { "type" : "number" },
- "chainFactor" : { "type" : "number" },
- "dispelPositive" : { "type" : "boolean" },
- "dispelNegative" : { "type" : "boolean" },
- "dispelNeutral" : { "type" : "boolean" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "enum" : [ "core:heal", "core:sacrifice" ] } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "ignoreImmunity" : { "type" : "boolean" },
- "chainLength" : { "type" : "number" },
- "chainFactor" : { "type" : "number" },
- "healLevel" : { "type" : "string" },
- "healPower" : { "type" : "string" },
- "minFullUnits" : { "type" : "number" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:moat" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "hidden" : { "type" : "boolean" },
- "trap" : { "type" : "boolean" },
- "removeOnTrigger" : { "type" : "boolean" },
- "dispellable" : { "type" : "boolean" },
- "moatDamage" : { "type" : "number" },
- "moatHexes" : { "type" : "array", "items" : { "type" : "array", "items" : { "type" : "number" } } },
- "triggerAbility" : { "type" : "string" },
- "defender" : { },
- "bonus" : { "additionalProperties" : { "$ref" : "bonusInstance.json" } }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:obstacle" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "hidden" : { "type" : "boolean" },
- "passable" : { "type" : "boolean" },
- "trap" : { "type" : "boolean" },
- "removeOnTrigger" : { "type" : "boolean" },
- "hideNative" : { "type" : "boolean" },
- "patchCount" : { "type" : "number" },
- "turnsRemaining" : { "type" : "number" },
- "triggerAbility" : { "type" : "string" },
- "attacker" : { },
- "defender" : { }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:removeObstacle" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "removeAbsolute" : { "type" : "boolean" },
- "removeUsual" : { "type" : "boolean" },
- "removeAllSpells" : { "type" : "boolean" },
- "removeSpells" : { }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:summon" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "id" : { "type" : "string" },
- "permanent" : { "type" : "boolean" },
- "exclusive" : { "type" : "boolean" },
- "summonByHealth" : { "type" : "boolean" },
- "summonSameUnit" : { "type" : "boolean" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:teleport" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "ignoreImmunity" : { "type" : "boolean" },
- "chainLength" : { "type" : "number" },
- "chainFactor" : { "type" : "number" },
- "triggerObstacles" : { "type" : "boolean" },
- "isWallPassable" : { "type" : "boolean" },
- "isMoatPassable" : { "type" : "boolean" }
- },
- "additionalProperties" : false
- }
- },
- {
- "if" : { "properties" : { "type" : { "const" : "core:timed" } } },
- "then" : {
- "properties" : {
- "type" : {},
- "indirect" : {},
- "optional" : {},
- "ignoreImmunity" : { "type" : "boolean" },
- "chainLength" : { "type" : "number" },
- "chainFactor" : { "type" : "number" },
- "cumulative" : { "type" : "boolean" },
- "bonus" : { "additionalProperties" : { "$ref" : "bonusInstance.json" } }
- },
- "additionalProperties" : false
- }
- }
- ]
- },
- "flags" : {
- "type" : "object",
- "additionalProperties" : {
- "type" : "boolean"
- }
- },
- "levelInfo" : {
- "type" : "object",
- "required" :["range", "description", "cost", "power"],
- "additionalProperties" : false,
- "properties" : {
- "description" : {
- "type" : "string",
- "description" : "Localizable description. Use {xxx} for formatting"
- },
- "cost" : {
- "type" : "number",
- "description" : "Cost in mana points"
- },
- "power" : {
- "type" : "number"
- },
- "range" : {
- "type" : "string",
- "description" : "spell range description in SRSL"
- },
- "effects" : {
- "type" : "object",
- "description" : "Timed effects (updated by prolongation)",
- "additionalProperties" : {
- "$ref" : "bonusInstance.json"
- }
- },
- "cumulativeEffects" : {
- "type" : "object",
- "description" : "Timed effects (updated by unique bonus)",
- "additionalProperties" : {
- "$ref" : "bonusInstance.json"
- }
- },
- "battleEffects" : {
- "type" : "object",
- "additionalProperties" : {
- "$ref" : "#/definitions/battleEffect"
- }
- },
- "adventureEffect" : {
- "$ref" : "#/definitions/adventureEffect"
- },
- "targetModifier" : {
- "type" : "object",
- "additionalProperties" : false,
- "properties" : {
- "smart" : {
- "type" : "boolean",
- "description" : "true: friendly/hostile based on positiveness; false: all targets"
- },
- "clearAffected" :
- {
- "type" : "boolean",
- "description" : "LOCATION target only. All affected hexes/tile must be clear"
- }
- }
- }
- }
- },
- "texts" : {
- "type" : "object",
- "additionalProperties" : false
- }
- },
- "required" : ["type", "name", "school", "level", "power", "flags", "levels"],
- "additionalProperties" : false,
-
- "allOf": [
- {
- "if": {
- "not" : {
- "properties": {
- "index" : {
- "type" : "number"
- }
- }
- },
- "properties": {
- "type": {
- "enum" : ["adventure", "combat"]
- }
-
- }
- },
- "then": {
- "required" : ["school", "gainChance" ],
- "properties": {
- "levels": {
- "required" : ["none", "basic", "advanced", "expert"]
- },
- "graphics" : {
- "required" : ["iconBook", "iconScroll", "iconEffect", "iconImmune", "iconScenarioBonus"]
- }
- }
- }
- },
- {
- "if": {
- "not" : {
- "properties": {
- "index" : {
- "type" : "number"
- }
- }
- },
- "properties": {
- "type": {
- "const" : "ability"
- }
- }
- },
- "then": {
- "required" : ["school", "gainChance" ],
- "properties": {
- "levels": {
- "required" : ["none"]
- },
- "graphics" : {
- "required" : ["iconEffect", "iconImmune"]
- }
- }
- }
- }
- ],
-
- "properties" : {
- "index" : {
- "type" : "number",
- "description" : "numeric id of spell required only for original spells, prohibited for new spells"
- },
- "name" : {
- "type" : "string",
- "description" : "Localizable name of this spell"
- },
- "type" : {
- "type" : "string",
- "enum" : ["adventure", "combat", "ability"],
- "description" : "Spell type"
- },
- "school" : {
- "type" : "object",
- "description" : "List of spell schools this spell belongs to",
- "additionalProperties" : {
- "type" : "boolean"
- }
- },
- "level" : {
- "type" : "number",
- "description" : "Spell level",
- "minimum" : 0,
- "maximum" : 5
- },
- "power" : {
- "type" : "number",
- "description" : "Base power of the spell"
- },
- "defaultGainChance" : {
- "type" : "number",
- "description" : "Gain chance by default for all factions"
- },
- "canCastOnSelf" : {
- "type" : "boolean",
- "description" : "If used as creature spell, unit can cast this spell on itself"
- },
- "canCastOnlyOnSelf" : {
- "type" : "boolean",
- "description" : "If used as creature spell, unit can cast this spell only on itself"
- },
- "canCastWithoutSkip" : {
- "type" : "boolean",
- "description" : "If used the creature will not skip the turn after casting a spell."
- },
- "gainChance" : {
- "type" : "object",
- "description" : "Chance for this spell to appear in Mage Guild of a specific faction",
- "additionalProperties" : {
- "type" : "number",
- "minimum" : 0
- }
- },
- "targetType" : {
- "type" : "string",
- "description" : "NO_TARGET - instant cast no aiming, default; CREATURE - target is unit; OBSTACLE - target is OBSTACLE; LOCATION - target is location",
- "enum" : ["NO_TARGET","CREATURE","OBSTACLE","LOCATION"]
- },
- "counters" : {
- "$ref" : "#/definitions/flags",
- "description" : "Flags structure ids of countering spells"
- },
- "flags" : {
- "type" : "object",
- "description" : "Various flags",
- "additionalProperties" : false,
- "properties" : {
- "indifferent" : {
- "type" : "boolean",
- "description" : "Spell is indifferent for target"
- },
- "negative" : {
- "type" : "boolean",
- "description" : "Spell is negative for target"
- },
- "positive" : {
- "type" : "boolean",
- "description" : "Spell is positive for target"
- },
- "damage" : {
- "type" : "boolean",
- "description" : "Spell does damage (direct or indirect)"
- },
- "offensive" : {
- "type" : "boolean",
- "description" : "Spell does direct damage (implicitly sets damage and negative)"
- },
- "rising" : {
- "type" : "boolean",
- "description" : "Rising spell (implicitly sets positive)"
- },
- "special" : {
- "type" : "boolean",
- "description" : "Special spell. Can be given only by BonusType::SPELL"
- },
- "nonMagical" : {
- "type" : "boolean",
- "description" : "Non-magical ability. Usually used by some creatures. Should not be affected by sorcery and generic magic resistance. School resistances apply. Examples: dendroid bind, efreet fire shield."
- }
- }
- },
- "immunity" : {
- "$ref" : "#/definitions/flags",
- "description" : "flags structure of bonus names, any one of these bonus grants immunity"
- },
- "absoluteImmunity" : {
- "$ref" : "#/definitions/flags",
- "description" : "flags structure of bonus names. Any one of these bonus grants immunity, can't be negated"
- },
- "limit" : {
- "$ref" : "#/definitions/flags",
- "description" : "flags structure of bonus names, presence of all bonuses required to be affected by."
- },
- "absoluteLimit" : {
- "$ref" : "#/definitions/flags",
- "description" : "flags structure of bonus names, presence of all bonuses required to be affected by, can't be negated."
- },
- "targetCondition" : {
- "type" : "object",
- "additionalProperties" : false,
- "properties" : {
- "noneOf" : { "type" : "object", "additionalProperties" : { "type" : "string", "enum" : [ "absolute", "normal" ] } },
- "anyOf" : { "type" : "object", "additionalProperties" : { "type" : "string", "enum" : [ "absolute", "normal" ] } },
- "allOf" : { "type" : "object", "additionalProperties" : { "type" : "string", "enum" : [ "absolute", "normal" ] } }
- }
- },
- "animation" : {"$ref" : "#/definitions/animation"},
- "graphics" : {
- "type" : "object",
- "additionalProperties" : false,
- "properties" : {
- "iconBook" : {
- "type" : "string",
- "description" : "Resourse path of icon for spellbook" ,
- "format" : "imageFile"
- },
- "iconScroll" : {
- "type" : "string",
- "description" : "Resourse path of icon for spell scrolls",
- "format" : "imageFile"
- },
- "iconEffect" : {
- "type" : "string",
- "description" : "Resourse path of icon for spell effects during battle",
- "format" : "imageFile"
- },
- "iconImmune" : {
- "type" : "string",
- "description" : "Resourse path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)",
- "format" : "imageFile"
- },
- "iconScenarioBonus" : {
- "type" : "string",
- "description" : "Resourse path of 58x64 icon for scenario bonus",
- "format" : "imageFile"
- }
- }
- },
- "sounds" : {
- "type" : "object",
- "additionalProperties" : false,
- "properties" : {
- "cast" : {
- "type" : "string",
- "description" : "Resourse path of cast sound"
- }
- }
- },
- "levels" : {
- "type" : "object",
- "additionalProperties" : false,
- "properties" : {
- "none" : {
- "$ref" : "#/definitions/levelInfo"
- },
- "basic" : {
- "$ref" : "#/definitions/levelInfo"
- },
- "advanced" : {
- "$ref" : "#/definitions/levelInfo"
- },
- "expert" : {
- "$ref" : "#/definitions/levelInfo"
- }
- }
- },
- "onlyOnWaterMap" : {
- "type" : "boolean",
- "description" : "If true, spell won't be available on a map without water"
- }
- }
- }
|