Added base values to skills to make implementing non player creatures easier

This commit is contained in:
Stefan Zermatten
2018-10-12 12:35:15 +02:00
parent 158615c25c
commit 6aaa4ebe00
2 changed files with 7 additions and 1 deletions

View File

@@ -40,6 +40,11 @@ skillSchema = new SimpleSchema({
order: {
type: Number,
},
baseValue: {
type: Number,
decimal: true,
optional: true,
},
value: {
type: Number,
decimal: true,

View File

@@ -230,6 +230,7 @@ function buildCreature(charId){
busyComputing: false,
type: "skill",
ability: skill.ability,
base: skill.baseValue || 0,
result: 0, // For skills the result is the skillMod
proficiency: 0,
add: 0,
@@ -528,9 +529,9 @@ function combineSkill(stat, char){
if (stat.result < stat.min) stat.result = stat.min;
if (stat.result > stat.max) stat.result = stat.max;
stat.result = Math.floor(stat.result);
if (stat.base > stat.result) stat.result = stat.base;
}
/**
* combineDamageMultiplier - Combine damageMultiplier's results into final values
*