Spells now reference their spell lists directly
This commit is contained in:
@@ -10,6 +10,7 @@ import { setDocAncestryMixin, ensureAncestryContainsCharIdMixin } from '/imports
|
|||||||
import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin.js';
|
import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin.js';
|
||||||
import propagateInheritanceUpdateMixin from '/imports/api/creature/mixins/propagateInheritanceUpdateMixin.js';
|
import propagateInheritanceUpdateMixin from '/imports/api/creature/mixins/propagateInheritanceUpdateMixin.js';
|
||||||
import updateSchemaMixin from '/imports/api/creature/mixins/updateSchemaMixin.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");
|
let SpellLists = new Mongo.Collection("spellLists");
|
||||||
|
|
||||||
@@ -18,20 +19,17 @@ let SpellListSchema = schema({
|
|||||||
type: String,
|
type: String,
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
|
// The technical, lowercase, single-word name used in formulae
|
||||||
|
variableName: {
|
||||||
|
type: String,
|
||||||
|
regEx: VARIABLE_NAME_REGEX,
|
||||||
|
min: 3,
|
||||||
|
defaultValue: 'newAttribute',
|
||||||
|
},
|
||||||
description: {
|
description: {
|
||||||
type: String,
|
type: String,
|
||||||
optional: true,
|
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
|
// Calculation of how many spells in this list can be prepared
|
||||||
maxPrepared: {
|
maxPrepared: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|||||||
@@ -35,11 +35,13 @@ let SpellSchema = schema({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
},
|
},
|
||||||
// Spells are enabled when they are prepared, so that unprepared spells don't
|
// Spell lists that this spell appears on
|
||||||
// show their actions
|
spellLists: {
|
||||||
enabled: {
|
type: Array,
|
||||||
type: Boolean,
|
defaultValue: [],
|
||||||
defaultValue: true,
|
},
|
||||||
|
'spellLists.$': {
|
||||||
|
type: String,
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user