Moved effects to default character stats
This commit is contained in:
@@ -144,59 +144,6 @@ if (Meteor.isServer){
|
|||||||
doc.settings.newUserExperience = true;
|
doc.settings.newUserExperience = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//give ceatures default ceature effects
|
|
||||||
Creatures.after.insert(function(userId, char) {
|
|
||||||
if (Meteor.isServer) {
|
|
||||||
Effects.insert({
|
|
||||||
charId: char._id,
|
|
||||||
name: "Proficiency bonus by level",
|
|
||||||
stat: "proficiencyBonus",
|
|
||||||
operation: "add",
|
|
||||||
calculation: "floor(level / 4 + 1.75)",
|
|
||||||
parent: {
|
|
||||||
id: char._id,
|
|
||||||
collection: "Ceatures",
|
|
||||||
group: "Inate",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
Effects.insert({
|
|
||||||
charId: char._id,
|
|
||||||
name: "Dexterity Armor Bonus",
|
|
||||||
stat: "armor",
|
|
||||||
operation: "add",
|
|
||||||
calculation: "dexterityArmor",
|
|
||||||
parent: {
|
|
||||||
id: char._id,
|
|
||||||
collection: "Ceatures",
|
|
||||||
group: "Inate",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
Effects.insert({
|
|
||||||
charId: char._id,
|
|
||||||
name: "Natural Armor",
|
|
||||||
stat: "armor",
|
|
||||||
operation: "base",
|
|
||||||
value: 10,
|
|
||||||
parent: {
|
|
||||||
id: char._id,
|
|
||||||
collection: "Ceatures",
|
|
||||||
group: "Inate",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
Effects.insert({
|
|
||||||
charId: char._id,
|
|
||||||
name: "Natural Carrying Capacity",
|
|
||||||
stat: "carryMultiplier",
|
|
||||||
operation: "base",
|
|
||||||
value: "1",
|
|
||||||
parent: {
|
|
||||||
id: char._id,
|
|
||||||
collection: "Ceatures",
|
|
||||||
group: "Inate",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Creatures.allow({
|
Creatures.allow({
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ DEFAULT_CHARACTER_STATS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDefaultCreatureDocs = function(charId, creatureType = "pc"){
|
getDefaultCreatureDocs = function(charId, creatureType = "pc"){
|
||||||
let docs = {attributes: [], skills: [], damageMultipliers: []};
|
let docs = {attributes: [], skills: [], damageMultipliers: [], effects: []};
|
||||||
if (creatureType === "pc"){
|
if (creatureType === "pc"){
|
||||||
const stats = DEFAULT_CHARACTER_STATS;
|
const stats = DEFAULT_CHARACTER_STATS;
|
||||||
} else {
|
} else {
|
||||||
@@ -162,5 +162,16 @@ getDefaultCreatureDocs = function(charId, creatureType = "pc"){
|
|||||||
parent: _.clone(baseParent),
|
parent: _.clone(baseParent),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
for (let i in stats.effects){
|
||||||
|
eff = stats.effects[i];
|
||||||
|
docs.effects.push({
|
||||||
|
_id: Random.id,
|
||||||
|
charId,
|
||||||
|
name: eff.name,
|
||||||
|
stat: eff.stat,
|
||||||
|
operation: eff.operation,
|
||||||
|
calculation:eff.calculation,
|
||||||
|
});
|
||||||
|
}
|
||||||
return docs;
|
return docs;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user