Made spells into a special kind of action

This commit is contained in:
Thaum Rystra
2020-04-16 15:21:31 +02:00
parent e06196a54c
commit 1717ee4bc7
7 changed files with 389 additions and 251 deletions

View File

@@ -1,4 +1,4 @@
import { AttackSchema } from '/imports/api/properties/Attacks.js';
import { ActionSchema } from '/imports/api/properties/Actions.js';
import SimpleSchema from 'simpl-schema';
const magicSchools = [
@@ -13,7 +13,7 @@ const magicSchools = [
];
let SpellSchema = new SimpleSchema({})
.extend(AttackSchema)
.extend(ActionSchema)
.extend({
name: {
type: String,
@@ -29,6 +29,10 @@ let SpellSchema = new SimpleSchema({})
castWithoutSpellSlots: {
type: Boolean,
optional: true,
},
hasAttackRoll: {
type: Boolean,
optional: true,
},
// Spell lists that this spell appears on
spellLists: {
@@ -87,6 +91,11 @@ let SpellSchema = new SimpleSchema({})
defaultValue: 'abjuration',
allowedValues: magicSchools,
},
// Set better defaults for the action
actionType: {
type: String,
defaultValue: 'spell',
},
});
export { SpellSchema };