diff --git a/Ardon-income.html b/Ardon-income.html index 79e5eba..01be98a 100644 --- a/Ardon-income.html +++ b/Ardon-income.html @@ -13,10 +13,14 @@ Enter the number of blocks used for transportation, recreational purposes, soft



-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) +Enter the number of those blocks that qualify as housing, transportation buildings, buildings for recreational purposes, soft infrastructure buildings, utility buildings, business buildings, government buildings (including your capital building) or military bases. (1.0% bonus)



+Enter the number of businesses in your business chain. +

+ +

Enter the number of rent blocks that qualify as being exceptionally designed buildings. (confirmed by two people). (1.5% bonus)

@@ -46,7 +50,7 @@ Enter the number of metropolises in your empire. (See: https://ltlto.com/josh/mc

-

+






© Copyright 2017 Joshua Mudge

diff --git a/calculate.js b/calculate.js index 0e967d1..7c99870 100644 --- a/calculate.js +++ b/calculate.js @@ -2,12 +2,6 @@ //Licensed under the Apache License 2.0. See license file for information. function calculate() { - var blocks = 0 - var tenblocks = 0 - var twentyfifth = 0 - var embassies = 0 - var capital = 0 - var percent = 0 var numReg = /^\d+$/; //Get input @@ -19,6 +13,7 @@ function calculate() { var embassies = document.getElementById("embassies").value; var capital = document.getElementById("capital").value; var infra = document.getElementById("infra").value; + var chain = document.getElementById("chain").value; var town = document.getElementById("town").value; var city = document.getElementById("city").value; var metro = document.getElementById("metro").value; @@ -34,12 +29,14 @@ function calculate() { alert("Please enter only numbers in this field."); } - var emeralds = +blocks / 1000 - console.log(emeralds) + var gold = +blocks / 10 + console.log(gold) var infra = +infra / 1000 * 0.005 console.log(infra) var one = +one / 1000 * 0.01 console.log(one) + var chain = +chain * 0.0025 + console.log(chain) var design = +design / 1000 * 0.015 console.log(design) var gov = +gov * 0.02 @@ -54,17 +51,16 @@ function calculate() { console.log(city) var metro = +metro * 0.01 console.log(metro) - var percent = +one + +design + +gov + +embassies + +capital + +infra + +town + +city + +metro - //var percent = +percent / 100 + var percent = +one + +design + +gov + +embassies + +capital + +infra + +chain + +town + +city + +metro console.log(percent) - var total = +emeralds * +percent + +emeralds - var total = total.toFixed(3); + var total = +gold * +percent + +gold + var total = total.toFixed(0); console.log(total) var date = Date(); console.log(date) //Show result - alert("Your secret message is " + total); - document.getElementById("Answer").innerHTML = "Your secret message is " + total; + alert("Your income is " + total + " Gold"); + document.getElementById("Income").innerHTML = "Your Income is " + total + " Gold"; }