MediaWiki:Common.js: Różnice pomiędzy wersjami
m |
m |
||
Linia 247: | Linia 247: | ||
* @autor Kembix | * @autor Kembix | ||
*/ | */ | ||
− | document.getElementById(" | + | document.getElementById("calcbody").innerHTML = '<table><tr><td>Poziom:</td> <td><input id="level" maxlength="3" size="4" type="text"></td></tr><tr><td>Siła:</td> <td><input id="sila" maxlength="3" size="4" type="text"></td></tr><tr><td>Witalność:</td> <td><input id="wit" maxlength="3" size="4" type="text"></td></tr><tr><td>Inteligencja:</td> <td><input id="int" maxlength="3" size="4" type="text"></td></tr><tr><td>Zręczność:</td> <td><input id="zre" maxlength="3" size="4" type="text"></td></tr><tr><td>Minimalna Wartość Ataku:</td> <td><input id="min" maxlength="3" size="4" type="text"></td></tr><tr><td>Maksymalna Wartość Ataku:</td> <td><input id="max" maxlength="4" size="4" type="text"></td></tr><tr><td>Aura Miecza:</td> <td><input id="aura" maxlength="3" size="4" type="text"></td></tr><tr><td>Berserk:</td> <td><input id="berserk" maxlength="3" size="4" type="text"></td></tr><tr><td>Szarża:</td> <td><input id="szarza" maxlength="3" size="4" type="text"></td></tr><tr><td>Trzystronne Cięcie:</td> <td><input id="trzystronne" maxlength="3" size="4" type="text"></td></tr><tr><td>Wir Miecza:</td> <td><input id="wir" maxlength="3" size="4" type="text"></td></tr></table><input type="submit" onclick="skill()" value="Pokaż">'; |
function skill() { | function skill() { | ||
Linia 909: | Linia 909: | ||
var uwaga = "<br><br><b>Uwaga! Podane wartości mogą się różnić od wartości podanych w grze</b>"; | var uwaga = "<br><br><b>Uwaga! Podane wartości mogą się różnić od wartości podanych w grze</b>"; | ||
if(level.value != "") | if(level.value != "") | ||
− | document.getElementById(" | + | document.getElementById("skillbody").innerHTML ='<table border="1"><tr><td>Nazwa</td><td>Efekt</td><td>Czas Trwania</td><td>Czas Ładowania</td><td>Koszt PE</td></tr>' + AuraWynik + BerserkWynik + SzarzaWynik + trzystronneWynik + wirWynik + '</table>' + uwaga |
else | else | ||
− | document.getElementById(" | + | document.getElementById("skillbody").innerHTML ="Aura Miecza: ?<br>Berserk: ?<br>Szarża: ?<br>Trzystronne Cięcie: ?<br>Wir Miecza: ?" + uwaga |
} | } | ||
// Kalkulator | // Kalkulator |
Wersja z 16:12, 13 gru 2012
// Tekst udostępniany na licencji Creative Commons: uznanie autorstwa, na tych samych warunkach
// <pre>
/* Test if an element has a certain class **************************************
*
* Description: Uses regular expressions and caching for better performance.
* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
*/
var hasClass = (function () {
var reCache = {};
return function (element, className) {
return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
};
})();
/** Collapsible tables *********************************************************
*
* Description: Allows tables to be collapsed, showing only the header. See
* [[en:Wikipedia:NavFrame]].
* Maintainers: [[User:R. Koot]]
*/
var autoCollapse = 2;
var collapseCaption = "ukryj";
var expandCaption = "pokaż";
function collapseTable( tableIndex )
{
var Button = document.getElementById( "collapseButton" + tableIndex );
var Table = document.getElementById( "collapsibleTable" + tableIndex );
if ( !Table || !Button ) {
return false;
}
var Rows = Table.rows;
if ( Button.firstChild.data == collapseCaption ) {
for ( var i = 1; i < Rows.length; i++ ) {
Rows[i].style.display = "none";
}
Button.firstChild.data = expandCaption;
} else {
for ( var i = 1; i < Rows.length; i++ ) {
Rows[i].style.display = Rows[0].style.display;
}
Button.firstChild.data = collapseCaption;
}
}
function createCollapseButtons()
{
var tableIndex = 0;
var NavigationBoxes = new Object();
var Tables = document.getElementsByTagName( "table" );
for ( var i = 0; i < Tables.length; i++ ) {
if ( hasClass( Tables[i], "collapsible" ) ) {
/* only add button and increment count if there is a header row to work with */
var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
if (!HeaderRow) continue;
var Header = HeaderRow.getElementsByTagName( "th" )[0];
if (!Header) continue;
NavigationBoxes[ tableIndex ] = Tables[i];
Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
var Button = document.createElement( "span" );
var ButtonLink = document.createElement( "a" );
var ButtonText = document.createTextNode( collapseCaption );
Button.style.styleFloat = "right";
Button.style.cssFloat = "right";
Button.style.fontWeight = "normal";
Button.style.textAlign = "right";
Button.style.width = "6em";
ButtonLink.style.color = Header.style.color;
ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
ButtonLink.appendChild( ButtonText );
Button.appendChild( document.createTextNode( "[" ) );
Button.appendChild( ButtonLink );
Button.appendChild( document.createTextNode( "]" ) );
Header.insertBefore( Button, Header.childNodes[0] );
tableIndex++;
}
}
for ( var i = 0; i < tableIndex; i++ ) {
if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
collapseTable( i );
}
else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
var element = NavigationBoxes[i];
while (element = element.parentNode) {
if ( hasClass( element, "outercollapse" ) ) {
collapseTable ( i );
break;
}
}
}
}
}
$(document).ready( createCollapseButtons );
/** Dynamic Navigation Bars (experimental) *************************************
*
* Description: See [[Wikipedia:NavFrame]].
* Maintainers: UNMAINTAINED
*/
// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';
// shows and hides content and picture (if available) of navigation bars
// Parameters:
// indexNavigationBar: the index of navigation bar to be toggled
function toggleNavigationBar(indexNavigationBar)
{
var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);
if (!NavFrame || !NavToggle) {
return false;
}
// if shown now
if (NavToggle.firstChild.data == NavigationBarHide) {
for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
if ( hasClass( NavChild, 'NavPic' ) ) {
NavChild.style.display = 'none';
}
if ( hasClass( NavChild, 'NavContent') ) {
NavChild.style.display = 'none';
}
}
NavToggle.firstChild.data = NavigationBarShow;
// if hidden now
} else if (NavToggle.firstChild.data == NavigationBarShow) {
for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
if (hasClass(NavChild, 'NavPic')) {
NavChild.style.display = 'block';
}
if (hasClass(NavChild, 'NavContent')) {
NavChild.style.display = 'block';
}
}
NavToggle.firstChild.data = NavigationBarHide;
}
}
// adds show/hide-button to navigation bars
function createNavigationBarToggleButton()
{
var indexNavigationBar = 0;
// iterate over all < div >-elements
var divs = document.getElementsByTagName("div");
for (var i = 0; NavFrame = divs[i]; i++) {
// if found a navigation bar
if (hasClass(NavFrame, "NavFrame")) {
indexNavigationBar++;
var NavToggle = document.createElement("a");
NavToggle.className = 'NavToggle';
NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
var isCollapsed = hasClass( NavFrame, "collapsed" );
/*
* Check if any children are already hidden. This loop is here for backwards compatibility:
* the old way of making NavFrames start out collapsed was to manually add style="display:none"
* to all the NavPic/NavContent elements. Since this was bad for accessibility (no way to make
* the content visible without JavaScript support), the new recommended way is to add the class
* "collapsed" to the NavFrame itself, just like with collapsible tables.
*/
for (var NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling) {
if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
if ( NavChild.style.display == 'none' ) {
isCollapsed = true;
}
}
}
if (isCollapsed) {
for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
NavChild.style.display = 'none';
}
}
}
var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
NavToggle.appendChild(NavToggleText);
// Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
for(var j=0; j < NavFrame.childNodes.length; j++) {
if (hasClass(NavFrame.childNodes[j], "NavHead")) {
NavFrame.childNodes[j].appendChild(NavToggle);
}
}
NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
}
}
}
$(document).ready( createNavigationBarToggleButton );
// ukrycie paska narzędzi F11
document.onkeydown = function( e ) {
if( e == null ) e = event
if( testKey( e, 122 ) ) { //F11
appendCSS('#p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search, #p-navigation, #p-Community {display:none;} #p-cactions {left: .1em;} #footer {display:none;}');
return false;
}
else if( testKey( e, 113 ) ) { //F2
parent.location.href='http://wiki.metin2.pl/index.php?title=MediaWiki:Sitenotice&action=edit';
}
else if( testKey( e, 114 ) ) { //F3
parent.location.href='http://wiki.metin2.pl/index.php?title=Specjalna:Nieskategoryzowane_pliki&limit=500&offset=0';
}
else if( testKey( e, 115 ) ) { //F4
parent.location.href='http://wiki.metin2.pl/index.php/Specjalna:Potrzebne_strony';
}
else if( testKey( e, 117 ) ) { //F6
parent.location.href='http://wiki.metin2.pl/index.php?title=MediaWiki:Common.js&action=edit';
}
else if( testKey( e, 118 ) ) { //F7
parent.location.href='http://wiki.metin2.pl/index.php/Specjalna:Filtr_nadu%C5%BCy%C4%87';
}
}
function testKey( e, intKeyCode ) {
if( window.createPopup )
return e.keyCode == intKeyCode
else
return e.which == intKeyCode
}
/* Kalkulator
* @autor Kembix
*/
document.getElementById("calcbody").innerHTML = '<table><tr><td>Poziom:</td> <td><input id="level" maxlength="3" size="4" type="text"></td></tr><tr><td>Siła:</td> <td><input id="sila" maxlength="3" size="4" type="text"></td></tr><tr><td>Witalność:</td> <td><input id="wit" maxlength="3" size="4" type="text"></td></tr><tr><td>Inteligencja:</td> <td><input id="int" maxlength="3" size="4" type="text"></td></tr><tr><td>Zręczność:</td> <td><input id="zre" maxlength="3" size="4" type="text"></td></tr><tr><td>Minimalna Wartość Ataku:</td> <td><input id="min" maxlength="3" size="4" type="text"></td></tr><tr><td>Maksymalna Wartość Ataku:</td> <td><input id="max" maxlength="4" size="4" type="text"></td></tr><tr><td>Aura Miecza:</td> <td><input id="aura" maxlength="3" size="4" type="text"></td></tr><tr><td>Berserk:</td> <td><input id="berserk" maxlength="3" size="4" type="text"></td></tr><tr><td>Szarża:</td> <td><input id="szarza" maxlength="3" size="4" type="text"></td></tr><tr><td>Trzystronne Cięcie:</td> <td><input id="trzystronne" maxlength="3" size="4" type="text"></td></tr><tr><td>Wir Miecza:</td> <td><input id="wir" maxlength="3" size="4" type="text"></td></tr></table><input type="submit" onclick="skill()" value="Pokaż">';
function skill() {
var sila = document.getElementById('sila');
var zre = document.getElementById('zre');
var wit = document.getElementById('wit');
var int = document.getElementById('int');
var level = document.getElementById('level');
var min = document.getElementById('min');
var max = document.getElementById('max');
var aura = document.getElementById('aura');
if((aura.value >= 1 && aura.value <= 20) || aura.value == "M1" || aura.value == "M2" || aura.value == "M3" || aura.value == "M4" || aura.value == "M5" || aura.value == "M6" || aura.value == "M7" || aura.value == "M8" || aura.value == "M9" || aura.value == "M10" || aura.value == "G1" || aura.value == "G2" || aura.value == "G3" || aura.value == "G4" || aura.value == "G5" || aura.value == "G6" || aura.value == "G7" || aura.value == "G8" || aura.value == "G9" || aura.value == "G10" || aura.value == "P" ) {
if (aura.value == "1") {
var AuraPoint = 0.05;
}
else if (aura.value == "2") {
var AuraPoint = 0.06;
}
else if (aura.value == "3") {
var AuraPoint = 0.08;
}
else if (aura.value == "4") {
var AuraPoint = 0.1;
}
else if (aura.value == "5") {
var AuraPoint = 0.12;
}
else if (aura.value == "6") {
var AuraPoint = 0.14;
}
else if (aura.value == "7") {
var AuraPoint = 0.16;
}
else if (aura.value == "8") {
var AuraPoint = 0.18;
}
else if (aura.value == "9") {
var AuraPoint = 0.2;
}
else if (aura.value == "10") {
var AuraPoint = 0.22;
}
else if (aura.value == "11") {
var AuraPoint = 0.24;
}
else if (aura.value == "12") {
var AuraPoint = 0.26;
}
else if (aura.value == "13") {
var AuraPoint = 0.28;
}
else if (aura.value == "14") {
var AuraPoint = 0.3;
}
else if (aura.value == "15") {
var AuraPoint = 0.32;
}
else if (aura.value == "16") {
var AuraPoint = 0.34;
}
else if (aura.value == "17") {
var AuraPoint = 0.36;
}
else if (aura.value == "18") {
var AuraPoint = 0.38;
}
else if (aura.value == "19") {
var AuraPoint = 0.4;
}
else if (aura.value == "20") {
var AuraPoint = 0.5;
}
else if (aura.value == "M1") {
var AuraPoint = 0.5;
}
else if (aura.value == "M2") {
var AuraPoint = 0.52;
}
else if (aura.value == "M3") {
var AuraPoint = 0.54;
}
else if (aura.value == "M4") {
var AuraPoint = 0.56;
}
else if (aura.value == "M5") {
var AuraPoint = 0.58;
}
else if (aura.value == "M6") {
var AuraPoint = 0.6;
}
else if (aura.value == "M7") {
var AuraPoint = 0.63;
}
else if (aura.value == "M8") {
var AuraPoint = 0.66;
}
else if (aura.value == "M9") {
var AuraPoint = 0.69;
}
else if (aura.value == "M10") {
var AuraPoint = 0.72;
}
else if (aura.value == "G1") {
var AuraPoint = 0.82;
}
else if (aura.value == "G2") {
var AuraPoint = 0.85;
}
else if (aura.value == "G3") {
var AuraPoint = 0.88;
}
else if (aura.value == "G4") {
var AuraPoint = 0.91;
}
else if (aura.value == "G5") {
var AuraPoint = 0.94;
}
else if (aura.value == "G6") {
var AuraPoint = 0.98;
}
else if (aura.value == "G7") {
var AuraPoint = 1.02;
}
else if (aura.value == "G8") {
var AuraPoint = 1.06;
}
else if (aura.value == "G9") {
var AuraPoint = 1.1;
}
else if (aura.value == "G10") {
var AuraPoint = 1.15;
}
else if (aura.value == "P") {
var AuraPoint = 1.25;
}
var AuraWynik = "<tr><td>Aura Miecza</td><td>Siła Ataku: +" + Math.floor(( parseInt(sila.value) + 100 + parseInt(level.value * 3)) * parseFloat(AuraPoint)) + "</td><td>" + Math.floor(30 +(50 * AuraPoint)) + "s</td><td>" + Math.floor(33 +(50 * AuraPoint)) + "s</td><td>" + Math.floor(100+(200 * AuraPoint)) + "PE</td></tr>";
}
else {
var AuraWynik = "<tr><td>Aura Miecza</td><td>Siła Ataku: +?</td><td>?</td><td>?</td><td>?</td></tr>";
}
var berserk = document.getElementById('berserk');
if((berserk.value >= 1 && berserk.value <= 20) || berserk.value == "M1" || berserk.value == "M2" || berserk.value == "M3" || berserk.value == "M4" || berserk.value == "M5" || berserk.value == "M6" || berserk.value == "M7" || berserk.value == "M8" || berserk.value == "M9" || berserk.value == "M10" || berserk.value == "G1" || berserk.value == "G2" || berserk.value == "G3" || berserk.value == "G4" || berserk.value == "G5" || berserk.value == "G6" || berserk.value == "G7" || berserk.value == "G8" || berserk.value == "G9" || berserk.value == "G10" || berserk.value == "P" ) {
if (berserk.value == "1") {
var BerserkPoint = 0.05;
}
else if (berserk.value == "2") {
var BerserkPoint = 0.06;
}
else if (berserk.value == "3") {
var BerserkPoint = 0.08;
}
else if (berserk.value == "4") {
var BerserkPoint = 0.1;
}
else if (berserk.value == "5") {
var BerserkPoint = 0.12;
}
else if (berserk.value == "6") {
var BerserkPoint = 0.14;
}
else if (berserk.value == "7") {
var BerserkPoint = 0.16;
}
else if (berserk.value == "8") {
var BerserkPoint = 0.18;
}
else if (berserk.value == "9") {
var BerserkPoint = 0.2;
}
else if (berserk.value == "10") {
var BerserkPoint = 0.22;
}
else if (berserk.value == "11") {
var BerserkPoint = 0.24;
}
else if (berserk.value == "12") {
var BerserkPoint = 0.26;
}
else if (berserk.value == "13") {
var BerserkPoint = 0.28;
}
else if (berserk.value == "14") {
var BerserkPoint = 0.3;
}
else if (berserk.value == "15") {
var BerserkPoint = 0.32;
}
else if (berserk.value == "16") {
var BerserkPoint = 0.34;
}
else if (berserk.value == "17") {
var BerserkPoint = 0.36;
}
else if (berserk.value == "18") {
var BerserkPoint = 0.38;
}
else if (berserk.value == "19") {
var BerserkPoint = 0.4;
}
else if (berserk.value == "20") {
var BerserkPoint = 0.5;
}
else if (berserk.value == "M1") {
var BerserkPoint = 0.5;
}
else if (berserk.value == "M2") {
var BerserkPoint = 0.52;
}
else if (berserk.value == "M3") {
var BerserkPoint = 0.54;
}
else if (berserk.value == "M4") {
var BerserkPoint = 0.56;
}
else if (berserk.value == "M5") {
var BerserkPoint = 0.58;
}
else if (berserk.value == "M6") {
var BerserkPoint = 0.6;
}
else if (berserk.value == "M7") {
var BerserkPoint = 0.63;
}
else if (berserk.value == "M8") {
var BerserkPoint = 0.66;
}
else if (berserk.value == "M9") {
var BerserkPoint = 0.69;
}
else if (berserk.value == "M10") {
var BerserkPoint = 0.72;
}
else if (berserk.value == "G1") {
var BerserkPoint = 0.82;
}
else if (berserk.value == "G2") {
var BerserkPoint = 0.85;
}
else if (berserk.value == "G3") {
var BerserkPoint = 0.88;
}
else if (berserk.value == "G4") {
var BerserkPoint = 0.91;
}
else if (berserk.value == "G5") {
var BerserkPoint = 0.94;
}
else if (berserk.value == "G6") {
var BerserkPoint = 0.98;
}
else if (berserk.value == "G7") {
var BerserkPoint = 1.02;
}
else if (berserk.value == "G8") {
var BerserkPoint = 1.06;
}
else if (berserk.value == "G9") {
var BerserkPoint = 1.1;
}
else if (berserk.value == "G10") {
var BerserkPoint = 1.15;
}
else if (berserk.value == "P") {
var BerserkPoint = 1.25;
}
var BerserkWynik = "<tr><td>Berserk</td><td>Szybkość ataku: +" + Math.floor(50 * BerserkPoint) + "%<br>Prędkość ruchu: +" + Math.floor(20 * BerserkPoint) + "%</td><td>" + Math.floor(60 + (90 * BerserkPoint)) + "s</td><td>" + Math.floor(63 + (90 * BerserkPoint)) + "s</td><td>" + Math.floor(50 + (140 * BerserkPoint)) + "</td></tr>";
}
else {
var BerserkWynik = "<tr><td>Berserk</td><td>Szybkość ataku: +?<br>Prędkość ruchu: +?</td><td>?</td><td>?</td><td>?</td></tr>";
}
var szarza = document.getElementById('szarza');
if((szarza.value >= 1 && szarza.value <= 20) || szarza.value == "M1" || szarza.value == "M2" || szarza.value == "M3" || szarza.value == "M4" || szarza.value == "M5" || szarza.value == "M6" || szarza.value == "M7" || szarza.value == "M8" || szarza.value == "M9" || szarza.value == "M10" || szarza.value == "G1" || szarza.value == "G2" || szarza.value == "G3" || szarza.value == "G4" || szarza.value == "G5" || szarza.value == "G6" || szarza.value == "G7" || szarza.value == "G8" || szarza.value == "G9" || szarza.value == "G10" || szarza.value == "P" ) {
if (szarza.value == "1") {
var SzarzaPoint = 0.05;
}
else if (szarza.value == "2") {
var SzarzaPoint = 0.06;
}
else if (szarza.value == "3") {
var SzarzaPoint = 0.08;
}
else if (szarza.value == "4") {
var SzarzaPoint = 0.1;
}
else if (szarza.value == "5") {
var SzarzaPoint = 0.12;
}
else if (szarza.value == "6") {
var SzarzaPoint = 0.14;
}
else if (szarza.value == "7") {
var SzarzaPoint = 0.16;
}
else if (szarza.value == "8") {
var SzarzaPoint = 0.18;
}
else if (szarza.value == "9") {
var SzarzaPoint = 0.2;
}
else if (szarza.value == "10") {
var SzarzaPoint = 0.22;
}
else if (szarza.value == "11") {
var SzarzaPoint = 0.24;
}
else if (szarza.value == "12") {
var SzarzaPoint = 0.26;
}
else if (szarza.value == "13") {
var SzarzaPoint = 0.28;
}
else if (szarza.value == "14") {
var SzarzaPoint = 0.3;
}
else if (szarza.value == "15") {
var SzarzaPoint = 0.32;
}
else if (szarza.value == "16") {
var SzarzaPoint = 0.34;
}
else if (szarza.value == "17") {
var SzarzaPoint = 0.36;
}
else if (szarza.value == "18") {
var SzarzaPoint = 0.38;
}
else if (szarza.value == "19") {
var SzarzaPoint = 0.4;
}
else if (szarza.value == "20") {
var SzarzaPoint = 0.5;
}
else if (szarza.value == "M1") {
var SzarzaPoint = 0.5;
}
else if (szarza.value == "M2") {
var SzarzaPoint = 0.52;
}
else if (szarza.value == "M3") {
var SzarzaPoint = 0.54;
}
else if (szarza.value == "M4") {
var SzarzaPoint = 0.56;
}
else if (szarza.value == "M5") {
var SzarzaPoint = 0.58;
}
else if (szarza.value == "M6") {
var SzarzaPoint = 0.6;
}
else if (szarza.value == "M7") {
var SzarzaPoint = 0.63;
}
else if (szarza.value == "M8") {
var SzarzaPoint = 0.66;
}
else if (szarza.value == "M9") {
var SzarzaPoint = 0.69;
}
else if (szarza.value == "M10") {
var SzarzaPoint = 0.72;
}
else if (szarza.value == "G1") {
var SzarzaPoint = 0.82;
}
else if (szarza.value == "G2") {
var SzarzaPoint = 0.85;
}
else if (szarza.value == "G3") {
var SzarzaPoint = 0.88;
}
else if (szarza.value == "G4") {
var SzarzaPoint = 0.91;
}
else if (szarza.value == "G5") {
var SzarzaPoint = 0.94;
}
else if (szarza.value == "G6") {
var SzarzaPoint = 0.98;
}
else if (szarza.value == "G7") {
var SzarzaPoint = 1.02;
}
else if (szarza.value == "G8") {
var SzarzaPoint = 1.06;
}
else if (szarza.value == "G9") {
var SzarzaPoint = 1.1;
}
else if (szarza.value == "G10") {
var SzarzaPoint = 1.15;
}
else if (szarza.value == "P") {
var SzarzaPoint = 1.25;
}
var SzarzaWynik = "<tr><td>Szarza</td><td>Siła Ataku: " + Math.floor(2 * parseInt(min.value) +(parseInt(min.value) + (3 * parseInt(zre.value) + (7 * parseInt(sila.value)) + parseInt(wit.value)) * SzarzaPoint)) + " - " + Math.floor(2 * parseInt(max.value) +(parseInt(max.value) + (3 * parseInt(zre.value) + (7 * parseInt(sila.value)) + parseInt(wit.value)) * SzarzaPoint)) + "</td><td>-</td><td>12s</td><td>" + Math.floor(60 + (120 * SzarzaPoint)) + "</td></tr>";
}
else {
var SzarzaWynik = "<tr><td>Szarza</td><td>Siła Ataku: ?</td><td>?</td><td>?</td><td>?</td></tr>";
}
var trzystronne = document.getElementById('trzystronne');
if((trzystronne.value >= 1 && trzystronne.value <= 20) || trzystronne.value == "M1" || trzystronne.value == "M2" || trzystronne.value == "M3" || trzystronne.value == "M4" || trzystronne.value == "M5" || trzystronne.value == "M6" || trzystronne.value == "M7" || trzystronne.value == "M8" || trzystronne.value == "M9" || trzystronne.value == "M10" || trzystronne.value == "G1" || trzystronne.value == "G2" || trzystronne.value == "G3" || trzystronne.value == "G4" || trzystronne.value == "G5" || trzystronne.value == "G6" || trzystronne.value == "G7" || trzystronne.value == "G8" || trzystronne.value == "G9" || trzystronne.value == "G10" || trzystronne.value == "P" ) {
if (trzystronne.value == "1") {
var trzystronnePoint = 0.05;
}
else if (trzystronne.value == "2") {
var trzystronnePoint = 0.06;
}
else if (trzystronne.value == "3") {
var trzystronnePoint = 0.08;
}
else if (trzystronne.value == "4") {
var trzystronnePoint = 0.1;
}
else if (trzystronne.value == "5") {
var trzystronnePoint = 0.12;
}
else if (trzystronne.value == "6") {
var trzystronnePoint = 0.14;
}
else if (trzystronne.value == "7") {
var trzystronnePoint = 0.16;
}
else if (trzystronne.value == "8") {
var trzystronnePoint = 0.18;
}
else if (trzystronne.value == "9") {
var trzystronnePoint = 0.2;
}
else if (trzystronne.value == "10") {
var trzystronnePoint = 0.22;
}
else if (trzystronne.value == "11") {
var trzystronnePoint = 0.24;
}
else if (trzystronne.value == "12") {
var trzystronnePoint = 0.26;
}
else if (trzystronne.value == "13") {
var trzystronnePoint = 0.28;
}
else if (trzystronne.value == "14") {
var trzystronnePoint = 0.3;
}
else if (trzystronne.value == "15") {
var trzystronnePoint = 0.32;
}
else if (trzystronne.value == "16") {
var trzystronnePoint = 0.34;
}
else if (trzystronne.value == "17") {
var trzystronnePoint = 0.36;
}
else if (trzystronne.value == "18") {
var trzystronnePoint = 0.38;
}
else if (trzystronne.value == "19") {
var trzystronnePoint = 0.4;
}
else if (trzystronne.value == "20") {
var trzystronnePoint = 0.5;
}
else if (trzystronne.value == "M1") {
var trzystronnePoint = 0.5;
}
else if (trzystronne.value == "M2") {
var trzystronnePoint = 0.52;
}
else if (trzystronne.value == "M3") {
var trzystronnePoint = 0.54;
}
else if (trzystronne.value == "M4") {
var trzystronnePoint = 0.56;
}
else if (trzystronne.value == "M5") {
var trzystronnePoint = 0.58;
}
else if (trzystronne.value == "M6") {
var trzystronnePoint = 0.6;
}
else if (trzystronne.value == "M7") {
var trzystronnePoint = 0.63;
}
else if (trzystronne.value == "M8") {
var trzystronnePoint = 0.66;
}
else if (trzystronne.value == "M9") {
var trzystronnePoint = 0.69;
}
else if (trzystronne.value == "M10") {
var trzystronnePoint = 0.72;
}
else if (trzystronne.value == "G1") {
var trzystronnePoint = 0.82;
}
else if (trzystronne.value == "G2") {
var trzystronnePoint = 0.85;
}
else if (trzystronne.value == "G3") {
var trzystronnePoint = 0.88;
}
else if (trzystronne.value == "G4") {
var trzystronnePoint = 0.91;
}
else if (trzystronne.value == "G5") {
var trzystronnePoint = 0.94;
}
else if (trzystronne.value == "G6") {
var trzystronnePoint = 0.98;
}
else if (trzystronne.value == "G7") {
var trzystronnePoint = 1.02;
}
else if (trzystronne.value == "G8") {
var trzystronnePoint = 1.06;
}
else if (trzystronne.value == "G9") {
var trzystronnePoint = 1.1;
}
else if (trzystronne.value == "G10") {
var trzystronnePoint = 1.15;
}
else if (trzystronne.value == "P") {
var trzystronnePoint = 1.25;
}
var trzystronneWynik = "<tr><td>Trzystronne Cięcie</td><td>Siła Ataku: " + Math.floor((1.1 * parseInt(min.value) + (0.1 * parseInt(min.value) + 1.5 * parseInt(sila.value)) * trzystronnePoint) * 3) + " - " + Math.floor((1.1 * parseInt(max.value) + (0.1 * parseInt(max.value) + 1.5 * parseInt(sila.value)) * trzystronnePoint) * 3) + "</td><td>-</td><td>12s</td><td>" + Math.floor(40 + (100 * trzystronnePoint)) + "</td></tr>";
}
else {
var trzystronneWynik = "<tr><td>Trzystronne Cięcie</td><td>Siła Ataku: ?</td><td>?</td><td>?</td><td>?</td></tr>";
}
var wir = document.getElementById('wir');
if((wir.value >= 1 && wir.value <= 20) || wir.value == "M1" || wir.value == "M2" || wir.value == "M3" || wir.value == "M4" || wir.value == "M5" || wir.value == "M6" || wir.value == "M7" || wir.value == "M8" || wir.value == "M9" || wir.value == "M10" || wir.value == "G1" || wir.value == "G2" || wir.value == "G3" || wir.value == "G4" || wir.value == "G5" || wir.value == "G6" || wir.value == "G7" || wir.value == "G8" || wir.value == "G9" || wir.value == "G10" || wir.value == "P" ) {
if (wir.value == "1") {
var wirPoint = 0.05;
}
else if (wir.value == "2") {
var wirPoint = 0.06;
}
else if (wir.value == "3") {
var wirPoint = 0.08;
}
else if (wir.value == "4") {
var wirPoint = 0.1;
}
else if (wir.value == "5") {
var wirPoint = 0.12;
}
else if (wir.value == "6") {
var wirPoint = 0.14;
}
else if (wir.value == "7") {
var wirPoint = 0.16;
}
else if (wir.value == "8") {
var wirPoint = 0.18;
}
else if (wir.value == "9") {
var wirPoint = 0.2;
}
else if (wir.value == "10") {
var wirPoint = 0.22;
}
else if (wir.value == "11") {
var wirPoint = 0.24;
}
else if (wir.value == "12") {
var wirPoint = 0.26;
}
else if (wir.value == "13") {
var wirPoint = 0.28;
}
else if (wir.value == "14") {
var wirPoint = 0.3;
}
else if (wir.value == "15") {
var wirPoint = 0.32;
}
else if (wir.value == "16") {
var wirPoint = 0.34;
}
else if (wir.value == "17") {
var wirPoint = 0.36;
}
else if (wir.value == "18") {
var wirPoint = 0.38;
}
else if (wir.value == "19") {
var wirPoint = 0.4;
}
else if (wir.value == "20") {
var wirPoint = 0.5;
}
else if (wir.value == "M1") {
var wirPoint = 0.5;
}
else if (wir.value == "M2") {
var wirPoint = 0.52;
}
else if (wir.value == "M3") {
var wirPoint = 0.54;
}
else if (wir.value == "M4") {
var wirPoint = 0.56;
}
else if (wir.value == "M5") {
var wirPoint = 0.58;
}
else if (wir.value == "M6") {
var wirPoint = 0.6;
}
else if (wir.value == "M7") {
var wirPoint = 0.63;
}
else if (wir.value == "M8") {
var wirPoint = 0.66;
}
else if (wir.value == "M9") {
var wirPoint = 0.69;
}
else if (wir.value == "M10") {
var wirPoint = 0.72;
}
else if (wir.value == "G1") {
var wirPoint = 0.82;
}
else if (wir.value == "G2") {
var wirPoint = 0.85;
}
else if (wir.value == "G3") {
var wirPoint = 0.88;
}
else if (wir.value == "G4") {
var wirPoint = 0.91;
}
else if (wir.value == "G5") {
var wirPoint = 0.94;
}
else if (wir.value == "G6") {
var wirPoint = 0.98;
}
else if (wir.value == "G7") {
var wirPoint = 1.02;
}
else if (wir.value == "G8") {
var wirPoint = 1.06;
}
else if (wir.value == "G9") {
var wirPoint = 1.1;
}
else if (wir.value == "G10") {
var wirPoint = 1.15;
}
else if (wir.value == "P") {
var wirPoint = 1.25;
}
var wirWynik = "<tr><td>Wir Miecza</td><td>Siła Ataku: " + Math.floor(3 * parseInt(min.value) + (0.8 * parseInt(min.value) + 6 * parseInt(sila.value) + 2 * parseInt(zre.value) + parseInt(wit.value)) * wirPoint) + " - " + Math.floor(3 * parseInt(max.value) + (0.8 * parseInt(max.value) + 6 * parseInt(sila.value) + 2 * parseInt(zre.value) + parseInt(wit.value)) * wirPoint) + "</td><td>-</td><td>15s</td><td>" + Math.floor(50 + (130 * wirPoint)) + "</td></tr>";
}
else {
var wirWynik = "<tr><td>Wir Miecza</td><td>Siła Ataku: ?</td><td>?</td><td>?</td><td>?</td></tr>";
}
var uwaga = "<br><br><b>Uwaga! Podane wartości mogą się różnić od wartości podanych w grze</b>";
if(level.value != "")
document.getElementById("skillbody").innerHTML ='<table border="1"><tr><td>Nazwa</td><td>Efekt</td><td>Czas Trwania</td><td>Czas Ładowania</td><td>Koszt PE</td></tr>' + AuraWynik + BerserkWynik + SzarzaWynik + trzystronneWynik + wirWynik + '</table>' + uwaga
else
document.getElementById("skillbody").innerHTML ="Aura Miecza: ?<br>Berserk: ?<br>Szarża: ?<br>Trzystronne Cięcie: ?<br>Wir Miecza: ?" + uwaga
}
// Kalkulator