Show emeralds and the efficiency bonus.

This commit is contained in:
Josh Mudge 2017-09-19 17:34:52 -06:00
parent 568a41f0d9
commit 864ac46469
2 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,6 @@
"use strict";
//Licensed under the Apache License 2.0. See license file for information.
// Ardon Income Calculator v3.1.1 stable.
// Ardon Income Calculator v3.2 stable.
// Written by Josh Mudge
// Ad Mejorem Dei Glorium
@ -57,17 +57,23 @@ function calculate() {
console.log(metro)
var percent = +one + +design + +gov + +embassies + +capital + +infra + +chain + +town + +city + +metro
console.log(percent)
var bonus = +percent * 100
var bonus = bonus.toFixed(2);
console.log(bonus)
var total = +gold * +percent
console.log(total)
var total = +total + +gold
console.log(total)
var total = total.toFixed(0);
console.log(total)
var date = Date();
console.log(date)
var emeralds = +total / 100
console.log(emeralds)
//var date = Date();
//console.log(date)
//Show result
alert("Your income is " + total + " Gold");
document.getElementById("Income").innerHTML = "Your Income is " + total + " Gold per Minecraft Year (5 days)";
alert("Your Income is " + total + " Gold (or " + emeralds + " emeralds) per Minecraft Year (5 days)");
document.getElementById("Bonus").innerHTML = "Your Efficiency bonus is " + bonus + "%";
document.getElementById("Income").innerHTML = "Your Income is " + total + " Gold (or " + emeralds + " emeralds) per Minecraft Year (5 days)";
}

View File

@ -52,6 +52,7 @@ Enter the number of metropolises in your empire. (See: https://ltlto.com/josh/mc
<br><br>
<input type="button" value="Calculate Income" onclick="calculate()" />
<p id="Income"></p>
<p id="Bonus"></p>
<br><br><br><br><br>
<script src="calculate.js"></script>
<p>&copy; Copyright 2017 Joshua Mudge</p>