Greasy Fork 还支持 简体中文。

Torn: Show Experience

Show weapon experience number & hits required for 100% exp rather than progress bar

اعتبارا من 12-08-2020. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Torn: Show Experience
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Show weapon experience number & hits required for 100% exp rather than progress bar 
// @author       Untouchable [1360035]
// @match        https://www.torn.com/item.php
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let primary = $('.experience-wrap')[0].title,
        secondary = $('.experience-wrap')[1].title,
        melee = $('.experience-wrap')[2].title,
        temporary = $('.experience-wrap')[3].title;

    $('.experience-wrap')[0].innerHTML = '<span class="na t-gray-9">' + getExpAndHits(primary) + '</span>';
    $('.experience-wrap')[1].innerHTML = '<span class="na t-gray-9">' + getExpAndHits(secondary) + '</span>';
    $('.experience-wrap')[2].innerHTML = '<span class="na t-gray-9">' + getExpAndHits(melee) + '</span>';
    $('.experience-wrap')[3].innerHTML = '<span class="na t-gray-9">' + getExpAndHits(temporary) + '</span>';

})();


function getExpAndHits(experience){

   let hits,
       exp = parseInt(experience.replace("%",""));

    if(exp < 25){
      hits = (25 - exp) * 8 + 1800;
    } else if (exp >= 25 && exp < 50){
        hits = (50 - exp) * 12 + 1500
    } else if (exp >= 50 && exp <75) {
        hits = (75 - exp) * 20 + 1000;
    } else {
        hits = (100 - exp) * 40;
    }

    return experience + " (" + hits + ")";

}