Spells now reference their spell lists directly

This commit is contained in:
Stefan Zermatten
2019-07-25 15:44:45 +02:00
parent 5662ce3666
commit 02cb690325
2 changed files with 15 additions and 15 deletions

View File

@@ -10,6 +10,7 @@ import { setDocAncestryMixin, ensureAncestryContainsCharIdMixin } from '/imports
import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin.js';
import propagateInheritanceUpdateMixin from '/imports/api/creature/mixins/propagateInheritanceUpdateMixin.js';
import updateSchemaMixin from '/imports/api/creature/mixins/updateSchemaMixin.js';
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js';
let SpellLists = new Mongo.Collection("spellLists");
@@ -18,20 +19,17 @@ let SpellListSchema = schema({
type: String,
optional: true,
},
// The technical, lowercase, single-word name used in formulae
variableName: {
type: String,
regEx: VARIABLE_NAME_REGEX,
min: 3,
defaultValue: 'newAttribute',
},
description: {
type: String,
optional: true,
},
// Calculation of save DC used for all spells in this list
saveDC: {
type: String,
optional: true,
},
// Calculation of attack bonus used for all spells in this list
attackBonus: {
type: String,
optional: true,
},
// Calculation of how many spells in this list can be prepared
maxPrepared: {
type: String,

View File

@@ -35,11 +35,13 @@ let SpellSchema = schema({
type: Boolean,
defaultValue: false,
},
// Spells are enabled when they are prepared, so that unprepared spells don't
// show their actions
enabled: {
type: Boolean,
defaultValue: true,
// Spell lists that this spell appears on
spellLists: {
type: Array,
defaultValue: [],
},
'spellLists.$': {
type: String,
},
description: {
type: String,