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> <br><br>
<input type="number" id="design"></input> <input type="number" id="design"></input>
<br><br> <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> <br><br>
<input type="number" id="gov"></input> <input type="number" id="gov"></input>
<br><br> <br><br>
@ -29,7 +29,7 @@ Enter the number of embassies in other empires built by permission and confirmed
<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. (2.5% bonus) Enter 1 if you have a capital. Minimum 250 blocks. (2.5% bonus)
<br><br> <br><br>
<input type="number" id="capital"></input> <input type="number" id="capital"></input>
<br><br> <br><br>
@ -45,7 +45,6 @@ Enter the number of metropolises in your empire. (See: https://ltlto.com/josh/mc
<br><br> <br><br>
<input type="number" id="metro"></input> <input type="number" id="metro"></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

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