Quests: initial Bosses WIP - invite, accept, reject, etc

This commit is contained in:
Tyler Renelle
2013-12-20 12:42:36 -07:00
parent faeeecdf04
commit ecb354e2cc
13 changed files with 238 additions and 17 deletions
+13 -1
View File
@@ -30,7 +30,19 @@ var GroupSchema = new Schema({
balance: Number,
logo: String,
leaderMessage: String,
challenges: [{type:'String', ref:'Challenge'}] // do we need this? could depend on back-ref instead (Challenge.find({group:GID}))
challenges: [{type:'String', ref:'Challenge'}], // do we need this? could depend on back-ref instead (Challenge.find({group:GID}))
quest: {
key: String,
hp: Number,
active: {type:Boolean, 'default':false},
/*
Shows boolean for each party-member who has accepted the quest. Eg {UUID: true, UUID: false}. Once all users click
'Accept', the quest begins. If a false user waits too long, probably a good sign to prod them or boot them.
TODO when booting user, remove from .joined and check again if we can now start the quest
*/
members: Schema.Types.Mixed
}
}, {
strict: 'throw',
minimize: false // So empty objects are returned
+8 -2
View File
@@ -182,6 +182,12 @@ var UserSchema = new Schema({
),
currentMount: String,
// Quests: {
// 'boss_0': 0, // 0 indicates "doesn't own"
// 'collection_honey': 5 // Number indicates "stacking"
// }
quests: _.transform(shared.content.quests, function(m,v,k){ m[k] = Number; }),
lastDrop: {
date: {type: Date, 'default': Date.now},
count: {type: Number, 'default': 0}
@@ -193,14 +199,14 @@ var UserSchema = new Schema({
'default': Date.now
},
// FIXME remove?
party: {
//party._id // FIXME make these populate docs?
current: String, // party._id
invitation: String, // party._id
lastMessageSeen: String,
leader: Boolean,
order: {type:String, 'default':'level'}
order: {type:String, 'default':'level'},
quest: String
},
preferences: {
armorSet: String,