inventory.json 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. {
  2. "$schema": "http://json-schema.org/draft-06/schema#",
  3. "properties": {
  4. "items": {
  5. "items": {
  6. "properties": {
  7. "name": {"type": "string"},
  8. "count": {"type": "integer", "minimum": 1},
  9. "countEquipped": {"type": "integer", "minimum": 0},
  10. "value": {"$ref": "#/definitions/money"},
  11. "page": {"type": "string"},
  12. "slot": {
  13. "allOf":[
  14. {"$ref": "#/definitions/slot"},
  15. {"not": {"enum": ["RING1", "RING2"]}}
  16. ]
  17. },
  18. "weight": {"type": "number"}
  19. },
  20. "oneOf": [
  21. {
  22. "properties": {
  23. "weapon": {"$ref": "#/definitions/weapon"},
  24. "armor": false
  25. }
  26. },
  27. {
  28. "properties": {
  29. "weapon": false,
  30. "armor": {"$ref": "#/definitions/armor"}
  31. }
  32. },
  33. {
  34. "properties": {"weapon": false, "armor": false}
  35. }
  36. ],
  37. "required": [
  38. "name",
  39. "count",
  40. "value",
  41. "weight"
  42. ],
  43. "type": "object"
  44. },
  45. "type": "array"
  46. },
  47. "equipment": {"$ref": "#/definitions/loadout"},
  48. "favorites": {
  49. "additionalProperties": {
  50. "$ref": "#/definitions/loadout"
  51. }
  52. },
  53. "wealth": {"$ref": "#/definitions/money"}
  54. },
  55. "definitions": {
  56. "loadout": {
  57. "propertyNames": {"$ref": "#/definitions/slot"},
  58. "properties": {
  59. "RING": false,
  60. "ONE_HAND": false,
  61. "TWO_HANDS": false
  62. },
  63. "additionalProperties": {"type": "string"},
  64. "type": "object"
  65. },
  66. "slot": {
  67. "type": "string",
  68. "enum": [
  69. "HEAD",
  70. "FACE",
  71. "NECK",
  72. "TORSO",
  73. "BODY",
  74. "WAIST",
  75. "SHOULDER",
  76. "ARM",
  77. "HAND",
  78. "RING",
  79. "RING1",
  80. "RING2",
  81. "FEET",
  82. "MAIN_HAND",
  83. "OFF_HAND",
  84. "ONE_HAND",
  85. "TWO_HANDS"
  86. ]
  87. },
  88. "enchantable": {
  89. "bonus": {
  90. "type": "string",
  91. "enum": [
  92. "+1", "+2", "+3", "+4", "+5"
  93. ]
  94. },
  95. "properties": {
  96. "masterwork": {"type": "boolean"},
  97. "bonus": {"$ref": "#/definitions/enchantable/bonus"},
  98. "enchantments": {
  99. "items": {
  100. "oneOf": [
  101. {
  102. "properties": {
  103. "name": {"type": "string"},
  104. "effectiveBonus": {"$ref": "#/definitions/enchantable/bonus"}
  105. },
  106. "required": ["name", "effectiveBonus"],
  107. "type": "object"
  108. },
  109. {
  110. "properties": {
  111. "name": {"type": "string"},
  112. "adHocValue": {"$ref": "#/definitions/money"}
  113. },
  114. "required": ["name", "adHocValue"],
  115. "type": "object"
  116. }
  117. ]
  118. },
  119. "type": "array"
  120. }
  121. }
  122. },
  123. "weapon": {
  124. "allOf": [
  125. {"$ref": "#/definitions/enchantable"},
  126. {
  127. "dependencies":{
  128. "secondaryCriticalDamage": ["secondaryDamage"]
  129. },
  130. "properties": {
  131. "damage": {"type": "string"},
  132. "secondaryDamage": {"type": "string"},
  133. "criticalThreat": {"type": "integer", "maximum": 20},
  134. "criticalDamage": {"type": "integer", "minimum": 2},
  135. "secondaryCriticalDamage": {"type": "integer", "minimum": 2},
  136. "range": {
  137. "oneOf": [
  138. {"type": "string", "const":"Melee"},
  139. {"$ref": "file:common.json#/definitions/distance"}
  140. ]
  141. },
  142. "type": {
  143. "type": "string",
  144. "enum": [
  145. "Slashing",
  146. "Piercing",
  147. "Bludgeoning"
  148. ]
  149. }
  150. },
  151. "required": [
  152. "damage",
  153. "type",
  154. "range",
  155. "criticalThreat",
  156. "criticalDamage"
  157. ],
  158. "type": "object"
  159. }
  160. ]
  161. },
  162. "armor": {
  163. "allOf": [
  164. {"$ref": "#/definitions/enchantable"},
  165. {
  166. "dependencies": {
  167. "speed": {"properties": {"type": {"not": {"const": "Shield"}}}}
  168. },
  169. "properties": {
  170. "acBonus": {"type": "integer", "minimum": 0},
  171. "type": {
  172. "type": "string",
  173. "enum": ["Light", "Medium", "Heavy", "Shield"]
  174. },
  175. "maxDex": {"type": "integer", "minimum": 0},
  176. "checkPenalty": {"type": "integer", "maximum": 0},
  177. "spellFailure": {"type": "integer", "minimum": 0, "maximum": 100},
  178. "speed": {"type": "integer"}
  179. },
  180. "required": [
  181. "bonus",
  182. "type",
  183. "checkPenalty",
  184. "spellFailure"
  185. ],
  186. "type": "object"
  187. }
  188. ]
  189. },
  190. "money": {
  191. "properties": {
  192. "pp": {"type": "integer", "minimum": 0},
  193. "gp": {"type": "integer", "minimum": 0},
  194. "sp": {"type": "integer", "minimum": 0},
  195. "cp": {"type": "integer", "minimum": 0}
  196. },
  197. "type": "object"
  198. }
  199. },
  200. "type": "object",
  201. "additionalProperties": false
  202. }