Browse Source

Upgrading to v6 schema for the propertyNames feature.
Adding huge chunk of schema data known as character.

Samuel Jaffe 8 years ago
parent
commit
7fb9b94c09
4 changed files with 222 additions and 3 deletions
  1. 1 1
      resources/Potato.json
  2. 219 0
      schema/character.json
  3. 1 1
      schema/spell.json
  4. 1 1
      schema/spellbook.json

+ 1 - 1
resources/Potato.json

@@ -162,4 +162,4 @@
       "OFF_HAND":"MWK Quarterstaff"
     }
   }
-}
+}

+ 219 - 0
schema/character.json

@@ -0,0 +1,219 @@
+{
+  "$schema": "http://json-schema.org/draft-06/schema#",
+  "properties": {
+    "name": {"type": "string"},
+    "player": {"type": "string"},
+    "classes": {
+      "items": {
+        "properties": {
+          "level": {"type": "integer", "minimum": 1},
+          "name": {"type": "string"},
+          "spellBook": {"$ref": "file:spellbook.json#"}
+        },
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "race": {"type": "string"},
+    "alignment": {
+      "type": "string",
+      "enum": [
+        "LG", "NG", "CG", "LN", "TN", "CN", "LE", "NE", "CE"
+      ]
+    },
+    "deity": {"type": "string"},
+    "size": {
+      "type": "string",
+      "enum": [
+        "F", "D", "T", "S", "M", "L", "H", "G", "C"
+      ]
+    },
+    "age": {"type": "string"},
+    "gender": {"type": "string", "enum": ["M", "F", "N"]},
+    "height": {"type": "string"},
+    "weight": {"type": "number"},
+    "eyes": {"type": "string"},
+    "hair": {"type": "string"},
+    "skin": {"type": "string"},
+    "experience": {"type": "integer"},
+    "health": {
+      "properties": {
+        "total": {"type": "integer", "minimum": 1},
+        "rolled": {"type": "integer", "minimum": 1},
+        "current": {"type": "integer", "minimum": -10},
+        "temp": {"type": "integer", "minimum": 0},
+        "nonlethal": {"type": "integer", "minimum": 0}
+      },
+      "type":"object"
+    },
+    "abilities": {
+    },
+    "skills": {
+      "items": {
+        "properties": {
+          "name": {"type": "string"},
+          "ranks": {"type": "integer"},
+          "pointsSpent": {"type": "integer"}
+        },
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "inventory": {
+      "properties": {
+        "items": {
+          "items": {
+            "properties": {
+              "name": {"type": "string"},
+              "count": {"type": "integer", "minimum": 1},
+              "countEquipped": {"type": "integer", "minimum": 0},
+              "value": {"$ref": "#/definitions/money"},
+              "page": {"type": "string"},
+              "slot": {
+                "type": "string",
+                "enum": [
+                  "HEAD",
+                  "FACE",
+                  "NECK",
+                  "TORSO",
+                  "BODY",
+                  "WAIST",
+                  "SHOULDER",
+                  "ARM",
+                  "HAND",
+                  "RING",
+                  "FEET",
+                  "MAIN_HAND",
+                  "OFF_HAND",
+                  "ONE_HAND",
+                  "TWO_HANDS"
+                ]
+              },
+              "weight": {"type": "number"},
+              "weapon": {
+                "dependencies":{
+                  
+                },
+                "properties": {
+                  "attackBonus": {"type": "integer"},
+                  "damageBonus": {"type": "integer"},
+                  "damage": {"type": "string"},
+                  "secondaryDamage": {"type": "string"},
+                  "criticalThreat": {"type": "integer", "maximum": 20},
+                  "criticalDamage": {"type": "integer", "minimum": 2},
+                  "secondaryCriticalDamage": {"type": "integer", "minimum": 2},
+                  "range": {
+                    "type": "string"
+                  },
+                  "type": {
+                    "type": "string", 
+                    "enum": [
+                      "Slashing",
+                      "Piercing",
+                      "Bludgeoning"
+                    ]
+                  }
+                },
+                "required": [
+                  "damage",
+                  "type",
+                  "range",
+                  "criticalThreat",
+                  "criticalDamage"
+                ],
+                "type": "object"
+              },
+              "armor": {
+                "properties": {
+                  "bonus": {"type": "integer", "minimum": 0},
+                  "type": {
+                    "type": "string", 
+                    "enum": ["Light", "Medium", "Heavy"]
+                  },
+                  "maxDex": {"type": "integer", "minimum": 0},
+                  "checkPenalty": {"type": "integer", "maximum": 0},
+                  "spellFailure": {"type": "integer", "minimum": 0, "maximum": 100},
+                  "speed": {"type": "integer"}
+                },
+                "type": "object"
+              }
+            },
+            "oneOf": [
+              {
+                "properties": {
+                  "slot": {"enum": ["BODY", "OFF_HAND"]}
+                },
+                "required": [
+                  "armor"
+                ]
+              },
+              {
+                "properties": {
+                  "slot": {
+                    "enum": [
+                      "MAIN_HAND", 
+                      "OFF_HAND", 
+                      "ONE_HAND",
+                      "TWO_HANDS"
+                    ]
+                  }
+                },
+                "required": [
+                  "weapon"
+                ]
+              },
+              {
+                "not": {
+                  "properties": {
+                    "weapon": {},
+                    "armor": {}
+                  }
+                }
+              }
+            ],
+            "required": [
+              "name",
+              "count",
+              "value",
+              "weight"
+            ],
+            "type": "object"
+          },
+          "type": "array"
+        },
+        "equipment": {
+          "properties": {
+            "HEAD": {"type": "string"},
+            "FACE": {"type": "string"},
+            "NECK": {"type": "string"},
+            "TORSO": {"type": "string"},
+            "BODY": {"type": "string"},
+            "WAIST": {"type": "string"},
+            "SHOULDER": {"type": "string"},
+            "ARM": {"type": "string"},
+            "HAND": {"type": "string"},
+            "RING1": {"type": "string"},
+            "RING2": {"type": "string"},
+            "FEET": {"type": "string"},
+            "MAIN_HAND": {"type": "string"},
+            "OFF_HAND": {"type": "string"}
+          },
+          "type": "object"
+        }
+      },
+      "type": "object"
+    }
+  },
+  "definitions": {
+    "money": {
+      "properties": {
+        "pp": {"type": "integer", "minimum": 0},
+        "gp": {"type": "integer", "minimum": 0},
+        "sp": {"type": "integer", "minimum": 0},
+        "cp": {"type": "integer", "minimum": 0}
+      },
+      "type": "object"
+    }
+  },
+  "type": "object"
+}

+ 1 - 1
schema/spell.json

@@ -1,5 +1,5 @@
 {
-  "$schema": "http://json-schema.org/draft-04/schema#",
+  "$schema": "http://json-schema.org/draft-06/schema#",
   "properties": {
     "allowsSpellResistance": {
       "type": "boolean"

+ 1 - 1
schema/spellbook.json

@@ -1,5 +1,5 @@
 {
-  "$schema": "http://json-schema.org/draft-04/schema#",
+  "$schema": "http://json-schema.org/draft-06/schema#",
   "definitions": {
     "names": {
       "items": {"type": "string"},