Bug fixes

This commit is contained in:
Josh Mudge 2017-09-15 22:05:42 -06:00
parent c356e76cee
commit ce2af7e5fa
2 changed files with 7 additions and 6 deletions

View File

@ -21,7 +21,7 @@ Enter the number of rent blocks that qualify as being exceptionally designed bui
<br><br>
<input type="number" id="design"></input>
<br><br>
Enter the number of government buildings you have. (2.0% bonus for 4.)
Enter the number of government buildings you have (excluding your capital). (2.0% bonus for 4.)
<br><br>
<input type="number" id="gov"></input>
<br><br>
@ -29,7 +29,7 @@ Enter the number of embassies in other empires built by permission and confirmed
<br><br>
<input type="number" id="embassies"></input>
<br><br>
Enter 1 if you have a capital. (2.5% bonus)
Enter 1 if you have a capital. Minimum 250 blocks. (2.5% bonus)
<br><br>
<input type="number" id="capital"></input>
<br><br>
@ -45,7 +45,6 @@ Enter the number of metropolises in your empire. (See: https://ltlto.com/josh/mc
<br><br>
<input type="number" id="metro"></input>
<br><br>
<input type="button" value="Calculate Income" onclick="calculate()" />
<p id="Answer"></p>
<br><br><br><br><br>

View File

@ -15,6 +15,7 @@ function calculate() {
var blocks = document.getElementById("blocks").value;
var one = document.getElementById("one").value;
var gov = document.getElementById("gov").value;
var design = document.getElementById("design").value;
var embassies = document.getElementById("embassies").value;
var capital = document.getElementById("capital").value;
var infra = document.getElementById("infra").value;
@ -35,6 +36,8 @@ function calculate() {
var emeralds = +blocks / 1000
console.log(emeralds)
var infra = +infra / 1000 * 0.005
console.log(infra)
var one = +one / 1000 * 0.01
console.log(one)
var design = +design / 1000 * 0.015
@ -45,8 +48,6 @@ function calculate() {
console.log(embassies)
var capital = +capital * 0.025
console.log(capital)
var infra = +infra * 0.005
console.log(infra)
var town = +town * 0.005
console.log(town)
var city = +city * 0.01
@ -54,8 +55,9 @@ function calculate() {
var metro = +metro * 0.01
console.log(metro)
var percent = +one + +design + +gov + +embassies + +capital + +infra + +town + +city + +metro
//var percent = +percent / 100
console.log(percent)
var total = +emeralds * +percent +emeralds
var total = +emeralds * +percent + +emeralds
var total = total.toFixed(4);
console.log(total)
var date = Date();