Files
DiceCloud/app/imports/api/creature/properties/Actions.js

47 lines
880 B
JavaScript

import SimpleSchema from 'simpl-schema';
import schema from '/imports/api/schema.js';
import {makeChild} from "/imports/api/parenting.js";
let Actions = new Mongo.Collection("actions");
/*
* Actions are given to a character by items and features
*/
let actionSchema = schema({
charId: {
type: String,
regEx: SimpleSchema.RegEx.Id,
index: 1,
},
name: {
type: String,
optional: true,
trim: false,
},
description: {
type: String,
optional: true,
trim: false,
},
type: {
type: String,
allowedValues: ["action, bonus, reaction, free"],
defaultValue: "action",
},
//the immediate impact of doing this action (eg. -1 rages)
adjustments: {
type: Array,
defaultValue: [],
},
"adjustments.$": {
type: Object,
},
});
Actions.attachSchema(actionSchema);
// Actions.attachBehaviour("softRemovable");
makeChild(Actions);
export default Actions