| @@ -942,24 +942,32 @@ function female_orgasm(vol) | |||||
| update([sound,line,linesummary,newline]); | 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 = []) | function update(lines = []) | ||||
| { | { | ||||
| var log = document.getElementById("log"); | var log = document.getElementById("log"); | ||||
| lines.forEach(function (x) { | lines.forEach(function (x) { | ||||
| var line = document.createElement('div'); | 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); | log.appendChild(line); | ||||
| }); | }); | ||||
| if (lines.length > 0) | if (lines.length > 0) | ||||
| log.scrollTop = log.scrollHeight; | 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("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) { | for (var type in victims) { | ||||
| if (victims.hasOwnProperty(type)) { | if (victims.hasOwnProperty(type)) { | ||||
| @@ -18,12 +18,14 @@ | |||||
| <div class=stat-line id=mass></div> | <div class=stat-line id=mass></div> | ||||
| <div class=stat-line id=arousal></div> | <div class=stat-line id=arousal></div> | ||||
| <div class=stat-line id=cum></div> | <div class=stat-line id=cum></div> | ||||
| <div class=stat-line id=cumPercent></div> | |||||
| <div class=stat-line id=femcum></div> | <div class=stat-line id=femcum></div> | ||||
| <div class=stat-line id=femcumPercent></div> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div id=log-area> | <div id=log-area> | ||||
| <div id=log> | <div id=log> | ||||
| <div>Welcome to Stroll 0.2.7</div> | |||||
| <div>Welcome to Stroll 0.2.8</div> | |||||
| <div><b>This game features 18+ content</b></div> | <div><b>This game features 18+ content</b></div> | ||||
| <div><a href="https://chemicalcrux.org/stroll">Changelog</a></div> | <div><a href="https://chemicalcrux.org/stroll">Changelog</a></div> | ||||
| <div>It's a nice day for a walk</div> | <div>It's a nice day for a walk</div> | ||||
| @@ -52,7 +54,7 @@ | |||||
| <div class=option-container id=option-panel> | <div class=option-container id=option-panel> | ||||
| <p>Welcome to Stroll 0.2.7</p> | |||||
| <p>Welcome to Stroll 0.2.8</p> | |||||
| <p><b>This game features 18+ content</b></p> | <p><b>This game features 18+ content</b></p> | ||||
| <a href="https://chemicalcrux.org/stroll">Changelog</a> | <a href="https://chemicalcrux.org/stroll">Changelog</a> | ||||
| <br> | <br> | ||||
| @@ -14,6 +14,9 @@ function number(value, type="full", precision=3) { | |||||
| function number_words(value) { | function number_words(value) { | ||||
| var scale = Math.floor(Math.log(value) / Math.log(1000)); | var scale = Math.floor(Math.log(value) / Math.log(1000)); | ||||
| if (scale < 0) { | |||||
| return value.toString(); | |||||
| } | |||||
| switch(scale) { | switch(scale) { | ||||
| case 0: return value.toString(); | case 0: return value.toString(); | ||||
| case 1: return Math.round(value / 1e3).toString() + " thousand"; | case 1: return Math.round(value / 1e3).toString() + " thousand"; | ||||
| @@ -41,9 +44,11 @@ function number_words(value) { | |||||
| } | } | ||||
| function number_words_repeated(value) { | function number_words_repeated(value) { | ||||
| var scale = Math.floor(Math.log(value) / Math.log(1000)); | |||||
| if (value == Infinity) | if (value == Infinity) | ||||
| return "a lot of"; | return "a lot of"; | ||||
| var scale = Math.floor(Math.log(value) / Math.log(1000)); | |||||
| if (scale < 0) | |||||
| return value.toString(); | |||||
| switch(scale) { | switch(scale) { | ||||
| case 0: return value.toString(); | case 0: return value.toString(); | ||||
| case 1: return Math.round(value / 1e3).toString() + " thousand"; | case 1: return Math.round(value / 1e3).toString() + " thousand"; | ||||
| @@ -58,6 +63,8 @@ function number_words_repeated(value) { | |||||
| function number_prefix(value) { | function number_prefix(value) { | ||||
| var scale = Math.floor(Math.log(value) / Math.log(1000)); | var scale = Math.floor(Math.log(value) / Math.log(1000)); | ||||
| if (scale < 0) | |||||
| return value.toString(); | |||||
| switch(scale) { | switch(scale) { | ||||
| case 0: return value.toString(); | case 0: return value.toString(); | ||||
| case 1: return Math.round(value / 1e3).toString() + "K"; | case 1: return Math.round(value / 1e3).toString() + "K"; | ||||