From fc95ea97e527bddd9d12a59abbcb29da369c36dd Mon Sep 17 00:00:00 2001 From: johndav2 <44272061+johndav2@users.noreply.github.com> Date: Mon, 25 Jul 2022 12:56:15 -0700 Subject: [PATCH] v1.8.6 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. --- BESM4eExtras/BESM4eExtras.html | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/BESM4eExtras/BESM4eExtras.html b/BESM4eExtras/BESM4eExtras.html index eb75bcea1a..814dae33a9 100644 --- a/BESM4eExtras/BESM4eExtras.html +++ b/BESM4eExtras/BESM4eExtras.html @@ -30,7 +30,7 @@

Sheet Options

Sheet Version - +

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;