Show emeralds and the efficiency bonus.
This commit is contained in:
parent
568a41f0d9
commit
864ac46469
16
calculate.js
16
calculate.js
|
@ -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)";
|
||||
|
||||
}
|
||||
|
|
|
@ -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>© Copyright 2017 Joshua Mudge</p>
|
||||
|
|
Loading…
Reference in New Issue