From a617164dab12f35d0a73a0a87ec2751a7111922b Mon Sep 17 00:00:00 2001 From: Josh Mudge Date: Mon, 30 Oct 2017 21:38:43 -0600 Subject: [PATCH] Add builders as an expense. --- calculate.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/calculate.js b/calculate.js index 52f8234..85be012 100644 --- a/calculate.js +++ b/calculate.js @@ -8,6 +8,7 @@ function loadsaved() { var blocks = localStorage.blocks // Put this section in it's own function, pass the variables to the other functions when usevalues() is run. var soldiers = localStorage.soldiers + var builders = localStorage.builders var one = localStorage.one var hotel = localStorage.hotel var gov = localStorage.gov @@ -24,6 +25,7 @@ function loadsaved() { document.getElementById("blocks").value = blocks; document.getElementById("soldiers").value = soldiers; + document.getElementById("builders").value = builders; document.getElementById("one").value = one; document.getElementById("gov").value = hotel; document.getElementById("gov").value = gov; @@ -43,6 +45,7 @@ function loadsaved() { function usesaved() { var blocks = localStorage.blocks var soldiers = localStorage.soldiers + var builders = localStorage.builders var one = localStorage.one var hotel = localStorage.hotel var gov = localStorage.gov @@ -67,6 +70,7 @@ function calculate() { var blocks = document.getElementById("blocks").value; var soldiers = document.getElementById("soldiers").value; + var builders = document.getElementById("builders").value; var one = document.getElementById("one").value; var hotel = document.getElementById("hotel").value; var govspecial = document.getElementById("govspecial").value; @@ -85,6 +89,7 @@ function calculate() { localStorage.blocks = document.getElementById("blocks").value; localStorage.soldiers = document.getElementById("soldiers").value; + localStorage.builders = document.getElementById("builders").value; localStorage.one = document.getElementById("one").value; localStorage.hotel = document.getElementById("hotel").value; localStorage.govspecial = document.getElementById("govspecial").value; @@ -114,6 +119,8 @@ function calculate() { console.log(gold) var gold = +gold - (soldiers * 50) // Note to self: Fix possibiliy of giving bonuses to negative incomes. console.log(gold) + var gold = +gold - (builders * 50) // Note to self: Fix possibiliy of giving bonuses to negative incomes. + console.log(gold) var infra = +infra / 1000 * 0.0025 console.log(infra) var one = +one / 1000 * 0.01