Added Models for attributes, skills and damage multipliers

This commit is contained in:
Stefan Zermatten
2018-08-24 12:12:38 +02:00
parent b21a91b0aa
commit 7c9687955d
5 changed files with 186 additions and 10 deletions

View File

@@ -0,0 +1,39 @@
DamageMultipliers = new Mongo.Collection("damageMultipliers");
/*
* DamageMultipliers are whole numbered stats of a character
*/
Schemas.DamageMultiplier = new SimpleSchema({
charId: {
type: String,
regEx: SimpleSchema.RegEx.Id,
index: 1,
},
// The nice-to-read name
name: {
type: String,
},
// The technical, lowercase, single-word name used in formulae
variableName: {
type: String,
},
value: {
type: Number,
decimal: true,
},
parent: {
type: Schemas.Parent
},
enabled: {
type: Boolean,
defaultValue: true,
},
});
DamageMultipliers.attachSchema(Schemas.DamageMultiplier);
DamageMultipliers.attachBehaviour("softRemovable");
makeChild(DamageMultipliers, ["enabled"]); //children of lots of things
DamageMultipliers.allow(CHARACTER_SUBSCHEMA_ALLOW);
DamageMultipliers.deny(CHARACTER_SUBSCHEMA_DENY);