Changed stat cost to reflect Core Rulebook values, i.e. 2 character points per stat value up to stat value of 12, and 4 character points per stat value above stat value of 12.  Existing sheets will upgrade to correct the stat value costs, and return overages as available character points.
This commit is contained in:
johndav2
2022-07-25 12:56:15 -07:00
parent 1b8934d9ec
commit fc95ea97e5
+22 -2
View File
@@ -30,7 +30,7 @@
<div class="row padt padb"><h3 class="col-1 center border"><span>Sheet Options</span></h3></div>
<div class="row center padb">
<div class="col-1-5 padr"><h4 class="center border"><span>Sheet Version
<input type="text" class="center" name="attr_version" value="1.8.5" readonly />
<input type="text" class="center" name="attr_version" value="1.8.6" readonly />
<input type="hidden" name="attr_global_version" value="0.0.0" readonly />
</span></h4></div>
<div class="col-1-5 padr"><h4 class="center border"><span>Sheet Type
@@ -7908,6 +7908,11 @@
if (isLesserThan183) {
upgradeTo_1_8_3(value, setObj);
}
const isLesserThan186 = major_global_version <= 1 && minor_global_version < 8.6 ?
true : false;
if (isLesserThan186) {
upgradeTo_1_8_6(value, setObj);
}
setObj.global_version = sheet_version;
}
@@ -8010,6 +8015,21 @@
clog(2, {}, 'upgraded to 1.8.3');
}
function upgradeTo_1_8_6(value, setObj) {
const statValues = [
parseInt(value.static_stat_base_body) || 0,
parseInt(value.static_stat_base_mind) || 0,
parseInt(value.static_stat_base_soul) || 0
];
clog(2, {}, 'statValues:', statValues, 'upgradeTo_1_8_6()');
_.each(statValues, (s, i) => {
const cost = getStatCost(2, {}, s);
clog(2, {}, 's =', s);
setObj[`stat_cost_${allaspects_stats_array[i]}`] = cost;
});
clog(2, {}, 'upgraded to 1.8.6');
}
/** Build UI Functions **/
function getSuperStrengthLift(debug, timer, level) {
@@ -8340,7 +8360,7 @@
function getStatCost(debug, timer, level) {
let cost = 0;
for(let i = 1; i <= level; i++) {
if(i < 13) { cost += 4 } else { cost += 8 }
if(i < 13) { cost += 2 } else { cost += 4 }
}
clog(debug, timer, 'cost =', cost, 'getStatCost()');
return cost;