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

View File

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

View File

@ -1,5 +1,32 @@
{ {
"$defs" : { "$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" : { "statistic" : {
"maximum" : 20, "maximum" : 20,
"minimum" : 1, "minimum" : 1,
@ -12,6 +39,13 @@
"class" : { "class" : {
"$ref" : "/classes.json" "$ref" : "/classes.json"
}, },
"health" : {
"$ref" : "#/$defs/health"
},
"level" : {
"minimum" : 1,
"type" : "number"
},
"name" : { "name" : {
"type" : "string" "type" : "string"
}, },
@ -47,7 +81,9 @@
"name", "name",
"player", "player",
"statistics", "statistics",
"class" "class",
"level",
"health"
], ],
"title" : "Hyperboria character sheet", "title" : "Hyperboria character sheet",
"type" : "object" "type" : "object"

View File

@ -7,6 +7,8 @@ required:
- player - player
- statistics - statistics
- class - class
- level
- health
properties: properties:
name: &string name: &string
type: string type: string
@ -23,9 +25,23 @@ properties:
intelligence: *stat intelligence: *stat
wisdom: *stat wisdom: *stat
charisma: *stat charisma: *stat
level: { type: number, minimum: 1 }
health: { $ref: '#/$defs/health' }
$defs: $defs:
statistic: statistic:
type: number type: number
minimum: 1 minimum: 1
maximum: 20 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 }