diff --git a/app/imports/api/properties/Rolls.js b/app/imports/api/properties/Rolls.js index 2c8c251c..5278fb6f 100644 --- a/app/imports/api/properties/Rolls.js +++ b/app/imports/api/properties/Rolls.js @@ -1,5 +1,5 @@ import SimpleSchema from 'simpl-schema'; -import { RollResultsSchema } from '/imports/api/properties/subSchemas/RollResultsSchema.js' +import RollResultsSchema from '/imports/api/properties/subSchemas/RollResultsSchema.js' /** * Rolls are children to actions or other rolls, they are triggered with 0 or @@ -20,8 +20,8 @@ import { RollResultsSchema } from '/imports/api/properties/subSchemas/RollResult * child rolls are applied */ let RollSchema = new SimpleSchema({ - // The number to add to a d20 roll - rollBonus: { + // The roll + roll: { type: String, optional: true, }, diff --git a/app/imports/api/properties/subSchemas/RollResultsSchema.js b/app/imports/api/properties/subSchemas/RollResultsSchema.js index 4ce64b88..1d555ddc 100644 --- a/app/imports/api/properties/subSchemas/RollResultsSchema.js +++ b/app/imports/api/properties/subSchemas/RollResultsSchema.js @@ -2,6 +2,13 @@ import SimpleSchema from 'simpl-schema'; import ResultsSchema from '/imports/api/properties/subSchemas/ResultsSchema.js'; let RollResultsSchema = new SimpleSchema ({ + _id: { + type: String, + regEx: SimpleSchema.RegEx.Id, + autoValue(){ + if (!this.isSet) return Random.id(); + } + }, // Expression of whether or not to apply the roll // Evaluates to an expression which gets compared to the roll // or a number which the roll must equal @@ -15,4 +22,4 @@ let RollResultsSchema = new SimpleSchema ({ }, }); -export { RollResultsSchema }; +export default RollResultsSchema ; diff --git a/app/imports/ui/properties/forms/RollForm.vue b/app/imports/ui/properties/forms/RollForm.vue index d4e50a81..5c5e795a 100644 --- a/app/imports/ui/properties/forms/RollForm.vue +++ b/app/imports/ui/properties/forms/RollForm.vue @@ -2,23 +2,81 @@