diff --git a/rpg-docs/Model/Character/SubSchemas/Action.js b/rpg-docs/Model/Character/Actions.js similarity index 59% rename from rpg-docs/Model/Character/SubSchemas/Action.js rename to rpg-docs/Model/Character/Actions.js index a3796b12..744f01fe 100644 --- a/rpg-docs/Model/Character/SubSchemas/Action.js +++ b/rpg-docs/Model/Character/Actions.js @@ -1,13 +1,12 @@ +Actions = new Meteor.Collection("actions"); + /* * Actions are given to a character by items and features */ Schemas.Action = new SimpleSchema({ - _id: { - type: String, - regEx: SimpleSchema.RegEx.Id, - autoValue: function(){ - if(!this.isSet) return Random.id(); - } + charId: { + type: String, + regEx: SimpleSchema.RegEx.Id }, name: { type: String @@ -20,10 +19,10 @@ Schemas.Action = new SimpleSchema({ allowedValues: ["action, bonus, reaction, free"], defaultValue: "action" }, - selfBuffs: { - type: [Schemas.Buff], defaultValue: [] - }, - selfAdjustments: { + //the immediate impact of doing this action (eg. -1 rages) + adjustments: { type: [Schemas.Adjustment], defaultValue: [] } -}); \ No newline at end of file +}); + +Actions.attachSchema(Schemas.Action); diff --git a/rpg-docs/Model/Character/SubSchemas/Attack.js b/rpg-docs/Model/Character/Attacks.js similarity index 75% rename from rpg-docs/Model/Character/SubSchemas/Attack.js rename to rpg-docs/Model/Character/Attacks.js index 0c04b263..8d9b223e 100644 --- a/rpg-docs/Model/Character/SubSchemas/Attack.js +++ b/rpg-docs/Model/Character/Attacks.js @@ -1,13 +1,12 @@ +Attacks = new Meteor.Collection("attacks"); + /* * Attacks are given to a character by items and features */ Schemas.Attack = new SimpleSchema({ - _id: { - type: String, - regEx: SimpleSchema.RegEx.Id, - autoValue: function(){ - if(!this.isSet) return Random.id(); - } + charId: { + type: String, + regEx: SimpleSchema.RegEx.Id }, name: { type: String @@ -28,4 +27,6 @@ Schemas.Attack = new SimpleSchema({ allowedValues: ["acid", "bludgeoning", "cold", "fire", "force", "lightning", "necrotic", "piercing", "poison", "psychic", "radiant", "slashing", "thunder"] } -}); \ No newline at end of file +}); + +Attacks.attachSchema(Schemas.Attack); diff --git a/rpg-docs/Model/Character/SubSchemas/Buff.js b/rpg-docs/Model/Character/Buffs.js similarity index 71% rename from rpg-docs/Model/Character/SubSchemas/Buff.js rename to rpg-docs/Model/Character/Buffs.js index 3d0e66b4..19042e3e 100644 --- a/rpg-docs/Model/Character/SubSchemas/Buff.js +++ b/rpg-docs/Model/Character/Buffs.js @@ -1,3 +1,5 @@ +Buffs = new Meteor.Collection("buffs"); + //buffs are temporary once applied and store things which expire and their expiry time Schemas.Buff = new SimpleSchema({ //buff id @@ -7,8 +9,13 @@ Schemas.Buff = new SimpleSchema({ autoValue: function(){ if(!this.isSet) return Random.id(); }}, - + charId: { + type: String, + regEx: SimpleSchema.RegEx.Id + }, //expiry time expiry: { type: Number, optional: true}, duration: { type: Number } }); + +Buffs.attachSchema(Schemas.Buff); diff --git a/rpg-docs/Model/Character/Characters.js b/rpg-docs/Model/Character/Characters.js index d4a081ea..3fecb1c5 100644 --- a/rpg-docs/Model/Character/Characters.js +++ b/rpg-docs/Model/Character/Characters.js @@ -180,17 +180,10 @@ Schemas.Character = new SimpleSchema({ dexterityArmor: {type: Schemas.Skill}, "dexterityArmor.ability": { type: String, defaultValue: "dexterity" }, - //proficiencies - weaponsProficiencies: { type: [Schemas.Proficiency], defaultValue: [] }, - toolsProficiencies: { type: [Schemas.Proficiency], defaultValue: [] }, - languages: { type: [Schemas.Proficiency], defaultValue: [] }, - //mechanics - actions: { type: [Schemas.Action], defaultValue: []}, deathSave: { type: Schemas.DeathSave }, time: { type: Number, min: 0, decimal: true, defaultValue: 0}, - initiativeOrder:{ type: Number, min: 0, max: 1, decimal: true, defaultValue: 0}, - buffs: { type: [Schemas.Buff], defaultValue: []} + initiativeRoll: { type: Number, min: 0, max: 1, decimal: true, defaultValue: 0}, //TODO add permission stuff for owner, readers and writers //TODO add per-character settings }); diff --git a/rpg-docs/Model/Character/Proficiencies.js b/rpg-docs/Model/Character/Proficiencies.js new file mode 100644 index 00000000..5d6924f7 --- /dev/null +++ b/rpg-docs/Model/Character/Proficiencies.js @@ -0,0 +1,25 @@ +Proficiencies = new Meteor.Collection("proficiencies"); + +Schemas.Proficiency = new SimpleSchema({ + charId: { + type: String, + regEx: SimpleSchema.RegEx.Id + }, + name: { + type: String + }, + //indicates what type of thing proficiency originated from + type: { + type: String, + defaultValue: "editable", + allowedValues: ["editable", "feature", "buff", "equipment", "inate"] + }, + //the id of the feature, buff or item that created this effect + sourceId: { + type: String, + regEx: SimpleSchema.RegEx.Id, + optional: true + }, +}); + +Proficiencies.attachSchema(Schemas.Proficiency); diff --git a/rpg-docs/Model/Character/SubSchemas/Spell.js b/rpg-docs/Model/Character/Spells.js similarity index 77% rename from rpg-docs/Model/Character/SubSchemas/Spell.js rename to rpg-docs/Model/Character/Spells.js index 520ae054..84f7411b 100644 --- a/rpg-docs/Model/Character/SubSchemas/Spell.js +++ b/rpg-docs/Model/Character/Spells.js @@ -1,11 +1,7 @@ +Spells = new Meteor.Collection("spells"); + Schemas.Spell = new SimpleSchema({ - _id: { - type: String, - regEx: SimpleSchema.RegEx.Id, - autoValue: function(){ - if(!isSet) return Random.id(); - } - }, + charId: {type: String, regEx: SimpleSchema.RegEx.Id}, name: {type: String}, description:{type: String}, castingTime:{type: String}, @@ -19,4 +15,6 @@ Schemas.Spell = new SimpleSchema({ selfBuffs: {type: [Schemas.Buff], defaultValue: []}, level: {type: Number}, class: {type: String} -}); \ No newline at end of file +}); + +Spells.attachSchema(Schemas.Spell); diff --git a/rpg-docs/Model/Character/SubSchemas/Adjustment.js b/rpg-docs/Model/Character/SubSchemas/Adjustment.js index 0b4623fd..17815817 100644 --- a/rpg-docs/Model/Character/SubSchemas/Adjustment.js +++ b/rpg-docs/Model/Character/SubSchemas/Adjustment.js @@ -22,4 +22,4 @@ Schemas.Adjustment = new SimpleSchema({ type: String, optional: true } -}); \ No newline at end of file +}); diff --git a/rpg-docs/Model/Character/SubSchemas/Proficiency.js b/rpg-docs/Model/Character/SubSchemas/Proficiency.js deleted file mode 100644 index d8d54f44..00000000 --- a/rpg-docs/Model/Character/SubSchemas/Proficiency.js +++ /dev/null @@ -1,4 +0,0 @@ -Schemas.Proficiency = new SimpleSchema({ - name: {type: String}, - source: {type: String} -}) \ No newline at end of file