|
|
| (52 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| // --- DROPRATE CALCULATOR ---
| | mw.loader.load('/index.php?title=MediaWiki:DropCalc.js&action=raw&ctype=text/javascript'); |
| document.addEventListener("DOMContentLoaded", function() {
| | mw.loader.load('/index.php?title=MediaWiki:SlayerPointsCalc.js&action=raw&ctype=text/javascript'); |
| var container = document.getElementById("calcContainer");
| | mw.loader.load('/index.php?title=MediaWiki:BingoSheet.js&action=raw&ctype=text/javascript'); |
| if (!container) return;
| |
| | |
| // Build the calculator HTML
| |
| container.innerHTML = ''
| |
| + '<div style="margin:10px 0;">'
| |
| + ' <label>Base Drop Rate: <input type="number" id="baseRate" value="1000" style="width:80px;"></label>'
| |
| + '</div>'
| |
| + '<div style="margin:10px 0;">'
| |
| + ' <label>Donator Bonus: '
| |
| + ' <select id="donatorBonus">'
| |
| + ' <option value="0">None</option>'
| |
| + ' <option value="0.10">Bronze (10%)</option>'
| |
| + ' <option value="0.25">Divine (25%)</option>'
| |
| + ' </select>'
| |
| + ' </label>'
| |
| + '</div>'
| |
| + '<div style="margin:10px 0;">'
| |
| + ' <label>Vote Bonus: '
| |
| + ' <select id="voteBonus">'
| |
| + ' <option value="0">None</option>'
| |
| + ' <option value="0.05">5%</option>'
| |
| + ' <option value="0.10">10%</option>'
| |
| + ' </select>'
| |
| + ' </label>'
| |
| + '</div>'
| |
| + '<div style="margin:10px 0;">'
| |
| + ' <label>Skull Bonus: '
| |
| + ' <select id="skullBonus">'
| |
| + ' <option value="0">None</option>'
| |
| + ' <option value="0.05">5%</option>'
| |
| + ' <option value="0.15">15%</option>'
| |
| + ' </select>'
| |
| + ' </label>'
| |
| + '</div>'
| |
| + '<div style="margin:10px 0;">'
| |
| + ' <button id="calcButton">Calculate Drop Rate</button>'
| |
| + '</div>'
| |
| + '<div style="margin:10px 0;">Final Drop Rate: <span id="finalRate">0</span></div>';
| |
| | |
| // Calculator logic
| |
| var btn = document.getElementById("calcButton");
| |
| btn.addEventListener("click", function() {
| |
| var base = parseFloat(document.getElementById("baseRate").value) || 0;
| |
| var donator = parseFloat(document.getElementById("donatorBonus").value) || 0;
| |
| var vote = parseFloat(document.getElementById("voteBonus").value) || 0;
| |
| var skull = parseFloat(document.getElementById("skullBonus").value) || 0;
| |
| | |
| // Multiplicative reduction formula
| |
| var finalRate = base * (1 - donator) * (1 - vote) * (1 - skull);
| |
| | |
| document.getElementById("finalRate").textContent = finalRate.toFixed(2);
| |
| });
| |
| });
| |