hyperborea-character-sheet/schemas-yaml/character.yml

108 lines
2.4 KiB
YAML

$id: https://hyperboria.babyl.ca/character.json
title: Hyperboria character sheet
additionalProperties: false
type: object
required:
- name
- player
- statistics
- class
- level
- health
- experience
- age
- height
- appearance
- alignment
properties:
name: &string
type: string
player: *string
class: { $ref: "/classes.json" }
statistics:
type: object
allRequired: true
properties:
strength: &stat
$ref: "#/$defs/statistic"
dexterity: *stat
constitution: *stat
intelligence: *stat
wisdom: *stat
charisma: *stat
level: { type: number, minimum: 1 }
health: { $ref: "#/$defs/health" }
experience: { $ref: '#/$defs/experience' }
gender: *string
age: &number
type: number
height: *string
appearance: *string
alignment: *string
race: { $ref: /races.json }
languages:
type: array
minItems: 1
items:
$ref: /languages.json
spells:
type: array
items: { $ref: /spells.json }
maxSpells:
class: { $data: /class }
level: { $data: /level }
gear: { $ref: '#/$defs/gear' }
$defs:
gear:
type: array
items:
oneOf:
- *string
- type: object
properties:
desc:
type: string
description: description of the equipment
qty:
type: number
description: quantity of the item in the character's possession
required: [ desc ]
additionalProperties: false
examples:
- { desc: 'lamp oil', qty: 2 }
statistic:
type: number
minimum: 1
maximum: 20
health:
type: object
required: [max]
properties:
max:
type: number
sumOf: { list: { $data: 1/log } }
current: { type: number }
log:
type: array
description: history of health rolls
items: &number { type: number }
minItems: { $data: /level }
maxItems: { $data: /level }
experience:
type: object
properties:
total:
type: number
sumOf:
list: { $data: '1/log' }
map: amount
log:
type: array
items:
type: object
properties:
date: *string
amount: *number
notes: *string