diff --git a/game.js b/game.js index 40fcd86..b583b4d 100644 --- a/game.js +++ b/game.js @@ -942,24 +942,32 @@ function female_orgasm(vol) update([sound,line,linesummary,newline]); } +function transformNumbers(line) +{ + return line.toString().replace(/[0-9]+(\.[0-9]+)?(e\+[0-9]+)?/g, function(text) { return number(text, numbers); }); +} + function update(lines = []) { var log = document.getElementById("log"); lines.forEach(function (x) { var line = document.createElement('div'); - line.innerHTML = x.replace(/[0-9]+(\.[0-9]+)?(e\+[0-9]+)?/g, function(text) { return number(text, numbers); }); + line.innerHTML = transformNumbers(x); log.appendChild(line); }); if (lines.length > 0) log.scrollTop = log.scrollHeight; - document.getElementById("height").innerHTML = "Height: " + length(macro.height, unit); - document.getElementById("mass").innerHTML = "Mass: " + mass(macro.mass, unit); + document.getElementById("height").innerHTML = "Height: " + transformNumbers(length(macro.height, unit)); + document.getElementById("mass").innerHTML = "Mass: " + transformNumbers(mass(macro.mass, unit)); document.getElementById("arousal").innerHTML = "Arousal: " + round(macro.arousal,0) + "%"; - document.getElementById("cum").innerHTML = "Cum: " + volume(macro.cumStorage.amount,unit,false) + "/" + volume(macro.cumStorage.limit,unit,false); - document.getElementById("femcum").innerHTML = "Femcum: " + volume(macro.femcumStorage.amount,unit,false) + "/" + volume(macro.femcumStorage.limit,unit,false); + document.getElementById("cum").innerHTML = "Cum: " + transformNumbers(volume(macro.cumStorage.amount,unit,false)) + document.getElementById("cumPercent").innerHTML = Math.round(macro.cumStorage.amount / macro.cumStorage.limit * 100) + "%"; + document.getElementById("femcum").innerHTML = "Femcum: " + transformNumbers(volume(macro.femcumStorage.amount,unit,false)); + document.getElementById("femcumPercent").innerHTML = Math.round(macro.femcumStorage.amount / macro.femcumStorage.limit * 100) + "%"; + for (var type in victims) { if (victims.hasOwnProperty(type)) { diff --git a/stroll.html b/stroll.html index 7c140b6..c194951 100644 --- a/stroll.html +++ b/stroll.html @@ -18,12 +18,14 @@
+
+
-
Welcome to Stroll 0.2.7
+
Welcome to Stroll 0.2.8
This game features 18+ content
Changelog
It's a nice day for a walk
@@ -52,7 +54,7 @@
-

Welcome to Stroll 0.2.7

+

Welcome to Stroll 0.2.8

This game features 18+ content

Changelog
diff --git a/units.js b/units.js index 8707c5b..38367bf 100644 --- a/units.js +++ b/units.js @@ -14,6 +14,9 @@ function number(value, type="full", precision=3) { function number_words(value) { var scale = Math.floor(Math.log(value) / Math.log(1000)); + if (scale < 0) { + return value.toString(); + } switch(scale) { case 0: return value.toString(); case 1: return Math.round(value / 1e3).toString() + " thousand"; @@ -41,9 +44,11 @@ function number_words(value) { } function number_words_repeated(value) { - var scale = Math.floor(Math.log(value) / Math.log(1000)); if (value == Infinity) return "a lot of"; + var scale = Math.floor(Math.log(value) / Math.log(1000)); + if (scale < 0) + return value.toString(); switch(scale) { case 0: return value.toString(); case 1: return Math.round(value / 1e3).toString() + " thousand"; @@ -58,6 +63,8 @@ function number_words_repeated(value) { function number_prefix(value) { var scale = Math.floor(Math.log(value) / Math.log(1000)); + if (scale < 0) + return value.toString(); switch(scale) { case 0: return value.toString(); case 1: return Math.round(value / 1e3).toString() + "K";