diff --git a/app/imports/api/creature/properties/Actions.js b/app/imports/api/creature/properties/Actions.js index d62b59c9..f39c4885 100644 --- a/app/imports/api/creature/properties/Actions.js +++ b/app/imports/api/creature/properties/Actions.js @@ -26,10 +26,6 @@ let ActionSchema = schema({ type: String, optional: true, }, - enabled: { - type: Boolean, - defaultValue: true, - }, description: { type: String, optional: true, @@ -44,6 +40,7 @@ let ActionSchema = schema({ // Who is the action directed at target: { type: String, + defaultValue: 'singleTarget', allowedValues: [ 'self', 'singleTarget', diff --git a/app/imports/api/creature/properties/Buffs.js b/app/imports/api/creature/properties/Buffs.js index bee26fae..4c9c9cbf 100644 --- a/app/imports/api/creature/properties/Buffs.js +++ b/app/imports/api/creature/properties/Buffs.js @@ -43,14 +43,9 @@ let StoredBuffSchema = new SimpleSchema({ target: { type: String, allowedValues: [ - // the character who took the buff - 'self', - // the singular `target` of the buff - 'target', - // rolled once for `each` target - 'each', - // rolled once and applied to `every` target - 'every' + 'self', // the character who took the buff + 'each', // rolled once for `each` target + 'every', // rolled once and applied to `every` target ], }, }).extend(BuffSchema); diff --git a/app/imports/api/creature/subSchemas/AdjustmentSchema.js b/app/imports/api/creature/subSchemas/AdjustmentSchema.js index 459cd6a5..8d56c8f0 100644 --- a/app/imports/api/creature/subSchemas/AdjustmentSchema.js +++ b/app/imports/api/creature/subSchemas/AdjustmentSchema.js @@ -1,24 +1,30 @@ import SimpleSchema from 'simpl-schema'; +import { Random } from 'meteor/random'; import DAMAGE_TYPES from '/imports/constants/DAMAGE_TYPES.js'; const AdjustmentSchema = new SimpleSchema({ - // The calculation that determines the adjustment - roll: { + _id: { + type: String, + regEx: SimpleSchema.RegEx.Id, + autoValue(){ + if (this.isSet) return; + return Random.id(); + } + }, + // The roll that determines how much to damage the attribute + damage: { type: String, optional: true, + defaultValue: '1', }, // Who this adjustment applies to target: { type: String, + defaultValue: 'every', allowedValues: [ - // the character who took the action - 'self', - // the singular `target` of the action - 'target', - // rolled once for `each` target - 'each', - // rolled once and applied to `every` target - 'every' + 'self', // the character who took the action + 'each', // rolled once for `each` target + 'every', // rolled once and applied to `every` target ], }, // The stat this rolls applies to, if damage type is set, this is ignored diff --git a/app/imports/ui/components/forms/AdvancedSection.vue b/app/imports/ui/components/forms/AdvancedSection.vue deleted file mode 100644 index a637a705..00000000 --- a/app/imports/ui/components/forms/AdvancedSection.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - - - diff --git a/app/imports/ui/components/forms/FormSection.vue b/app/imports/ui/components/forms/FormSection.vue new file mode 100644 index 00000000..d6504496 --- /dev/null +++ b/app/imports/ui/components/forms/FormSection.vue @@ -0,0 +1,34 @@ + + + diff --git a/app/imports/ui/components/forms/FormSections.vue b/app/imports/ui/components/forms/FormSections.vue new file mode 100644 index 00000000..0d003431 --- /dev/null +++ b/app/imports/ui/components/forms/FormSections.vue @@ -0,0 +1,9 @@ + + + diff --git a/app/imports/ui/components/forms/schemaFormMixin.js b/app/imports/ui/components/forms/schemaFormMixin.js index dfc84447..c42debb1 100644 --- a/app/imports/ui/components/forms/schemaFormMixin.js +++ b/app/imports/ui/components/forms/schemaFormMixin.js @@ -32,6 +32,22 @@ const schemaFormMixin = { } if (ack) ack(); }, + push(modifier, ack){ + for (let key in modifier){ + this.model[key].push(modifier[key]); + } + if (ack) ack(); + }, + changeAtIndex(field, index, modifier, ack){ + for (let key in modifier){ + this.$set(this.model[field][index], key, modifier[key]) + } + if (ack) ack(); + }, + removeAtIndex(field, index, ack){ + this.model[field].splice(index, 1); + if (ack) ack(); + }, }, }; diff --git a/app/imports/ui/creature/properties/actions/ActionForm.vue b/app/imports/ui/creature/properties/actions/ActionForm.vue new file mode 100644 index 00000000..55836bf5 --- /dev/null +++ b/app/imports/ui/creature/properties/actions/ActionForm.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/app/imports/ui/creature/properties/adjustments/AdjustmentForm.vue b/app/imports/ui/creature/properties/adjustments/AdjustmentForm.vue new file mode 100644 index 00000000..8c3bbabd --- /dev/null +++ b/app/imports/ui/creature/properties/adjustments/AdjustmentForm.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/app/imports/ui/creature/properties/adjustments/AdjustmentListForm.vue b/app/imports/ui/creature/properties/adjustments/AdjustmentListForm.vue new file mode 100644 index 00000000..9768e6e5 --- /dev/null +++ b/app/imports/ui/creature/properties/adjustments/AdjustmentListForm.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/app/imports/ui/creature/properties/attributes/AttributeForm.vue b/app/imports/ui/creature/properties/attributes/AttributeForm.vue index 4934e875..73760d8e 100644 --- a/app/imports/ui/creature/properties/attributes/AttributeForm.vue +++ b/app/imports/ui/creature/properties/attributes/AttributeForm.vue @@ -40,7 +40,7 @@ :hint="attributeTypeHints[model.type]" :debounce-time="debounceTime" /> - +
-
+