{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "custom_char_schema.json",
  "type": "object",
  "properties": {
    "animation": {
      "type": "object",
      "patternProperties": {
        ".+": {
          "type": "object",
          "properties": {
            "name": { "type": "string"},
            "loop": { "type": "boolean"},
            "indices": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "fps": {"type": "number"},
            "flippedname": {"type": "string"}
          },
          "required": ["name"],
          "additionalProperties": true
        }
      }},
      "deadAnimation": {
        "type": "object",
        "patternProperties": {
          ".+": {
            "type": "object",
            "properties": {
              "name": { "type": "string"},
              "loop": { "type": "boolean"},
              "indices": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "fps": {"type": "number"},
              "flippedname": {"type": "string"}
            },
            "required": ["name", "loop"]
          }
      }},
      "offset": {
        "type": "object",
        "patternProperties": {
          ".+": {
            "type": "array",
            "items": [
              {
                "type": "number"
              },
              {
                "type": "number"
              }
            ],
            "$comment": "make sure only x and y are given",
            "additionalItems": false,
            "minLength": 2
          }
        }
      },
      "deadOffset": {
        "type": "object",
        "patternProperties": {
          ".+": {
            "type": "array",
            "items": [
              {
                "type": "number"
              },
              {
                "type": "number"
              }
            ],
            "$comment": "make sure only x and y are given",
            "additionalItems": false,
            "minLength": 2
          }
        }
      },
      "flipx": {"type":"boolean"},
      "camOffset": {
        "type": "array",
        "items": [
          {
            "type": "number"
          },
          {
            "type": "number"
          }
        ],
        "$comment": "make sure only x and y are given",
        "additionalItems": false,
        "minLength": 2
      },
      "enemyOffset": {
        "type": "array",
        "items": [
          {
            "type": "number"
          },
          {
            "type": "number"
          }
        ],
        "$comment": "make sure only x and y are given",
        "additionalItems": false,
        "minLength": 2
      },
      "followCam": {
        "type": "array",
        "items": [
          {
            "type": "number"
          },
          {
            "type": "number"
          }
        ],
        "$comment": "make sure only x and y are given",
        "additionalItems": false,
        "minLength": 2
      },
      "midpoint": {
        "type": "array",
        "items": [
          {
            "type": "number"
          },
          {
            "type": "number"
          }
        ],
        "$comment": "make sure only x and y are given",
        "additionalItems": false,
        "minLength": 2
      },
      "like": {"type": "string"},
      "playAnim": {"type": "string"},
      "isPixel": {"type": "boolean"},
      "usesSpritesheetPacker": {"type": "boolean"},
      "size": {
        "type": "array",
        "items": [
          {
            "type": "number"
          },
          {
            "type": "number"
          }
        ],
        "$comment": "make sure only x and y are given",
        "additionalItems": false,
        "minLength": 2
      }
  },
  "required": ["animation", "offset", "like", "playAnim"],
  "$comment": "dead things must have an offset AND an animation",
  "dependencies": {
    "deadOffset": ["deadAnimation"],
    "deadAnimation": ["deadOffset"]
  },
  "additionalProperties": false
}
