inventory.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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": {
  48. "propertyNames": {"$ref": "#/definitions/slot"},
  49. "properties": {
  50. "RING": false,
  51. "ONE_HAND": false,
  52. "TWO_HANDS": false
  53. },
  54. "additionalProperties": {"type": "string"},
  55. "type": "object"
  56. }
  57. },
  58. "definitions": {
  59. "slot": {
  60. "type": "string",
  61. "enum": [
  62. "HEAD",
  63. "FACE",
  64. "NECK",
  65. "TORSO",
  66. "BODY",
  67. "WAIST",
  68. "SHOULDER",
  69. "ARM",
  70. "HAND",
  71. "RING",
  72. "RING1",
  73. "RING2",
  74. "FEET",
  75. "MAIN_HAND",
  76. "OFF_HAND",
  77. "ONE_HAND",
  78. "TWO_HANDS"
  79. ]
  80. },
  81. "weapon": {
  82. "dependencies":{
  83. "secondaryCriticalDamage": ["secondaryDamage"]
  84. },
  85. "properties": {
  86. "attackBonus": {"type": "integer"},
  87. "damageBonus": {"type": "integer"},
  88. "damage": {"type": "string"},
  89. "secondaryDamage": {"type": "string"},
  90. "criticalThreat": {"type": "integer", "maximum": 20},
  91. "criticalDamage": {"type": "integer", "minimum": 2},
  92. "secondaryCriticalDamage": {"type": "integer", "minimum": 2},
  93. "range": {
  94. "oneOf": [
  95. {"type": "string", "const":"Melee"},
  96. {"$ref": "file:common.json#/definitions/distance"}
  97. ]
  98. },
  99. "type": {
  100. "type": "string",
  101. "enum": [
  102. "Slashing",
  103. "Piercing",
  104. "Bludgeoning"
  105. ]
  106. }
  107. },
  108. "required": [
  109. "damage",
  110. "type",
  111. "range",
  112. "criticalThreat",
  113. "criticalDamage"
  114. ],
  115. "type": "object",
  116. "additionalProperties": false
  117. },
  118. "armor": {
  119. "dependencies": {
  120. "speed": {"properties": {"type": {"not": {"const": "Shield"}}}}
  121. },
  122. "properties": {
  123. "bonus": {"type": "integer", "minimum": 0},
  124. "type": {
  125. "type": "string",
  126. "enum": ["Light", "Medium", "Heavy", "Shield"]
  127. },
  128. "maxDex": {"type": "integer", "minimum": 0},
  129. "checkPenalty": {"type": "integer", "maximum": 0},
  130. "spellFailure": {"type": "integer", "minimum": 0, "maximum": 100},
  131. "speed": {"type": "integer"}
  132. },
  133. "required": [
  134. "bonus",
  135. "type",
  136. "checkPenalty",
  137. "spellFailure"
  138. ],
  139. "type": "object",
  140. "additionalProperties": false
  141. },
  142. "money": {
  143. "properties": {
  144. "pp": {"type": "integer", "minimum": 0},
  145. "gp": {"type": "integer", "minimum": 0},
  146. "sp": {"type": "integer", "minimum": 0},
  147. "cp": {"type": "integer", "minimum": 0}
  148. },
  149. "type": "object"
  150. }
  151. },
  152. "type": "object",
  153. "additionalProperties": false
  154. }