Added base values to skills to make implementing non player creatures easier
This commit is contained in:
@@ -40,6 +40,11 @@ skillSchema = new SimpleSchema({
|
|||||||
order: {
|
order: {
|
||||||
type: Number,
|
type: Number,
|
||||||
},
|
},
|
||||||
|
baseValue: {
|
||||||
|
type: Number,
|
||||||
|
decimal: true,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
value: {
|
value: {
|
||||||
type: Number,
|
type: Number,
|
||||||
decimal: true,
|
decimal: true,
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ function buildCreature(charId){
|
|||||||
busyComputing: false,
|
busyComputing: false,
|
||||||
type: "skill",
|
type: "skill",
|
||||||
ability: skill.ability,
|
ability: skill.ability,
|
||||||
|
base: skill.baseValue || 0,
|
||||||
result: 0, // For skills the result is the skillMod
|
result: 0, // For skills the result is the skillMod
|
||||||
proficiency: 0,
|
proficiency: 0,
|
||||||
add: 0,
|
add: 0,
|
||||||
@@ -528,9 +529,9 @@ function combineSkill(stat, char){
|
|||||||
if (stat.result < stat.min) stat.result = stat.min;
|
if (stat.result < stat.min) stat.result = stat.min;
|
||||||
if (stat.result > stat.max) stat.result = stat.max;
|
if (stat.result > stat.max) stat.result = stat.max;
|
||||||
stat.result = Math.floor(stat.result);
|
stat.result = Math.floor(stat.result);
|
||||||
|
if (stat.base > stat.result) stat.result = stat.base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* combineDamageMultiplier - Combine damageMultiplier's results into final values
|
* combineDamageMultiplier - Combine damageMultiplier's results into final values
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user