Prechádzať zdrojové kódy

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 8 rokov pred
rodič
commit
dc8bf70b9b
2 zmenil súbory, kde vykonal 34 pridanie a 5 odobranie
  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"