Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Audrey | d1f497916e | |
audrey | 04cff9e613 | |
dot_sent | e83a16c084 | |
Dotsent | c0c522c494 | |
audrey | b3d49a9805 | |
Dotsent | 9f7aaf7cde |
|
@ -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-rc3
|
||||
// ==/UserScript==
|
||||
|
||||
"use strict";
|
||||
|
@ -46,6 +46,33 @@ function display_items_total_value() {
|
|||
items_total_value_displayed = true;
|
||||
}
|
||||
|
||||
function update_third_tier_counts() {
|
||||
const t3_qualities = {
|
||||
'0' : { id: '525', src: '//images.fallenlondon.com/icons/bookpurplesmall.png' }, // Journal of Infamy
|
||||
'1' : { id: '932', src: '//images.fallenlondon.com/icons/scrawl1small.png' }, // Correspondence Plaque
|
||||
'2' : { id: '827', src: '//images.fallenlondon.com/icons/sunsetsmall.png' }, // Vision of the Surface
|
||||
'3' : { id: '587', src: '//images.fallenlondon.com/icons/mountainglowsmall.png' }, // Mystery of the Elder Continent
|
||||
'4' : { id: '659', src: '//images.fallenlondon.com/icons/conversationsmall.png' }, // Scrap of Incendiary Gossip
|
||||
'5' : { id: '825', src: '//images.fallenlondon.com/icons/wakesmall.png' }, // Memory of Distant Shores
|
||||
'6' : { id: '668', src: '//images.fallenlondon.com/icons/bottledsoulbluesmall.png' }, // Brilliant Soul
|
||||
'7' : { id: '828', src: '//images.fallenlondon.com/icons/scaryeyesmall.png' }, // A Tale of Terror!!
|
||||
'8' : { id: '830', src: '//images.fallenlondon.com/icons/papers3small.png' }, // Compromising Document
|
||||
'9' : { id: '589', src: '//images.fallenlondon.com/icons/mirrorsmall.png' }, // Memory of Light
|
||||
'A' : { id: '831', src: '//images.fallenlondon.com/icons/waves3small.png' }, // Zee-Ztory
|
||||
'B' : { id: '822', src: '//images.fallenlondon.com/icons/bottlewillowsmall.png' }, // Bottle of Stranngling Willow Absinthe
|
||||
'C' : { id: '915', src: '//images.fallenlondon.com/icons/scrap2small.png' }, // Whisper-Satin Scrap
|
||||
};
|
||||
$('div#FLE-ccc').remove();
|
||||
let html = '<div id="FLE-ccc" style="text-align:left;">';
|
||||
$.each(t3_qualities, function(order, quality) {
|
||||
let quality_id = quality.id;
|
||||
let image_src = quality.src;
|
||||
let elem = $('div [data-quality-id="' + quality_id + '"]');
|
||||
let quantity = elem.length == 1 ? elem.find('.js-item-value').html() : 0;
|
||||
html += '<div class="icon icon--inventory" style="margin:1px; margin-bottom:5px;"><img src="' + image_src + '"><span class="icon__value" style="font-size:12px; bottom:-7px; right:-7px; padding:1px 3px; background-color: ' + (quantity > 49 ? '#457c46' : 'black') + ';">' + quantity + '</span></div>';
|
||||
});
|
||||
$(html + '</div>').insertAfter('div#FLE-quirks');
|
||||
}
|
||||
|
||||
////////////
|
||||
// MYSELF //
|
||||
|
@ -157,6 +184,7 @@ function possessions() {
|
|||
update_advantage_bar();
|
||||
update_quirks_bar();
|
||||
update_contacts_bar();
|
||||
update_third_tier_counts();
|
||||
}
|
||||
|
||||
|
||||
|
@ -203,12 +231,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() + '<span style="color:grey; font-size:75%;">' + points + ' (' + lvl_pts + '+' + CP + '/' + target + ')</span>' );
|
||||
|
@ -217,7 +251,7 @@ function display_stats_progress() {
|
|||
|
||||
function common() {
|
||||
// Remove the FL banner to avoid useless scrolling
|
||||
cleanup();
|
||||
// cleanup();
|
||||
|
||||
// Display CP and number of points required for the next level near the progress bar
|
||||
display_stats_progress();
|
||||
|
|
Loading…
Reference in New Issue