From 9f7aaf7cdeede55cf0ea82c3be8dc37ab5a3c73c Mon Sep 17 00:00:00 2001 From: Dotsent Date: Thu, 16 Sep 2021 15:40:06 +0200 Subject: [PATCH] Limit capped qualities to max. 70 CP --- FL_enhancer.user.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/FL_enhancer.user.js b/FL_enhancer.user.js index 2a409ee..da09bf4 100644 --- a/FL_enhancer.user.js +++ b/FL_enhancer.user.js @@ -8,7 +8,7 @@ // @name FallenLondon Enhancer // @namespace https://forge.chapril.org/audrey/ // @require https://forge.chapril.org/audrey/fallen_london_scripts/raw/branch/master/jquery/jquery-3.6.0.min.js -// @version 0.1-rc1 +// @version 0.1-rc2 // ==/UserScript== "use strict"; @@ -203,12 +203,18 @@ function cleanup() { } function display_stats_progress() { + const capped_qualities = ["Dangerous", "Persuasive", "Shadowy", "Watchful"]; $('ul.items--list li.sidebar-quality').each( function( index, element ){ bar = $( this ).find('div.progress-bar'); percent = bar.find('span').prop('style').width.slice(0, -1); lvl = Number($( this ).find('span.item__value').text()); + quality = $( this ).find('span.item__name').text(); target = lvl + 1; lvl_pts = Math.round(lvl * target / 2); + if (capped_qualities.includes(quality) && target > 70) { + target = 70; + lvl_pts = 2485 + (lvl-70) * 70; + } CP = Math.round(target * percent / 100); points = Math.round(lvl_pts + CP); bar.html( bar.html() + '' + points + ' (' + lvl_pts + '+' + CP + '/' + target + ')' );