Added dburles:collection-helpers to fix transformations
This commit is contained in:
1
TODO.md
1
TODO.md
@@ -3,7 +3,6 @@ Character.js is under construction... expect broken character sheets
|
|||||||
issues
|
issues
|
||||||
------
|
------
|
||||||
|
|
||||||
* hot code pushes don't apply transforms correctly
|
|
||||||
|
|
||||||
Characters attributes and buffs
|
Characters attributes and buffs
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ iron:router
|
|||||||
accounts-password
|
accounts-password
|
||||||
accounts-ui
|
accounts-ui
|
||||||
random
|
random
|
||||||
|
dburles:collection-helpers
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ callback-hook@1.0.1
|
|||||||
check@1.0.2
|
check@1.0.2
|
||||||
ctl-helper@1.0.4
|
ctl-helper@1.0.4
|
||||||
ctl@1.0.2
|
ctl@1.0.2
|
||||||
|
dburles:collection-helpers@1.0.1
|
||||||
ddp@1.0.11
|
ddp@1.0.11
|
||||||
deps@1.0.5
|
deps@1.0.5
|
||||||
ejson@1.0.4
|
ejson@1.0.4
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ Character = function(owner){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//functions and calculated values go here
|
//functions and calculated values go here
|
||||||
protoCharacter = {
|
Characters.helpers({
|
||||||
attributeValue: function(attribute){
|
attributeValue: function(attribute){
|
||||||
if (attribute === undefined) return;
|
if (attribute === undefined) return;
|
||||||
//base value
|
//base value
|
||||||
@@ -282,7 +282,7 @@ protoCharacter = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
getMod = function(score){
|
getMod = function(score){
|
||||||
return Math.floor((score-10)/2);
|
return Math.floor((score-10)/2);
|
||||||
|
|||||||
@@ -14,13 +14,6 @@ Router.map( function () {
|
|||||||
notFoundTemplate: 'characterNotFound',
|
notFoundTemplate: 'characterNotFound',
|
||||||
data: function() {
|
data: function() {
|
||||||
var data = Characters.findOne({_id: this.params._id});
|
var data = Characters.findOne({_id: this.params._id});
|
||||||
data.features = Features.find({character: data._id});
|
|
||||||
data.containers = Containers.find({owner: data._id});
|
|
||||||
data.containers.forEach(function(container){
|
|
||||||
container.items = Items.find({container: container._id});
|
|
||||||
});
|
|
||||||
var newInstance = Object.create(protoCharacter);
|
|
||||||
data = _.extend(newInstance, data);
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -31,9 +24,6 @@ Router.map( function () {
|
|||||||
data: {
|
data: {
|
||||||
containers: function() {
|
containers: function() {
|
||||||
var containers = Containers.find({owner: data._id});
|
var containers = Containers.find({owner: data._id});
|
||||||
containers.forEach(function(container){
|
|
||||||
container.items = Items.find({container: container._id});
|
|
||||||
});
|
|
||||||
return containers;
|
return containers;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user