Data changes to make attacks top level objects

This commit is contained in:
Stefan Zermatten
2019-09-19 16:03:46 +02:00
parent 63a20b2bef
commit 66d11d58f3
19 changed files with 368 additions and 201 deletions

View File

@@ -1,5 +1,4 @@
import SimpleSchema from 'simpl-schema';
import AdjustmentSchema from '/imports/api/properties/subSchemas/AdjustmentSchema.js';
import { ActionSchema } from '/imports/api/properties/Actions.js';
// Attacks are special instances of actions
@@ -9,16 +8,9 @@ let AttackSchema = new SimpleSchema()
// What gets added to the d20 roll
rollBonus: {
type: String,
defaultValue: 'strength.modifier + proficiencyBonus',
optional: true,
},
// What damage does it do to the targets
adjustments: {
type: Array,
defaultValue: [],
},
'adjustments.$': {
type: AdjustmentSchema,
},
// If set reference an item whose quantity is reduced by 1 every time this
// attack is rolled
ammunition: {
@@ -27,12 +19,16 @@ let AttackSchema = new SimpleSchema()
optional: true,
},
// Set better defaults for the action
type: {
actionType: {
defaultValue: 'attack',
},
tags: {
type: Array,
defaultValue: ['attack'],
},
'tags.$': {
type: String,
},
});
export { AttackSchema };