adding level and health

main
Yanick Champoux 2022-04-26 17:43:26 -04:00
parent 81ef5f6241
commit a3c140fd24
4 changed files with 59 additions and 1 deletions

View File

@ -21,6 +21,7 @@ tasks:
- transerialize {{.SCHEMA}} {{.TRANSFORM}} {{.DEST}}
validate:
deps: [ schemas ]
silent: true
cmds:
- |
@ -28,6 +29,7 @@ tasks:
--all-errors \
--errors=json \
--verbose \
--data \
-c ajv-keywords \
-r schemas-json/classes.json \
-s schemas-json/character.json \

View File

@ -1,8 +1,12 @@
name: Verg-La
player: Yanick
level: 4
class:
generic: magician
subclass: cryomancer
health:
max: 13
log: [ 4, 3, 2, 4 ]
statistics:
strength: 11
dexterity: 13

View File

@ -1,5 +1,32 @@
{
"$defs" : {
"health" : {
"properties" : {
"current" : {
"type" : "number"
},
"log" : {
"description" : "history of health rolls",
"items" : {
"type" : "number"
},
"maxItems" : {
"$data" : "/level"
},
"minItems" : {
"$data" : "/level"
},
"type" : "array"
},
"max" : {
"type" : "number"
}
},
"required" : [
"max"
],
"type" : "object"
},
"statistic" : {
"maximum" : 20,
"minimum" : 1,
@ -12,6 +39,13 @@
"class" : {
"$ref" : "/classes.json"
},
"health" : {
"$ref" : "#/$defs/health"
},
"level" : {
"minimum" : 1,
"type" : "number"
},
"name" : {
"type" : "string"
},
@ -47,7 +81,9 @@
"name",
"player",
"statistics",
"class"
"class",
"level",
"health"
],
"title" : "Hyperboria character sheet",
"type" : "object"

View File

@ -7,6 +7,8 @@ required:
- player
- statistics
- class
- level
- health
properties:
name: &string
type: string
@ -23,9 +25,23 @@ properties:
intelligence: *stat
wisdom: *stat
charisma: *stat
level: { type: number, minimum: 1 }
health: { $ref: '#/$defs/health' }
$defs:
statistic:
type: number
minimum: 1
maximum: 20
health:
type: object
required: [ max ]
properties:
max: { type: number }
current: { type: number }
log:
type: array
description: history of health rolls
items: { type: number }
minItems: { $data: /level }
maxItems: { $data: /level }