Implemented Features and Items granting effects, actions, attacks and spells

This commit is contained in:
Thaum
2015-01-06 12:25:58 +00:00
parent c55f2c51ab
commit 2d70119ee0
48 changed files with 625 additions and 442 deletions

View File

@@ -0,0 +1,19 @@
Template.features.helpers({
features: function(){
var features = Features.find({character: this._id});
return features;
}
});
Template.features.events({
// Fires when any element is clicked
'change .enabled': function (event) {
var enable = event.target.checked
Features.update(this._id, {$set: {enabled: enable}});
if(enable){
Template.parentData(1).pushEffects(this.name, this.effects);
} else {
Template.parentData(1).pullEffects(this.effects);
}
}
});