{
    "id": "http://www.ubisoft.com/ugc/acd/v1/dialogue/dialogue#",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "JSON Schema for Assassin's Creed Dynasty UGC",
    "type": "object",
    "properties": {
        "Schema": {
            "type": "string",
            "enum": [
                "http://www.ubisoft.com/ugc/acd/v1/dialogue/dialogue#"
            ]
        },
        "Variables": {
            "type": "array",
            "items": {
                "$ref": "http://www.ubisoft.com/ugc/acd/v1/variable#"
            }
        },
        "Participants": {
            "type": "array",
            "minItem": 1,
            "items": {
                "$ref": "#/definitions/Participant"
            }
        },
        "Blocks": {
            "type": "array",
            "minItem": 1,
            "items": {
                "$ref": "#/definitions/Block"
            }
        },
        "PeakAnimation": {
            "type": "boolean"
        },
        "Stage": {
            "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/ObjectId"
        },
        "PostEffect": {
            "$ref": "#/definitions/PostEffet"
        }
    },
    "required": [
        "Blocks"
    ],
    "additionalProperties": false,
    "definitions": {
        "Participant": {
            "type": "object",
            "properties": {
                "Actor": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "IdleState": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "FacialState": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "CastAsStaticEntity": {
                    "type": "boolean"
                }
            },
            "required": [
                "Actor"
            ],
            "additionalProperties": false
        },
        "Block": {
            "oneOf": [
                {
                    "$ref": "#/definitions/Sequence"
                },
                {
                    "$ref": "#/definitions/RandomSwitch"
                }
            ]
        },
        "Sequence": {
            "type": "object",
            "properties": {
                "Name": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "Lines": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/Line"
                    }
                },
                "Choices": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/Choice"
                    }
                },
                "Actions": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "http://www.ubisoft.com/ugc/acd/v1/actions#/Action"
                    }
                },
                "Conditions": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/SequenceCondition"
                    }
                },
                "IdleStates": {
                    "type": "object",
                    "patternProperties": {
                        "^[A-Za-z0-9_-]+": {
                            "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                        }
                    },
                    "additionalProperties": false
                },
                "GoTo": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "MustSeeChoices": {
                    "$ref": "#/definitions/MustSeeChoices"
                },
                "LookAt": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                }
            },
            "additionalProperties": false,
            "required": [
                "Name"
            ],
            "dependencies": {
                "MustSeeChoices": [
                    "Choices"
                ]
            },
            "allOf": [
                {
                    "anyOf": [
                        {
                            "required": [
                                "Lines"
                            ]
                        },
                        {
                            "required": [
                                "Choices"
                            ]
                        },
                        {
                            "required": [
                                "Actions"
                            ]
                        },
                        {
                            "required": [
                                "Conditions",
                                "GoTo"
                            ]
                        }
                    ]
                },
                {
                    "not": {
                        "required": [
                            "Choices",
                            "GoTo"
                        ]
                    }
                },
                {
                    "not": {
                        "required": [
                            "Choices",
                            "Conditions"
                        ]
                    }
                }
            ]
        },
        "Line": {
            "type": "object",
            "properties": {
                "Actor": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "Text": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/Text"
                },
                "FacialState": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "Gesture": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "LookAt": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                }
            },
            "required": [
                "Actor",
                "Text"
            ],
            "additionalProperties": false
        },
        "Choice": {
            "type": "object",
            "properties": {
                "Text": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/Text"
                },
                "GoTo": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "IsOnce": {
                    "type": "boolean"
                },
                "IsImportant": {
                    "type": "boolean"
                },
                "IsAfter": {
                    "type": "boolean"
                },
                "Condition": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/conditions#/Condition"
                },
                "Feedback": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                }
            },
            "required": [
                "Text",
                "GoTo"
            ],
            "additionalProperties": false
        },
        "MustSeeChoices": {
            "type": "object",
            "properties": {
                "Count": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/UInt32NotZero"
                },
                "GoTo": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                }
            },
            "required": [
                "GoTo"
            ],
            "additionalProperties": false
        },
        "SequenceCondition": {
            "type": "object",
            "properties": {
                "Condition": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/conditions#/Condition"
                },
                "GoTo": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                }
            },
            "required": [
                "Condition",
                "GoTo"
            ],
            "additionalProperties": false
        },
        "RandomSwitch": {
            "type": "object",
            "properties": {
                "Name": {
                    "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                },
                "RandomSwitch": {
                    "type": "array",
                    "minItems": 2,
                    "items": {
                        "type": "object",
                        "properties": {
                            "Weight": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 255
                            },
                            "GoTo": {
                                "$ref": "http://www.ubisoft.com/ugc/acd/v1/types#/RequiredString"
                            },
                            "Condition": {
                                "$ref": "#/definitions/Condition"
                            }
                        },
                        "required": [
                            "Weight",
                            "GoTo"
                        ],
                        "additionalProperties": false
                    }
                }
            },
            "required": [
                "Name",
                "RandomSwitch"
            ],
            "additionalProperties": false
        },
        "PostEffet": {
            "type": "object",
            "properties": {
                "DoFAperture": {
                    "type": "number"
                },
                "DoFFocalLength": {
                    "type": "number"
                },
                "DoFFocalDistance": {
                    "type": "number"
                },
                "Brightness": {
                    "type": "number"
                },
                "Temperature": {
                    "type": "number"
                },
                "Tint": {
                    "type": "number"
                },
                "Saturation": {
                    "type": "number"
                },
                "FilmGrainIntensity": {
                    "type": "number"
                },
                "VignetteIntensity": {
                    "type": "number"
                },
                "BloomIntensity": {
                    "type": "number"
                },
                "BloomSpread": {
                    "type": "number"
                },
                "DoFEnabled": {
                    "type": "boolean"
                }
            },
            "additionalProperties": false
        }
    }
}