Updated percentages and added a couple more options.

This commit is contained in:
Josh Mudge 2017-09-14 22:15:29 -06:00
parent 359e40c53f
commit 5808156e10
2 changed files with 30 additions and 16 deletions

View File

@ -6,25 +6,34 @@
<title>Minecraft Income Calculator</title> <title>Minecraft Income Calculator</title>
</head> </head>
<p>Minecraft Income Calculator</p> <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> <input type="number" id="blocks"></input>
<br><br> <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> <br><br>
<input type="number" id="tenblocks"></input> <input type="number" id="infra"></input>
<br><br> <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> <br><br>
<input type="number" id="twentyfifth"></input> <input type="number" id="one"></input>
<br><br> <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> <br><br>
<input type="number" id="embassies"></input> <input type="number" id="embassies"></input>
<br><br> <br><br>
Enter 1 if you have a capital Enter 1 if you have a capital. (2.5% bonus)
<br><br> <br><br>
<input type="number" id="capital"></input> <input type="number" id="capital"></input>
<br><br> <br><br>
<input type="button" value="Calculate Income" onclick="calculate()" /> <input type="button" value="Calculate Income" onclick="calculate()" />
<p id="Answer"></p> <p id="Answer"></p>
<br><br><br><br><br> <br><br><br><br><br>

View File

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