Browse Source

Updated percentages and added a couple more options.

master
Josh Mudge 7 years ago
parent
commit
5808156e10
  1. 23
      Ardon-income.html
  2. 23
      calculate.js

23
Ardon-income.html

@ -6,25 +6,34 @@
<title>Minecraft Income Calculator</title>
</head>
<p>Minecraft Income Calculator</p>
<p>Enter the number of blocks eligable for rent:</p>
<p>Enter the number of blocks eligable for rent excluding one "base of operations" you change. (1000 blocks = 1 emerald)</p>
<input type="number" id="blocks"></input>
<br><br>
Enter the number of those blocks that qualify as Housing, Infrastructure, Business or military bases.
Enter the number of blocks used for transportation, recreational purposes, soft infrastructure or utilities that is not buildings. (0.5% bonus)
<br><br>
<input type="number" id="tenblocks"></input>
<input type="number" id="infra"></input>
<br><br>
Enter the number of rent blocks that qualify as being government buildings (other than capitals) or as being exceptionally designed (confirmed by two people).
Enter the number of those blocks that qualify as Housing, transportation buildings, buildings for recreational purposes, soft infrastructure buildings or utility buildings, Business buildings, Government buildings or military bases. (1.0% bonus)
<br><br>
<input type="number" id="twentyfifth"></input>
<input type="number" id="one"></input>
<br><br>
Enter the number of embassies in other empires built by permission and confirmed to be embassies by two people.
Enter the number of rent blocks that qualify as being exceptionally designed buildings. (confirmed by two people). (1.5% bonus)
<br><br>
<input type="number" id="design"></input>
<br><br>
Enter the number of government buildings you have. (2.0% bonus for 4.)
<br><br>
<input type="number" id="gov"></input>
<br><br>
Enter the number of embassies in other empires built by permission and confirmed to be embassies by two people. You can only have three or one per city in another empire. (2.0% bonus per embassy)
<br><br>
<input type="number" id="embassies"></input>
<br><br>
Enter 1 if you have a capital
Enter 1 if you have a capital. (2.5% bonus)
<br><br>
<input type="number" id="capital"></input>
<br><br>
<input type="button" value="Calculate Income" onclick="calculate()" />
<p id="Answer"></p>
<br><br><br><br><br>

23
calculate.js

@ -13,10 +13,11 @@ function calculate() {
//Get input
var blocks = document.getElementById("blocks").value;
var tenblocks = document.getElementById("tenblocks").value;
var twentyfifth = document.getElementById("twentyfifth").value;
var one = document.getElementById("one").value;
var gov = document.getElementById("gov").value;
var embassies = document.getElementById("embassies").value;
var capital = document.getElementById("capital").value;
var infra = document.getElementById("infra").value;
if (blocks.match(numReg))
{
@ -31,15 +32,19 @@ function calculate() {
var emeralds = +blocks / 1000
console.log(emeralds)
var tenblocks = +tenblocks / 1000 * 0.001
console.log(tenblocks)
var twentyfifth = +twentyfifth / 1000 * 0.0025
console.log(twentyfifth)
var embassies = +embassies * 0.0025
var one = +one / 1000 * 0.01
console.log(one)
var design = +design / 1000 * 0.015
console.log(design)
var gov = +gov / 1000 * 0.02
console.log(gov)
var embassies = +embassies * 0.01
console.log(embassies)
var capital = +capital * 0.01
var capital = +capital * 0.025
console.log(capital)
var percent = +tenblocks + +twentyfifth + +embassies + +capital
var infra = +infra * 0.005
console.log(infra)
var percent = +one + +two + +design + +embassies + +capital
console.log(percent)
var total = +emeralds * +percent +emeralds
var total = total.toFixed(4);

Loading…
Cancel
Save