UD Scale

Betrays the weight of things

Stan na 11-11-2014. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

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

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name		UD Scale
// @namespace		http://www.cursedtower.com/dem
// @version		1.0
// @description		Betrays the weight of things
// @include		http://urbandead.com/*
// @include		http://www.urbandead.com/*
// @grant      
// ==/UserScript==

/* Urban Dead Scale
 * v1.0
 *
 * Copyright (C) 2014 Dr Heward
 * Author: Elaine M Heward (MEMS) aka Ayelis
 * Last Modified: 2014-04-27
 * 
 * Tested under: Firefox 28 on Windows
 *   
 * Changes:
 *   v1.0 - Now works in Firefox
 *
 */

var drops = document.evaluate("//select[@name='drop']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

for(var i=0;i<drops.snapshotLength;i++){
    drop = drops.snapshotItem(i);
    for(j=0;j<drop.options.length;j++){
        if(drop.options[j].value!="")
           drop.options[j].text=drop.options[j].text+" - "+getWeight(drop.options[j].value)+"%";
    }
}

function getWeight(item){
    switch(item.substring(0,1)){
        case "a": case "c": case "e": case "f":
        case "g": case "h": case "j": case "k":
        case "l": case "m": case "n": case "r":
        case "t": case "x": case "y": case "z":
            val=2;
            break;
        case "b": case "B": case "d": case "D":
        case "F": case "p": case "q": case "u":
        case "w":
            val=4;
            break;
        case "o": case "s":
            val=6;
            break;
        case "i":
            val=10;
            break;
        default:
       switch(item){
        case "G6":
               val=0;
               break;
        case "J1":
               val=16;
               break;
        case "G2": case "G3": case "G4": case "J2":
               val=2;
               break;
        case "I39":
               val=6;
               break;
           default:
               val=20;
       }
    }
    return val;
}