Added Soft remove and a character asset parenting system

This commit is contained in:
Thaum
2015-03-18 08:59:02 +00:00
parent 06b0ad7eba
commit 3656a0b66f
24 changed files with 215 additions and 121 deletions

View File

@@ -20,11 +20,8 @@ Schemas.Buff = new SimpleSchema({
Buffs.attachSchema(Schemas.Buff);
Buffs.before.remove(function (userId, buff) {
Effects.find({sourceId: buff._id, type: "buff"}).forEach(function(effect){
Effects.remove(effect._id);
});
});
Buffs.attachBehaviour('softRemovable');
makeParent(Buffs); //parents of effects and attacks
Buffs.allow(CHARACTER_SUBSCHEMA_ALLOW);
Buffs.deny(CHARACTER_SUBSCHEMA_DENY);