Completed Action form, effects form, reworked form event api

This commit is contained in:
Stefan Zermatten
2019-07-22 12:43:57 +02:00
parent baa1c0967c
commit dfa302a4a9
17 changed files with 512 additions and 142 deletions

View File

@@ -14,6 +14,13 @@ import updateSchemaMixin from '/imports/api/creature/mixins/updateSchemaMixin.js
let Buffs = new Mongo.Collection('buffs');
let BuffSchema = new SimpleSchema({
_id: {
type: String,
regEx: SimpleSchema.RegEx.Id,
autoValue(){
if (!this.isSet) return Random.id();
}
},
name: {
type: String,
optional: true,
@@ -23,9 +30,8 @@ let BuffSchema = new SimpleSchema({
optional: true,
},
duration: {
type: SimpleSchema.Integer,
type: String,
optional: true,
min: 0,
},
});

View File

@@ -18,6 +18,13 @@ let Effects = new Mongo.Collection('effects');
* that modify their final value or presentation in some way
*/
let EffectSchema = schema({
_id: {
type: String,
regEx: SimpleSchema.RegEx.Id,
autoValue(){
if (!this.isSet) return Random.id();
}
},
name: {
type: String,
optional: true,

View File

@@ -7,8 +7,7 @@ const AdjustmentSchema = new SimpleSchema({
type: String,
regEx: SimpleSchema.RegEx.Id,
autoValue(){
if (this.isSet) return;
return Random.id();
if (!this.isSet) return Random.id();
}
},
// The roll that determines how much to damage the attribute