Results of effects are now stored on the effect, fixed defaults to suit

This commit is contained in:
Stefan Zermatten
2019-02-04 14:29:03 +02:00
parent 2dcbc91ccd
commit e3e7b76f02
3 changed files with 61 additions and 24 deletions

View File

@@ -18,7 +18,8 @@ const getRacialBonusEffect = function(charId, attribute, bonus){
name: "Race Bonus",
stat: attribute,
operation: "add",
value: bonus,
calculation: bonus,
enabled: true,
parent: {
collection: "Creatures",
id: charId,
@@ -112,6 +113,7 @@ const getDefaultCharacterDocs = function(charId, {
stat: `${hitDice}HitDice`,
operation: "add",
calculation: `${strippedCls}Level`,
enabled: true,
parent: {
collection: "Classes",
id: classId,
@@ -134,7 +136,20 @@ const getDefaultCharacterDocs = function(charId, {
name: cls,
stat: `${hitDice}HitDice`,
operation: "add",
calculation: `${strippedCls}Level`,
enabled: true,
parent: {
collection: "Classes",
id: classId,
},
charId: charId,
});
docs.effects.push({
name: cls,
stat: `hitPoints`,
operation: "add",
calculation: `${healthPerLevel - 2} + ${healthPerLevel} * ${strippedCls}Level`,
enabled: true,
parent: {
collection: "Classes",
id: classId,