diff --git a/src/js/utilJS.tw b/src/js/utilJS.tw index dbad455c2d176954b63965ff2d585145a5297266..0dd5aff30384ef7b96de8c4999c3e8dc4111727a 100644 --- a/src/js/utilJS.tw +++ b/src/js/utilJS.tw @@ -491,6 +491,33 @@ window.cashFormat = function(s) { return "¤"+commaNum(s); }; +window.printCost = (function() { + let V; + let r; + + function printCost(cost, upkeep, arcology) { + V = State.variables + r = ""; + if (!upkeep) { + upkeep = 0 + } + if (!arcology) { + arcology = 0 + } + r += `//Costs <span class=yellowgreen><<print cashFormat(Math.trunc(` + cost + if (arcology == 0) { + r += `*${V.upgradeMultiplierArcology}))>></span>//` + } else { + r += `))>></span>//` + } + if (upkeep == 1) { + r += `// and will incur upkeep costs//` + } + return r; + }; + return printCost; +})(); + window.isFloat = function(n){ return n === +n && n !== (n|0); };