Merge pull request #10481 from Darth-John/BESM4eExtras_Dev
[BESM4eExtras] Bug Fixes, UI Updates
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* === VERSION === */
|
||||
/* 1.7.6 */
|
||||
/* 1.8.0 */
|
||||
|
||||
/* === GENERAL === */
|
||||
.charsheet {
|
||||
@@ -2326,7 +2326,9 @@ button.sheet-major-stat[type="action"] {
|
||||
}
|
||||
|
||||
button.sheet-activated,
|
||||
input.sheet-targeted[value="1"] ~ button.sheet-targeted,
|
||||
input.sheet-push-button:checked + button.sheet-condition,
|
||||
input.sheet-push-button:checked + button.sheet-multi-select,
|
||||
input.sheet-protectionstate:checked + h4.sheet-protection,
|
||||
input.sheet-targeted:checked + button.sheet-targeted,
|
||||
input.sheet-weapon:checked + button.sheet-weapon,
|
||||
@@ -2678,6 +2680,21 @@ div.sheet-flex-skillcontainer {
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.sheet-flex-11-12 {
|
||||
flex: 0 1 91.66667%;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.sheet-flex-12-13 {
|
||||
flex: 0 1 92.30769%;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.sheet-flex-14-15 {
|
||||
flex: 0 1 93.33333%;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.sheet-flex-19-20 {
|
||||
flex: 0 1 95%;
|
||||
align-self: center;
|
||||
|
||||
+288
-85
@@ -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.7.6" readonly />
|
||||
<input type="text" class="center" name="attr_version" value="1.8.1" 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
|
||||
@@ -110,10 +110,61 @@
|
||||
<span class="ro-close-label"></span>
|
||||
</div>
|
||||
<div class="row padb">
|
||||
<h3 class="col-9-23 templates-title center border"><span>Size Template</span></h3>
|
||||
<h3 class="col-13-20 templates-title center border"><span>Size Template</span></h3>
|
||||
</div>
|
||||
<div class="row padb">
|
||||
<div class="col-1-2">
|
||||
<div class="col-1-3">
|
||||
<div class="flex-container-spacearound padb">
|
||||
<h4 class="flex-11-12 center border"><span>Size</span>
|
||||
<select name="attr_static_template_size_selection">
|
||||
<option value="point">Point</option>
|
||||
<option value="mote">Mote</option>
|
||||
<option value="speck">Speck</option>
|
||||
<option value="minute">Minute</option>
|
||||
<option value="wee">Wee</option>
|
||||
<option value="teeny">Teeny</option>
|
||||
<option value="fine">Fine</option>
|
||||
<option value="diminutive">Diminutive</option>
|
||||
<option value="tiny">Tiny</option>
|
||||
<option value="small">Small</option>
|
||||
<option value="medium">Medium</option>
|
||||
<option value="large">Large</option>
|
||||
<option value="huge">Huge</option>
|
||||
<option value="mammoth">Mammoth</option>
|
||||
<option value="gigantic">Gigantic</option>
|
||||
<option value="gargantuan">Gargantuan</option>
|
||||
<option value="colossal">Colossal</option>
|
||||
<option value="enormous">Enormous</option>
|
||||
<option value="monstrous">Monstrous</option>
|
||||
<option value="titanic">Titanic</option>
|
||||
<option value="monumental">Monumental</option>
|
||||
</select>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="flex-container-spacearound padb">
|
||||
<h4 class="flex-1-4 center border">
|
||||
<span style="font-size: 99px;"> </span>
|
||||
</h4>
|
||||
<h4 class="flex-1-4 center border"><span>Rank</span>
|
||||
<input type="number" class="center" name="attr_static_template_size_rank" value=0 readonly />
|
||||
</h4>
|
||||
<h4 class="flex-1-4 center border"><span>Cost</span>
|
||||
<input type="number" class="center" name="attr_static_template_size_cost" value=0 readonly />
|
||||
</h4>
|
||||
</div>
|
||||
<div class="flex-container-spacearound">
|
||||
<h4 class="flex-11-12 center border">
|
||||
<span style="font-size: 99px;"> </span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1-3">
|
||||
<div class="flex-container-spacearound">
|
||||
<h4 class="flex-9-10 center border"><span>Description</span>
|
||||
<textarea name="attr_static_template_size_description"></textarea>
|
||||
</h4>
|
||||
</div>
|
||||
<!--
|
||||
<div class="template-size">
|
||||
<div class="col-4-5 center">
|
||||
<h4 class="border center">
|
||||
@@ -129,6 +180,7 @@
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -156,7 +208,7 @@
|
||||
<input type="number" name="attr_gainedcp" value=0 />
|
||||
</span></h4></div>
|
||||
<div class="col-1-4 padr"><h4 class="center border"><span name="attr_label_class">Spent
|
||||
<input type="number" name="attr_cpspent" value="(@{stat_cost_body}+@{stat_cost_mind}+@{stat_cost_soul}+@{static_attrgroup_1_totalcost}+@{static_attrgroup_2_totalcost}+@{static_attrgroup_3_totalcost}+@{static_attrgroup_4_totalcost}+@{static_attrgroup_5_totalcost}+@{static_attrgroup_6_totalcost}+@{static_attrgroup_7_totalcost}+@{static_attrgroup_8_totalcost}+@{static_attrgroup_9_totalcost}+@{static_attrgroup_10_totalcost})" disabled />
|
||||
<input type="number" name="attr_cpspent" value="(@{static_template_size_cost}+@{stat_cost_body}+@{stat_cost_mind}+@{stat_cost_soul}+@{static_attrgroup_1_totalcost}+@{static_attrgroup_2_totalcost}+@{static_attrgroup_3_totalcost}+@{static_attrgroup_4_totalcost}+@{static_attrgroup_5_totalcost}+@{static_attrgroup_6_totalcost}+@{static_attrgroup_7_totalcost}+@{static_attrgroup_8_totalcost}+@{static_attrgroup_9_totalcost}+@{static_attrgroup_10_totalcost})" disabled />
|
||||
</span></h4></div>
|
||||
<div class="col-1-4"><h4 class="center border"><span name="attr_label_class">Remaining
|
||||
<input type="number" name="attr_cpremaining" value="@{basecp}+@{gainedcp}-@{cpspent}" disabled />
|
||||
@@ -189,13 +241,13 @@
|
||||
<input type="text" class="center border" name="attr_playername" placeholder="Player Name" value="" />
|
||||
</span></h4></div>
|
||||
<div class="col-1-6 padl"><h4 class="center border"><span name="attr_label_size">Size
|
||||
<input type="text" class="center border" name="attr_size" value="Medium" readonly />
|
||||
<input type="text" class="center border" name="attr_static_template_size_name" value="Medium" readonly />
|
||||
</span></h4></div>
|
||||
<div class="col-1-6 padl"><h4 class="center border"><span name="attr_label_height">Height
|
||||
<input type="text" class="center border" name="attr_height" value="" />
|
||||
<input type="text" class="center border" name="attr_static_template_size_height" value="" />
|
||||
</span></h4></div>
|
||||
<div class="col-1-6 padl"><h4 class="center border"><span name="attr_label_mass">Mass
|
||||
<input type="text" class="center border" name="attr_mass" value="" />
|
||||
<input type="text" class="center border" name="attr_static_template_size_mass" value="" />
|
||||
</span></h4></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1904,7 +1956,9 @@
|
||||
</div>
|
||||
<div class="flex-1-5">
|
||||
<h4 class="center border">
|
||||
<span style="font-size: 99px;"> </span>
|
||||
<span name="attr_label_lift">Lift
|
||||
<input type="text" class="center border" name="attr_stat_total_lift" value="0" readonly />
|
||||
</span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
@@ -7687,6 +7741,7 @@
|
||||
const rolls_array = ['static_roll_type_selection','static_button_personal_defense','static_button_movement_defense'];
|
||||
const combat_stats_array = ['static_weapon_autofire_selection','weapon_ammo_capacity','weapon_ammo_reloads','static_weapon_range_selection','mainhand_state', 'offhand_state', 'mainhand_source', 'offhand_source', 'extraarms', 'extraarms_inuse', 'static_button_targeted_rushdamage', 'static_button_targeted_damage', 'static_button_targeted_attack', 'static_button_targeted_defense', 'massivedamage_targeted', 'massivedamage', 'enemyattack', 'enemydefense'];
|
||||
const size_template_values_array = ['size', 'height', 'mass', 'size_lift', 'size_strdmg', 'size_ar', 'size_extradmg', 'size_rnghitdef', 'size_rngspd'];
|
||||
const size_template_keys_array = ['name','rank','cost','height','mass','lift','strdmg','ar','extradmg','rnghitdef','rngspd'];
|
||||
const all_attributes_array = ['absorption','alternate form','alternate identity','armor','attack mastery','augmented','capacity','change state','cognition','combat technique','companion','connected','control environment','conversion','data access','defect','defense mastery','dimension walk','dynamic powers','elasticity','enemy attack','enemy defense','energized','exorcism','extra actions','extra arms','extra defenses','features','flight','forcefield','gear','ground speed','healing','heightened awareness','heightened senses','illusion','immovable','immunity','immutable','inspire','jumping','massive damage','melee attack','melee defense','merge','metamorphosis','mimic','mind control','mind shield','minions','mulligan','nullify','plant control','pocket dimension','portal','power flux','power variation','projection','ranged attack','ranged defense','regeneration','reincarnation','resilient','sensory block','shield','sixth sense','size change','skill','social mastery','spaceflight','special movement','summon creatures','supersense','superspeed','superstrength','swarm','telekinesis','telepathy','teleport','tough','transfer','transmute','tunneling','unaffected','unassailable','undetectable','unique attribute','unknown power','water speed','wealth','weapon'];
|
||||
const all_attributes_regex = /(absorption|alternate form|alternate identity|armor|attack mastery|augmented|capacity|change state|cognition|combat technique|companion|connected|control environment|conversion|data access|defect|defense mastery|dimension walk|dynamic powers|elasticity|enemy attack|enemy defense|energized|exorcism|extra actions|extra arms|extra defenses|features|flight|forcefield|gear|ground speed|healing|heightened awareness|heightened senses|illusion|immovable|immunity|immutable|inspire|jumping|massive damage|melee attack|melee defense|merge|metamorphosis|mimic|mind control|mind shield|minions|mulligan|nullify|plant control|pocket dimension|portal|power flux|power variation|projection|ranged attack|ranged defense|regeneration|reincarnation|resilient|sensory block|shield|sixth sense|size change|skill|social mastery|spaceflight|special movement|summon creatures|supersense|superspeed|superstrength|swarm|telekinesis|telepathy|teleport|tough|transfer|transmute|tunneling|unaffected|unassailable|undetectable|unique attribute|unknown power|water speed|wealth|weapon)/i;
|
||||
const all_defects_array = ["achilles heel","awkward size","bane","blind fury","conditional ownership","confined","cursed","demure","easily distracted","fragile","hounded","impaired manipulation","impaired speech","inept attack","inept defense","involuntary change","ism","magnet","marked","nemesis","nightmares","no healing","obligated","phobia","physical impairment","red tape","reduced damage","sensory impairment","shortcoming","significant other","skeleton in the closet","social fault","special requirement","unappealing","unique defect","unsettled","vulnerability","wanted","weak point"];
|
||||
@@ -7806,44 +7861,38 @@
|
||||
}
|
||||
}
|
||||
|
||||
function doUpgrade(value, attrIDs, setObj){
|
||||
function doUpgrade(value, sheetdb, attrIDs,sizetemplateIDs, setObj){
|
||||
clog(2, {}, `global_version =`, value.global_version, 'doUpgrade()');
|
||||
clog(2, {}, 'sheet_version =', value.version);
|
||||
const sheet_version = value.version;
|
||||
let global_version = value.global_version.split('.').map(Number);
|
||||
const major_global_version = parseInt(global_version.shift());
|
||||
const minor_global_version = parseFloat(global_version.join('.'));
|
||||
//clog(2, {}, 'global_version =', global_version);
|
||||
//clog(2, {}, 'major_global_version =', major_global_version);
|
||||
//clog(2, {}, 'minor_global_version =', minor_global_version);
|
||||
//const isLesserThan122 = global_version[0] <= 1 && global_version[1] <= 2 && global_version[2] < 2 ?
|
||||
const isLesserThan122 = major_global_version <= 1 && minor_global_version < 2.2 ?
|
||||
true : false;
|
||||
//clog(2, {}, 'isLesserThan122 =', isLesserThan122);
|
||||
if (isLesserThan122) {
|
||||
upgradeTo_1_2_2(value, setObj);
|
||||
}
|
||||
//const isLesserThan131 = global_version[0] <= 1 && global_version[1] <= 3 && global_version[2] < 1 ?
|
||||
const isLesserThan131 = major_global_version <= 1 && minor_global_version < 3.1 ?
|
||||
true : false;
|
||||
//clog(2, {}, 'isLesserThan131 =', isLesserThan131);
|
||||
if (isLesserThan131) {
|
||||
upgradeTo_1_3_1(value, setObj);
|
||||
}
|
||||
//const isLesserThan150 = global_version[0] <= 1 && global_version[1] < 5 ?
|
||||
const isLesserThan150 = major_global_version <= 1 && minor_global_version < 5.0 ?
|
||||
true : false;
|
||||
//clog(2, {}, 'isLesserThan150 =', isLesserThan150);
|
||||
if (isLesserThan150) {
|
||||
upgradeTo_1_5_0(setObj);
|
||||
}
|
||||
//const isLesserThan172 = global_version[0] <= 1 && global_version[1] <= 7 && global_version[2] < 2 ?
|
||||
const isLesserThan172 = major_global_version <= 1 && minor_global_version < 7.2 ?
|
||||
true : false;
|
||||
//clog(2, {}, 'isLesserThan172 =', isLesserThan172);
|
||||
if (isLesserThan172) {
|
||||
upgradeTo_1_7_2(attrIDs, setObj);
|
||||
}
|
||||
const isLesserThan180 = major_global_version <= 1 && minor_global_version < 8.0 ?
|
||||
true : false;
|
||||
if (isLesserThan180) {
|
||||
upgradeTo_1_8_0(sizetemplateIDs, value, sheetdb, setObj);
|
||||
}
|
||||
setObj.global_version = sheet_version;
|
||||
}
|
||||
|
||||
@@ -7919,8 +7968,92 @@
|
||||
clog(2, {}, 'upgraded to 1.7.2');
|
||||
}
|
||||
|
||||
function upgradeTo_1_8_0(sizetemplateIDs, value, sheetdb, setObj) {
|
||||
const currSize = value.static_template_size_name || 'medium';
|
||||
setDefaultSize(sheetdb, setObj, currSize);
|
||||
setTotalLift(0, {}, {}, value, setObj);
|
||||
if (sizetemplateIDs.length !== undefined) {
|
||||
_.each(sizetemplateIDs, id => {
|
||||
removeRepeatingRow(`repeating_sizetemplate_${id}`);
|
||||
});
|
||||
}
|
||||
clog(2, {}, 'upgraded to 1.8.0');
|
||||
}
|
||||
|
||||
/** Build UI Functions **/
|
||||
|
||||
function getSuperStrengthLift(debug, timer, level) {
|
||||
const lift = level !== 0 ?
|
||||
get1or2andHalfor5(level) * (10 ** (Math.floor(level/3) + 2)) :
|
||||
level;
|
||||
clog(debug, timer, 'lift =', lift, 'getSuperStrengthLift()');
|
||||
return lift;
|
||||
};
|
||||
|
||||
function setTotalLift(debug, timer, attrdb, value, setObj) {
|
||||
const size = value.static_template_size_name;
|
||||
const rank = parseInt(value.static_template_size_rank);
|
||||
clog(debug, timer, 'size =', size, 'setTotalLift()');
|
||||
const liftMultiplier = size === 'Medium' ? 1 :
|
||||
rank < 0 ? parseFloat(value.static_template_size_lift) :
|
||||
parseInt(value.static_template_size_lift);
|
||||
clog(debug, timer, 'liftMultiplier =', liftMultiplier);
|
||||
const ssdb = attrdb.superstrength;
|
||||
const hasSuperStrength = ssdb === undefined ? false :
|
||||
_.chain(ssdb).pluck('level').reduce((p,c) => { return p + c; }, 0).value();
|
||||
clog(debug, timer, 'hasSuperStrength =', hasSuperStrength);
|
||||
const strValue = isNaN(parseInt(setObj.stat_total_str)) ?
|
||||
parseInt(value.stat_total_str) : parseInt(setObj.stat_total_str);
|
||||
const lift = hasSuperStrength ? parseInt(getSuperStrengthLift(debug, timer, hasSuperStrength)) :
|
||||
strValue * 25;
|
||||
clog(debug, timer, 'lift =', lift);
|
||||
const totalLift = lift * liftMultiplier;
|
||||
clog(debug, timer, 'totalLift =', totalLift);
|
||||
setObj.stat_total_lift = totalLift;
|
||||
}
|
||||
|
||||
function setDefaultSize(sheetdb, setObj, size = 'Medium') {
|
||||
//clog(2, {}, 'size =', size, 'setDefaultSize()');
|
||||
const json = JSON.parse(global_templates_size_json);
|
||||
//clog(2, {}, 'json:', json);
|
||||
const template = _.find(json.template, t => {
|
||||
//clog(2, {}, 't:', t);
|
||||
if (t.name === size) return true;
|
||||
});
|
||||
//clog(2, {}, 'template:', template);
|
||||
const description = "Height/Length: " + template.height + "\r\nMass: " + template.mass + "\r\nLift: " + template.lift + "\r\nStrength Damage: " + template.strdmg + "\r\nArmor Rating: " + template.ar + "\r\nExtra Damage Taken: " + template.extradmg + "\r\nRanged Hit/Defend: " + template.rnghitdef + "\r\nRange Speed: " + template.rngspd;
|
||||
const cost = parseInt(template.rank) * 10;
|
||||
_.each(size_template_keys_array, key => {
|
||||
const val = isNaN(template[key]) ? template[key] : parseInt(template[key]);
|
||||
setObj[`static_template_size_${key}`] = val;
|
||||
sheetdb[`static_template_size_${key}`] = val;
|
||||
});
|
||||
setObj.static_template_size_selection = template.name.toLowerCase();
|
||||
sheetdb.static_template_size_selection = template.name.toLowerCase();
|
||||
setObj.static_template_size_description = description;
|
||||
setObj.static_template_size_cost = cost;
|
||||
}
|
||||
|
||||
function setSizeTemplate(debug, timer, eventInfo, value, setObj) {
|
||||
const size = capital(eventInfo.newValue);
|
||||
clog(debug, timer, 'size =', size, 'setSizeTemplate()');
|
||||
const json = JSON.parse(global_templates_size_json);
|
||||
clog(debug, timer, 'json:', json);
|
||||
const template = _.find(json.template, t => {
|
||||
if (t.name === size) return true;
|
||||
});
|
||||
clog(debug, timer, 'template:', template);
|
||||
const description = "Height/Length: " + template.height + "\r\nMass: " + template.mass + "\r\nLift: " + template.lift + "\r\nStrength Damage: " + template.strdmg + "\r\nArmor Rating: " + template.ar + "\r\nExtra Damage Taken: " + template.extradmg + "\r\nRanged Hit/Defend: " + template.rnghitdef + "\r\nRange Speed: " + template.rngspd;
|
||||
clog(debug, timer, 'description =', description);
|
||||
const cost = parseInt(template.rank) * 10;
|
||||
_.each(size_template_keys_array, key => {
|
||||
writeValues(debug, timer, value, `static_template_size_${key}`, template[key], setObj);
|
||||
});
|
||||
writeValues(debug, timer, value, 'static_template_size_selection', template.name.toLowerCase(), setObj);
|
||||
setObj.static_template_size_description = description;
|
||||
setObj.static_template_size_cost = cost;
|
||||
}
|
||||
/*
|
||||
function buildSizeUI(sizes, setObj) {
|
||||
var json = JSON.parse(global_templates_size_json);
|
||||
_.each(sizes, (size, i) => {
|
||||
@@ -7945,7 +8078,7 @@
|
||||
setObj[`repeating_sizetemplate_${rowID}_rngspd`] = json.template[`${i}`].rngspd;
|
||||
});
|
||||
}
|
||||
|
||||
*/
|
||||
function getSkillStatsDisplay(stats) {
|
||||
var result = "";
|
||||
_.each(stats, (stat, i) => {
|
||||
@@ -8109,12 +8242,12 @@
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
function buildSizeTemplateValuesArray(rowID) {
|
||||
const result = [`repeating_sizetemplate_${rowID}_height`, `repeating_sizetemplate_${rowID}_mass`, `repeating_sizetemplate_${rowID}_lift`, `repeating_sizetemplate_${rowID}_strdmg`, `repeating_sizetemplate_${rowID}_ar`, `repeating_sizetemplate_${rowID}_extradmg`, `repeating_sizetemplate_${rowID}_rnghitdef`, `repeating_sizetemplate_${rowID}_rngspd`, `repeating_sizetemplate_${rowID}_selection`, `repeating_sizetemplate_${rowID}_description`, `repeating_sizetemplate_${rowID}_label`];
|
||||
return result;
|
||||
}
|
||||
|
||||
*/
|
||||
function buildRepeatingExtraArmValuesArray(extraarms) {
|
||||
var result = [];
|
||||
if (extraarms != undefined) {
|
||||
@@ -8193,7 +8326,7 @@
|
||||
}
|
||||
|
||||
function getDefectPointsByCategory(value, rowID, defect){
|
||||
const aspect = value[`repeating_attr_${rowID}_defectaspect`];
|
||||
const aspect = value[`repeating_attr_${rowID}_defectaspect`] || [];
|
||||
const result = defect == 'shortcoming' ? aspect.length > 3 ? -4 : -1 :
|
||||
lesser_defects_regex.test(defect) ? -1 :
|
||||
serious_defects_regex.test(defect) ? -2 :
|
||||
@@ -8844,6 +8977,7 @@
|
||||
key === undefined ? true :
|
||||
key === "" ? true :
|
||||
key.indexOf('undefined') !== -1 ? true :
|
||||
key.indexOf('__') !== -1 ? true :
|
||||
false;
|
||||
const isResultUndefined =
|
||||
result === undefined ? true :
|
||||
@@ -8978,8 +9112,8 @@
|
||||
const showMajorAspectStats = majorAspectInUse ? 1 : 0;
|
||||
setObj.showallaspectsstats = showAllAspectsStats;
|
||||
setObj.showmajoraspectstats = showMajorAspectStats;
|
||||
clog(debug, timer, 'showallaspectsstats =', showallaspectsstats, 'setStatAspectView()');
|
||||
clog(debug, timer, 'showmajoraspectstats =', showmajoraspectstats);
|
||||
clog(debug, timer, 'showallaspectsstats =', showAllAspectsStats, 'setStatAspectView()');
|
||||
clog(debug, timer, 'showmajoraspectstats =', showMajorAspectStats);
|
||||
}
|
||||
|
||||
function setDamageLevelByDamageTaken(debug, timer, value, setObj, sourceAttr) {
|
||||
@@ -9031,10 +9165,11 @@
|
||||
(derivedvalue == 'sanity') ? 'unassailable' :
|
||||
(derivedvalue == 'social') ? 'socialmastery' :
|
||||
'';
|
||||
const multiplier = attribute === 'tough' || attribute === 'energized' ? 10 : 2;
|
||||
const bonusattribute = attrdb[`${attribute}`];
|
||||
const bonus = _.chain(bonusattribute)
|
||||
.map(o => {
|
||||
const result = parseInt(o.level) || 0;
|
||||
const result = parseInt(o.level) * multiplier || 0;
|
||||
return result;
|
||||
})
|
||||
.reduce((memo, num)=>{ return memo + num; }, 0)
|
||||
@@ -10502,6 +10637,7 @@
|
||||
|
||||
function setDynamicRollValue(debug, timer, eventInfo, value, attrdb, rowID, sourceAttr, setObj) {
|
||||
const rolltype = value.static_roll_type_selection;
|
||||
clog(debug, timer, 'rolltype =', rolltype, 'setDynamicRollValue()');
|
||||
let cv = 0;
|
||||
let rollmod = 0;
|
||||
let type = '';
|
||||
@@ -10516,7 +10652,7 @@
|
||||
title = '{{title=Roll 2d6}}';
|
||||
break;
|
||||
case 'acv':
|
||||
cv = getCV(debug, timer, value, attrdb, setObj, sourceAttr, 'acv', '', true);
|
||||
cv = getCV(debug, timer, value, attrdb, setObj, 'acv', '');
|
||||
type = '{{acvroll=1}}';
|
||||
title = '{{title=Roll ACV}}';
|
||||
stat = `{{acv=${cv}}}`;
|
||||
@@ -10533,10 +10669,8 @@
|
||||
parseInt(value.static_button_personal_defense) ?
|
||||
'personal' :
|
||||
'';
|
||||
const bonus = defensetype != '' ?
|
||||
getSumOfActiveAttrLevels(attrdb, 'rangeddefense', defensetype) * 2 :
|
||||
0;
|
||||
cv = getCV(debug, timer, value, attrdb, setObj, sourceAttr, 'dcv', '', true) + bonus;
|
||||
clog(debug, timer, 'defensetype =', defensetype);
|
||||
cv = getCV(debug, timer, value, attrdb, setObj, 'dcv', defensetype);
|
||||
type = '{{dcvroll=1}}';
|
||||
title = '{{title=Roll DCV}}';
|
||||
stat = `{{dcv=${cv}}}`;
|
||||
@@ -10544,7 +10678,7 @@
|
||||
result = `${result} ${buildProtectionsString(debug, timer, value)}`;
|
||||
break;
|
||||
case 'initiative':
|
||||
cv = getCV(debug, timer, value, attrdb, setObj, sourceAttr, 'acv', '');
|
||||
cv = getCV(debug, timer, value, attrdb, setObj, 'acv', '');
|
||||
rollmod = getSumOfActiveSubAttrRanks(attrdb, 'combattechnique', 'lightningreflexes') || 0;
|
||||
type = '{{initiative=1}}';
|
||||
title = '{{title=Roll Initiative}}';
|
||||
@@ -10575,6 +10709,7 @@
|
||||
`|Minor Edge, ${setDice(rollmod, 1)}|Minor Obstacle, ${setDice(rollmod, -1)}` +
|
||||
`|Major Edge, ${setDice(rollmod, 2)}|Major Obstacle, ${setDice(rollmod, -2)}}]]` +
|
||||
`+[[${base}]] ${turntracker}]]}} {{roll=$[[0]]}}`;
|
||||
clog(debug, timer, 'result =', result);
|
||||
setObj.dynamic_roll_value = result;
|
||||
setObj.dynamic_roll_base = base;
|
||||
}
|
||||
@@ -10656,7 +10791,8 @@
|
||||
_.each(all_defects_array, defectmatch => {
|
||||
defectmatch = removeWhiteSpace(defectmatch);
|
||||
const exposesetting = defectmatch == defect ? 1 : 0;
|
||||
setObj[`repeating_attr_${rowID}_show${defectmatch}`] = exposesetting;
|
||||
//setObj[`repeating_attr_${rowID}_show${defectmatch}`] = exposesetting;
|
||||
writeValues(debug, timer, value, `repeating_attr_${rowID}_show${defectmatch}`, exposesetting, setObj);
|
||||
exposesetting ? exposed_settings.push(`show${defectmatch}`) : false;
|
||||
});
|
||||
clog(debug, timer, 'exposed_settings:', exposed_settings, 'exposeDefectSettingsOnDefectChange()');
|
||||
@@ -10826,7 +10962,7 @@
|
||||
damagetype = (isActive) ? value[`repeating_attr_${rowID}_damagetype`] : "";
|
||||
setObj[`protection_${attr}${layer}_specialized`] = specialized;
|
||||
setObj[`protection_${attr}${layer}_gap`] = gap;
|
||||
setObj[`protection_${attr}${layer}_damagetype`] = damagetype;
|
||||
if (damagetype !== undefined) setObj[`protection_${attr}${layer}_damagetype`] = damagetype;
|
||||
clog(debug, timer, 'specialized =', specialized);
|
||||
clog(debug, timer, 'damagetype =', damagetype);
|
||||
clog(debug, timer, 'gap =', gap);
|
||||
@@ -10998,8 +11134,25 @@
|
||||
clog(debug, timer, 'senseRanks:', senseRanks, 'setHeightenedSenses()');
|
||||
}
|
||||
|
||||
function getIsTargetedActive(debug, timer, value, attrIDs, rowID, setObj) {
|
||||
function getIsTargetedActive(debug, timer, value, attrdb, rowID, setObj) {
|
||||
clog(debug, timer, 'rowID =', rowID, 'getIsTargetedActive()');
|
||||
const isTargeted = getIsTargeted(debug, timer, value, rowID, setObj);
|
||||
if (!isTargeted) return '';
|
||||
const activeID = parseInt(value[`repeating_attr_${rowID}_activate`]) === 1 ?
|
||||
rowID : '';
|
||||
clog(debug, timer, 'activeID =', activeID);
|
||||
clog(debug, timer, 'activate =', value[`repeating_attr_${rowID}_activate`]);
|
||||
/*
|
||||
const attribute = removeWhiteSpace(value[`repeating_attr_${rowID}_attribute`]);
|
||||
clog(debug, timer, 'attribute =', attribute, 'getIsTargetedActive()');
|
||||
const activedb = attrdb[`${attribute}`];
|
||||
const isActive = activedb !== undefined ?
|
||||
_.chain(activedb).pluck('source').find(s => {
|
||||
if (s === rowID) return true;
|
||||
}).value() : undefined;
|
||||
const activeID = isActive !== undefined ? rowID : '';
|
||||
clog(debug, timer, 'activeID =', activeID);
|
||||
/*
|
||||
let activeID = "";
|
||||
_.each(attrIDs, (attrID) => {
|
||||
const attrname = removeWhiteSpace(value[`repeating_attr_${attrID}_attribute`]);
|
||||
@@ -11008,6 +11161,7 @@
|
||||
activeID = attrID;
|
||||
}
|
||||
});
|
||||
*/
|
||||
return activeID;
|
||||
}
|
||||
|
||||
@@ -11055,12 +11209,14 @@
|
||||
getTargetedLevel(attrdb, attribute);
|
||||
const result = (isActive) ? targeted : 0;
|
||||
const enable = (result > 0) ? 1 : 0;
|
||||
const activeID = getIsTargetedActive(debug, timer, value, attrIDs, rowID, setObj);
|
||||
const activeID = getIsTargetedActive(debug, timer, value, attrdb, rowID, setObj);
|
||||
attribute = isRushAttack ? 'rushattack' : attribute;
|
||||
/*
|
||||
if (activeID != "") {
|
||||
setActiveAttribute(0, debug, timer, value, activeID, sourceAttr, setObj, attribute);
|
||||
setObj[`repeating_attr_${activeID}_activate`] = 0;
|
||||
}
|
||||
*/
|
||||
clog(debug, timer, 'attribute =', attribute, 'setTargeted()');
|
||||
clog(debug, timer, 'targeted =', targeted);
|
||||
clog(debug, timer, 'result =', result);
|
||||
@@ -11135,7 +11291,7 @@
|
||||
}
|
||||
clog(debug, timer, 'defectdb:', defectdb, 'setDefectdb()');
|
||||
}
|
||||
|
||||
/*
|
||||
function getAttributeSettingByCustomization(debug, timer, value, rowID, customizations) {
|
||||
const attribute_settings_by_customization_obj = {
|
||||
'ammo':'ammo',
|
||||
@@ -11164,12 +11320,14 @@
|
||||
});
|
||||
clog(debug, timer, 'customizations:', customizations, 'getAttributeSettingByCustomization()');
|
||||
}
|
||||
|
||||
*/
|
||||
function setAttrdb(isActive, debug, timer, value, attrdb, attrIDs, rowID, sourceAttr, attribute, setObj) {
|
||||
clog(debug, timer, 'isActive =', isActive, 'setAttrdb(TEST)');
|
||||
clog(debug, timer, 'attribute =', attribute);
|
||||
const name = value[`repeating_attr_${rowID}_name`] || "";
|
||||
const level = parseInt(value[`repeating_attr_${rowID}_effectivelevel`]) || 0;
|
||||
const customizations = value[`repeating_attr_${rowID}_customizations`] || [];
|
||||
getAttributeSettingByCustomization(debug, timer, value, rowID, customizations);
|
||||
//getAttributeSettingByCustomization(debug, timer, value, rowID, customizations);
|
||||
let result = {};
|
||||
let stat = 0;
|
||||
let focused = 0;
|
||||
@@ -11267,12 +11425,14 @@
|
||||
}
|
||||
if (isActive) {
|
||||
attrdb[`${attribute}`].push(result);
|
||||
/*
|
||||
if (getIsTargeted(debug, timer, value, rowID, setObj)) {
|
||||
const activeID = getIsTargetedActive(debug, timer, value, attrIDs, rowID, setObj);
|
||||
const activeID = getIsTargetedActive(debug, timer, value, attrdb, rowID, setObj);
|
||||
if (activeID != "") {
|
||||
attrdb[`${attribute}`].splice(getActiveIdPosition(attrdb, attribute, activeID), 1);
|
||||
}
|
||||
}
|
||||
*/
|
||||
} else {
|
||||
attrdb[`${attribute}`].find((attr, i) => {
|
||||
//console.log(`attr.source = ${attr.source}`); console.log(`rowID = ${rowID}`);
|
||||
@@ -11706,8 +11866,12 @@
|
||||
setActiveAttribute(isActive, debug, timer, value, rowID, attrdb, setObj, attribute, level);
|
||||
break;
|
||||
case "socialmastery":
|
||||
setAttrdb(isActive, debug, timer, value, attrdb, attrIDs, rowID, sourceAttr, attribute, setObj);
|
||||
setActiveAttribute(isActive, debug, timer, value, rowID, attrdb, setObj, attribute, level);
|
||||
break;
|
||||
case "superstrength":
|
||||
setAttrdb(isActive, debug, timer, value, attrdb, attrIDs, rowID, sourceAttr, attribute, setObj);
|
||||
setTotalLift(debug, timer, attrdb, value, setObj);
|
||||
setActiveAttribute(isActive, debug, timer, value, rowID, attrdb, setObj, attribute, level);
|
||||
break;
|
||||
case "swarm":
|
||||
@@ -12098,19 +12262,23 @@
|
||||
clog(debug, timer, 'setDamageType', setDamageType,'setDamageType()');
|
||||
}
|
||||
|
||||
function getCV(debug, timer, value, attrdb, setObj, sourceAttr, type, focus = 'unarmed', invertState = false) {
|
||||
function getCV(debug, timer, value, attrdb, setObj, type, focus = 'unarmed') {
|
||||
clog(debug, timer, 'focus =', focus, 'getCV()');
|
||||
const mastery =
|
||||
(type == 'acv') ? getSumOfActiveAttrLevels(attrdb, 'attackmastery') :
|
||||
(type == 'dcv') ? getSumOfActiveAttrLevels(attrdb, 'defensemastery') :
|
||||
0;
|
||||
clog(debug, timer, 'mastery =', mastery);
|
||||
const isMelee =
|
||||
getIsMelee(debug, timer, focus);
|
||||
clog(debug, timer, 'isMelee =', isMelee);
|
||||
const specialty =
|
||||
(isMelee && type == 'acv') ? getSumOfActiveAttrLevels(attrdb, 'meleeattack', focus) * 2 :
|
||||
(isMelee && type == 'dcv') ? getSumOfActiveAttrLevels(attrdb, 'meleedefense', focus) * 2 :
|
||||
(!isMelee && type == 'acv') ? getSumOfActiveAttrLevels(attrdb, 'rangedattack', focus) * 2 :
|
||||
(!isMelee && type == 'dcv') ? getSumOfActiveAttrLevels(attrdb, 'rangeddefense', focus) * 2 :
|
||||
0;
|
||||
clog(debug, timer, 'specialty =', specialty);
|
||||
const state =
|
||||
(type == 'acv') ?
|
||||
isNaN(parseInt(setObj.static_button_targeted_attack)) ?
|
||||
@@ -12121,25 +12289,36 @@
|
||||
parseInt(value.static_button_targeted_defense) :
|
||||
parseInt(setObj.static_button_targeted_defense) :
|
||||
0;
|
||||
clog(debug, timer, 'state =', state);
|
||||
const enemy =
|
||||
(type == 'acv') ? getTargetedLevel(attrdb, 'enemyattack') * 2 :
|
||||
(type == 'dcv') ? getTargetedLevel(attrdb, 'enemydefense') * 2 :
|
||||
(type == 'acv' && state) ?
|
||||
getTargetedLevel(attrdb, 'enemyattack') * 2 :
|
||||
(type == 'dcv' && state) ?
|
||||
getTargetedLevel(attrdb, 'enemydefense') * 2 :
|
||||
0;
|
||||
clog(debug, timer, 'enemy =', enemy);
|
||||
/*
|
||||
const targeted =
|
||||
(type == 'acv') ? (invertState && sourceAttr == 'attack') ? (state > 0) ?
|
||||
0 : enemy : (state > 0) ? enemy : 0 :
|
||||
(type == 'acv') ?
|
||||
(invertState && sourceAttr == 'attack') ?
|
||||
(state > 0) ?
|
||||
0 : enemy :
|
||||
(state > 0) ?
|
||||
enemy : 0 :
|
||||
(type == 'dcv') ? (invertState && sourceAttr == 'defense') ? (state > 0) ?
|
||||
0 : enemy : (state > 0) ? enemy : 0 :
|
||||
0;
|
||||
*/
|
||||
const cv =
|
||||
Math.round((parseInt(setObj.stat_total_body) + parseInt(setObj.stat_total_mind) +
|
||||
parseInt(setObj.stat_total_soul)) / 3) ||
|
||||
Math.round((parseInt(value.stat_total_body) + parseInt(value.stat_total_mind) +
|
||||
parseInt(value.stat_total_soul)) / 3) ||
|
||||
0;
|
||||
clog(debug, timer, 'cv =', cv);
|
||||
const result =
|
||||
cv + targeted + specialty + mastery;
|
||||
clog(debug, timer, 'result =', result, 'getCV()');
|
||||
cv + enemy + specialty + mastery;
|
||||
clog(debug, timer, 'result =', result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -12313,7 +12492,7 @@
|
||||
} else if (rowID.length === 20) {//weapon unarmed, save ammo state
|
||||
//const ammostate = parseInt(value.weapon_ammo_reloads);
|
||||
//const capacitystate = parseInt(value.weapon_ammo_capacity);
|
||||
clog(debug, timer, 'weapon unarmed, save ammo state', handsource);
|
||||
clog(debug, timer, 'weapon unarmed, save ammo state', '');
|
||||
writeValues(debug, timer, value, `repeating_attr_${rowID}_ammostate`, ammostate, setObj);
|
||||
writeValues(debug, timer, value, `repeating_attr_${rowID}_capacitystate`, capacitystate, setObj);
|
||||
}
|
||||
@@ -12873,9 +13052,9 @@
|
||||
const targetedmdLevel =
|
||||
getTargetedLevel(attrdb, 'massivedamage') || 0;
|
||||
const targetedmd =
|
||||
invertState && sourceAttr == 'damage' ?
|
||||
targetedmdState > 0 ? 0 : targetedmdLevel :
|
||||
targetedmdState > 0 ? targetedmdLevel : 0;
|
||||
//invertState && sourceAttr == 'damage' ?
|
||||
//targetedmdState > 0 ? 0 : targetedmdLevel :
|
||||
targetedmdState ? targetedmdLevel : 0;
|
||||
const rushattackState =
|
||||
isNaN(parseInt(setObj.static_button_targeted_rushdamage)) ?
|
||||
parseInt(value.static_button_targeted_rushdamage) :
|
||||
@@ -12911,11 +13090,11 @@
|
||||
const acv =
|
||||
attack_maneuvers_regex.test(maneuver) ?
|
||||
isSwarm ? parseInt(weapon.level) + 4 :
|
||||
getCV(debug, timer, value, attrdb, setObj, sourceAttr, 'acv', weaponclass) : 0;
|
||||
getCV(debug, timer, value, attrdb, setObj, 'acv', weaponclass) : 0;
|
||||
const dcv =
|
||||
defense_maneuvers_regex.test(maneuver) ?
|
||||
isSwarm ? 0 :
|
||||
getCV(debug, timer, value, attrdb, setObj, sourceAttr, 'dcv', weaponclass) : 0;
|
||||
getCV(debug, timer, value, attrdb, setObj, 'dcv', weaponclass) : 0;
|
||||
let damage = isSwarm ?
|
||||
Math.round(weapon.critters/10) :
|
||||
isTelekinesis ?
|
||||
@@ -13147,7 +13326,7 @@
|
||||
clog(debug, timer, 'result =', result, 'setCombatRoll()');
|
||||
setObj.maneuverroll = result;
|
||||
}
|
||||
|
||||
/*
|
||||
function setSizeTemplate(value, sizetempateIDs, rowID, setObj) {
|
||||
_.each(sizetempateIDs, templateID => {
|
||||
if (templateID!=rowID) setObj[`repeating_sizetemplate_${templateID}_selection`] = 0;
|
||||
@@ -13162,7 +13341,7 @@
|
||||
setObj.size_rnghitdef = value[`repeating_sizetemplate_${rowID}_rnghitdef`];
|
||||
setObj.size_rngspd = value[`repeating_sizetemplate_${rowID}_rngspd`];
|
||||
}
|
||||
|
||||
*/
|
||||
function writeHiddenDamageAttributes(sheetdb) {
|
||||
var damage = [];
|
||||
for (let i = 2; i == 12; i++) {
|
||||
@@ -13208,11 +13387,13 @@
|
||||
rowID=='movement' ? 'personal':
|
||||
'';
|
||||
//setObj[`${source}_${attribute}`] = state;
|
||||
clog(debug, timer, 'attribute =', attribute, 'setButtonState()');
|
||||
writeValues(debug, timer, value, `${source}_${attribute}`, state, setObj)
|
||||
setObj[`${source}_activatetheme`] = theme;
|
||||
clog(debug, timer, 'state =', state, 'setButtonState()');
|
||||
//writeValues(debug, timer, value, `${source}_activatetheme`, theme, setObj)
|
||||
if(counterdefense.length>0) {
|
||||
setObj[`static_button_${counterdefense}_defense`] = counterstate;
|
||||
//writeValues(debug, timer, value, `static_button_${counterdefense}_defense`, counterstate, setObj)
|
||||
clog(debug, timer, `${counterdefense} =`, counterstate);
|
||||
}
|
||||
return state;
|
||||
@@ -13228,8 +13409,9 @@
|
||||
}
|
||||
|
||||
function getHandSource(debug, timer, extraarmIDs, rowID){
|
||||
const handsource = /(mainhand|offhand)/i.test(rowID) ?
|
||||
rowID : `repeating_extraarm_${rowID}`;
|
||||
const handsource = /(mainhand|offhand)/i.test(rowID) ? rowID :
|
||||
extraarmIDs !== undefined ? extraarmIDs.indexOf(rowID) !== -1 ?
|
||||
`repeating_extraarm_${rowID}` : '' : '';
|
||||
const handscheck = handsource !== '' ? handsource.indexOf(',') > 0 ?
|
||||
handsource.split(',') : handsource : false;
|
||||
const result = handscheck !== false ? _.isArray(handscheck) ?
|
||||
@@ -13429,7 +13611,7 @@
|
||||
}
|
||||
|
||||
function recordSheetChanges(timer, eventInfo, value, setObj) {
|
||||
const sheet_change_array = ['show_debug_messages','weapon_ammo_reloads','weapon_ammo_capacity'];
|
||||
const sheet_change_array = ['show_debug_messages','weapon_ammo_reloads','weapon_ammo_capacity','theme'];
|
||||
const recordChange = sheet_change_array.indexOf(eventInfo.sourceAttribute) !== -1 ?
|
||||
true : false;
|
||||
if (recordChange) {
|
||||
@@ -13612,6 +13794,8 @@
|
||||
|
||||
function registerEvents() {
|
||||
const eventsToRegister = [
|
||||
"theme",
|
||||
"static_template_size_selection",
|
||||
"static_rules_deplete_alt",
|
||||
"weapon_ammo_reloads",
|
||||
"weapon_ammo_capacity",
|
||||
@@ -13630,7 +13814,7 @@
|
||||
"static_stat_total_shame",
|
||||
"repeating_attr",
|
||||
"repeating_skill",
|
||||
"repeating_sizetemplate",
|
||||
//"repeating_sizetemplate",
|
||||
"static_stat_base_body",
|
||||
"static_stat_base_mind",
|
||||
"static_stat_base_soul",
|
||||
@@ -13695,22 +13879,26 @@
|
||||
|
||||
const events = `change:${registerEvents()} clicked:${registerActions()} remove:${registerRemoved()}`;
|
||||
const buttons = [
|
||||
"attrgroup1",
|
||||
"attrgroup2",
|
||||
"attrgroup3",
|
||||
"attrgroup4",
|
||||
"attrgroup5",
|
||||
"attrgroup6",
|
||||
"attrgroup7",
|
||||
"attrgroup8",
|
||||
"attrgroup9",
|
||||
"attrgroup10",
|
||||
"skillgroup1",
|
||||
"skillgroup2",
|
||||
"skillgroup3",
|
||||
"skillgroup4",
|
||||
"skillgroup5",
|
||||
];
|
||||
"attrgroup1",
|
||||
"attrgroup2",
|
||||
"attrgroup3",
|
||||
"attrgroup4",
|
||||
"attrgroup5",
|
||||
"attrgroup6",
|
||||
"attrgroup7",
|
||||
"attrgroup8",
|
||||
"attrgroup9",
|
||||
"attrgroup10",
|
||||
"skillgroup1",
|
||||
"skillgroup2",
|
||||
"skillgroup3",
|
||||
"skillgroup4",
|
||||
"skillgroup5",
|
||||
];
|
||||
|
||||
const sizeTemplateVariables = _.map(size_template_keys_array, key => {
|
||||
return `static_template_size_${key}`;
|
||||
});
|
||||
|
||||
on("sheet:opened", () => {
|
||||
|
||||
@@ -13729,6 +13917,8 @@
|
||||
clog(3, timer, `Fetched extra arm IDs (${extraarmIDs.length} total)`, '');
|
||||
getSectionIDs('skilltemplate', skilltempIDs => {
|
||||
clog(3, timer, `Fetched skill template IDs (${skilltempIDs.length} total)`, '');
|
||||
getSectionIDs('sizetemplate', sizetemplateIDs => {
|
||||
clog(3, timer, `Fetched size template IDs (${sizetemplateIDs.length} total)`, '');
|
||||
const skilltemp_names_array = _.map(skilltempIDs, id => {
|
||||
return `repeating_skilltemplate_${id}_label`;
|
||||
});
|
||||
@@ -13746,6 +13936,7 @@
|
||||
getAttrsString = getAttrsString.concat(buildRepeatingExtraArmValuesArray(extraarmIDs));
|
||||
getAttrsString = getAttrsString.concat(stats_array);
|
||||
getAttrsString = getAttrsString.concat(rolls_array);
|
||||
getAttrsString = getAttrsString.concat(sizeTemplateVariables);
|
||||
getAttrsString = getAttrsString.concat([
|
||||
'show_debug_messages',
|
||||
'theme',
|
||||
@@ -13777,7 +13968,8 @@
|
||||
clog(3, timer, 'value:', value);
|
||||
|
||||
if (value.global_initialized != 1) {
|
||||
buildSizeUI(global_templates_size_names, setObj);
|
||||
//buildSizeUI(global_templates_size_names, setObj);
|
||||
//setDefaultSize(sheetdb, setObj);
|
||||
buildSkillsUI(value, setObj, sheetdb);
|
||||
writeHiddenDamageAttributes(sheetdb);
|
||||
createAttrdbJSON(setObj);
|
||||
@@ -13785,7 +13977,7 @@
|
||||
setObj.stat_total_body = '0';
|
||||
setObj.stat_total_mind = '0';
|
||||
setObj.stat_total_soul = '0';
|
||||
doUpgrade(value, attrIDs, setObj);
|
||||
doUpgrade(value, sheetdb, attrIDs, sizetemplateIDs, setObj);
|
||||
}else{
|
||||
const skillmap = _.chain(skilltempIDs)
|
||||
.map( id => {
|
||||
@@ -13794,7 +13986,7 @@
|
||||
.compact()
|
||||
.value();
|
||||
sheetdb.skillmap = skillmap;
|
||||
doUpgrade(value, attrIDs, setObj);
|
||||
doUpgrade(value, sheetdb, attrIDs, sizetemplateIDs, setObj);
|
||||
}
|
||||
setObj.sheetdb = JSON.stringify(sheetdb);
|
||||
clog(3, timer, 'Ready to write setObj to cache:', setObj, 'setAttrs()');
|
||||
@@ -13805,6 +13997,7 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:attrgroup1 clicked:attrgroup2 clicked:attrgroup3 clicked:attrgroup4 clicked:attrgroup5 clicked:attrgroup6 clicked:attrgroup7 clicked:attrgroup8 clicked:attrgroup9 clicked:attrgroup10 clicked:skillgroup1 clicked:skillgroup2 clicked:skillgroup3 clicked:skillgroup4 clicked:skillgroup5", (eventInfo) => {
|
||||
@@ -13972,6 +14165,7 @@
|
||||
}
|
||||
setGroupDefectPointsOnActivation(debug, timer, attrIDs, attrdb, value, sectionName, rowID, setObj);
|
||||
setDepleteResurvation(debug, timer, attrdb, value, rowID, setObj);
|
||||
setTotalLift(debug, timer, attrdb, value, setObj);
|
||||
break;
|
||||
case `lock`:
|
||||
if (resetOnActive(debug, timer, eventInfo, value, match, rowID, setObj)) return;
|
||||
@@ -14057,6 +14251,7 @@
|
||||
break;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
case `sizetemplate`:
|
||||
if (eventInfo.newValue == "0" ||
|
||||
getIsSheetworker(eventInfo.sourceType)) {
|
||||
@@ -14064,6 +14259,7 @@
|
||||
}
|
||||
setSizeTemplate(value, sizetempateIDs, rowID, setObj);
|
||||
break;
|
||||
*/
|
||||
}
|
||||
persistCache(value, attrdb, attrIDs, skillIDs, extraarmIDs, skillmap);
|
||||
clog(debug, timer, 'setObj:', setObj, 'Changes To Sheet Values', 'info');
|
||||
@@ -14114,6 +14310,7 @@
|
||||
setTotalShock(debug, timer, value, attrdb, setObj);
|
||||
setTotalMovement(debug, timer, value, attrdb, setObj);
|
||||
updateSkillRolls(debug, timer, value, skillIDs, sourceAttr, setObj);
|
||||
setTotalLift(debug, timer, attrdb, value, setObj);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -14134,12 +14331,14 @@
|
||||
break;
|
||||
case `button`:
|
||||
if (rowID == 'targeted') {
|
||||
const rolltype = selection =>
|
||||
selection == 'acv' || selection == 'dcv' ?
|
||||
setDynamicRollValue(debug, timer, eventInfo, value, attrdb, rowID, sourceAttr, setObj) :
|
||||
false;
|
||||
rolltype(value.static_roll_type_selection);
|
||||
setButtonState(debug, timer, value, source, rowID, sourceAttr, setObj);
|
||||
if (sourceAttr === "attack" || sourceAttr === 'defense') {
|
||||
const rolltype = selection =>
|
||||
selection == 'acv' || selection == 'dcv' ?
|
||||
setDynamicRollValue(debug, timer, eventInfo, value, attrdb, rowID, sourceAttr, setObj) :
|
||||
false;
|
||||
rolltype(value.static_roll_type_selection);
|
||||
}
|
||||
setCombatRoll(debug, timer, value, attrdb, undefined, sourceAttr, setObj, true);
|
||||
}
|
||||
if (rowID == 'personal' || rowID == 'movement') {
|
||||
@@ -14170,6 +14369,10 @@
|
||||
case 'rules':
|
||||
setDepleteRules(debug, timer, value, attrIDs, setObj);
|
||||
break;
|
||||
case 'template':
|
||||
setSizeTemplate(debug, timer, eventInfo, value, setObj);
|
||||
setTotalLift(debug, timer, attrdb, value, setObj);
|
||||
break;
|
||||
}
|
||||
persistCache(value, attrdb, attrIDs, skillIDs, extraarmIDs, skillmap);
|
||||
clog(debug, timer, 'setObj:', setObj, 'Changes To Sheet Values', 'info');
|
||||
|
||||
Reference in New Issue
Block a user