diff --git a/app/imports/api/creature/properties/Rolls.js b/app/imports/api/creature/properties/Rolls.js index b46d2fcd..6934ac70 100644 --- a/app/imports/api/creature/properties/Rolls.js +++ b/app/imports/api/creature/properties/Rolls.js @@ -51,10 +51,10 @@ let RollChildrenSchema = new SimpleSchema({ * child rolls are applied */ let RollSchema = new SimpleSchema({ - // Apply this only if the parent roll missed - // i.e. roll failed or target suceeded on their save - onMiss: { - type: Boolean, + // The roll made against the target value. A calculation that resolves to a + // number or a roll. If it is a number, it will be added to a d20 roll + roll: { + type: String, optional: true, }, // The target number to meet or exceed @@ -62,13 +62,20 @@ let RollSchema = new SimpleSchema({ type: String, optional: true, }, - // Swap who wins ties - invertTies: { + // Is this roll a saving throw + rollType: { + type: String, + defaultValue: 'roll', + allowedValues: ['roll', 'savingThrow'], + }, + // Apply this only if the parent roll missed + // i.e. roll failed or target suceeded on their save + onMiss: { type: Boolean, optional: true, }, - // Is this roll a saving throw - isSavingThrow: { + // Swap who wins ties + invertTies: { type: Boolean, optional: true, }, @@ -81,15 +88,15 @@ let RollSchema = new SimpleSchema({ 'tags.$': { type: String, }, - // The roll made against the target value. A calculation that resolves to a - // number or a roll. If it is a number, it will be added to a d20 roll - roll: { - type: String, - optional: true, - }, // The buffs and adjustments to apply based on the outcome of the roll - hit: RollChildrenSchema, - miss: RollChildrenSchema, + hit: { + type: RollChildrenSchema, + defaultValue: {}, + }, + miss: { + type: RollChildrenSchema, + defaultValue: {}, + }, }); Rolls.attachSchema(RollSchema); diff --git a/app/imports/ui/forms/AttributeForm.vue b/app/imports/ui/forms/AttributeForm.vue index 28f6e778..a4d72ba7 100644 --- a/app/imports/ui/forms/AttributeForm.vue +++ b/app/imports/ui/forms/AttributeForm.vue @@ -47,7 +47,7 @@ class="no-flex" :value="model.decimal" :error-messages="errors.decimal" - @change="e => $emit('change', $emit('change', {path: ['decimal'], value: !!e, ack}))" + @change="e => $emit('change', {path: ['decimal'], value: !!e})" />