Explorar el Código

Fixing a few issues with the spell book schema.
Adding the Reclaimed type of casting used by Sprit Shamans, which combines the best aspects of Inspired and Spontaneous casting (whereas Researched takes the worst, and then adds a little bonus).

Samuel Jaffe hace 8 años
padre
commit
dc8bf70b9b
Se han modificado 2 ficheros con 34 adiciones y 5 borrados
  1. 0 0
      schema/spell.json
  2. 34 5
      schema/spellbook_schema.json

schema/spell_schema.json → schema/spell.json


+ 34 - 5
schema/spellbook_schema.json

@@ -10,6 +10,16 @@
     "@class": {"type": "string"},
     "classRef": {"type": "string"},
     "spellInfo": {
+      "dependencies":{
+        "2":["1"],
+        "3":["2"],
+        "4":["3"],
+        "5":["4"],
+        "6":["5"],
+        "7":["6"],
+        "8":["7"],
+        "9":["8"]
+      },
       "patternProperties": {
         "^[0-9]$": {
           "properties": {
@@ -43,7 +53,8 @@
             "additionalProperties":false
           }
         }
-      }
+      },
+      "required": ["classRef"]
     },
     {
       "properties": {
@@ -68,15 +79,13 @@
       "properties": {
         "@class": {
           "enum": [
-            "org.leumasjaffe.charsheet.model.magic.impl.Researched",
-            "org.leumasjaffe.charsheet.model.magic.impl.Unearthed"
+            "org.leumasjaffe.charsheet.model.magic.impl.Researched"
           ]
         },
         "spellInfo": {
           "^[0-9]$": {
             "required": [
               "spellsPerDay",
-              "spellsPerDayRemaining",
               "spellsKnown",
               "spellsPrepared",
               "spellsPreparedPreviously"
@@ -85,11 +94,31 @@
           }
         }
       }
+    },
+    {
+      "properties": {
+        "@class": {
+          "enum": [
+            "org.leumasjaffe.charsheet.model.magic.impl.Retrieved"
+          ]
+        },
+        "spellInfo": {
+          "^[0-9]$": {
+            "required": [
+              "spellsPerDay",
+              "spellsPerDayRemaining",
+              "spellsPrepared",
+              "spellsPreparedPreviously"
+            ],
+            "additionalProperties":false
+          }
+        }
+      },
+      "required": ["classRef"]
     }
   ],
   "required": [
     "@class",
-    "classRef",
     "spellInfo"
   ],
   "type": "object"