Added ability to add/edit buffs

This commit is contained in:
Jacob
2017-08-09 15:01:20 +01:00
parent bce1b85600
commit 08735ea4f7
18 changed files with 308 additions and 26 deletions

View File

@@ -16,6 +16,15 @@ Schemas.CustomBuff = new SimpleSchema({
optional: true,
trim: false,
},
target: {
type: String,
allowedValues: [
"self",
"others",
"both"
],
defaultValue: "self",
},
enabled: {
type: Boolean,
autoValue: function(){
@@ -23,27 +32,14 @@ Schemas.CustomBuff = new SimpleSchema({
//enabled is ALWAYS false on these, so that its children are also not enabled, so that the buff templates have no effects.
},
},
type: {
type: String,
allowedValues: [
"inate", //this should be "innate", but changing it could be problematic
"custom",
],
},
"lifeTime.total": {
type: Number,
defaultValue: 0, //0 is infinite
min: 0,
},
color: {
type: String,
allowedValues: _.pluck(colorOptions, "key"),
defaultValue: "q",
},
//the id of the feature, buff or item that creates this buff
parent: {
type: Schemas.Parent,
optional: true,
},
});
@@ -51,7 +47,7 @@ CustomBuffs.attachSchema(Schemas.CustomBuff);
CustomBuffs.attachBehaviour("softRemovable");
makeParent(CustomBuffs, ["name", "enabled"]); //parents of effects, attacks, proficiencies. Since this represents a template, "enabled" is always false.
makeChild(CustomBuffs, ["enabled"]); //children of lots of things
makeChild(CustomBuffs); //children of lots of things
CustomBuffs.allow(CHARACTER_SUBSCHEMA_ALLOW);
CustomBuffs.deny(CHARACTER_SUBSCHEMA_DENY);