Procházet zdrojové kódy

Added arousal meters. Adjusted sq m display

tags/v0.7.0
Fen Dweller před 7 roky
rodič
revize
430b6ccc3a
4 změnil soubory, kde provedl 80 přidání a 14 odebrání
  1. +21
    -11
      game.js
  2. +41
    -0
      stroll.html
  3. +16
    -1
      style.css
  4. +2
    -2
      units.js

+ 21
- 11
game.js Zobrazit soubor

@@ -1524,9 +1524,15 @@ function toggle_arousal()
if (macro.arousalEnabled) {
document.getElementById("arousal").style.display = "block";
document.getElementById("edge").style.display = "block";
document.querySelector("#arousalMeter").style.display = 'inline-block';
document.querySelector("#orgasmMeter").style.display = 'inline-block';
document.querySelector("#edgeMeter").style.display = 'inline-block';
} else {
document.getElementById("arousal").style.display = "none";
document.getElementById("edge").style.display = "none";
document.querySelector("#arousalMeter").style.display = 'none';
document.querySelector("#orgasmMeter").style.display = 'none';
document.querySelector("#edgeMeter").style.display = 'none';
}

macro.orgasm = false;
@@ -3014,9 +3020,10 @@ function update(lines = [])

document.getElementById("height").innerHTML = "Height: " + transformNumbers(length(macro.height, unit));
document.getElementById("mass").innerHTML = "Mass: " + transformNumbers(mass(macro.totalMass, unit));
document.getElementById("arousal").innerHTML = "Arousal: " + round(macro.arousal,0) + "%";
document.getElementById("edge").innerHTML = "Edge: " + round(macro.edge * 100,0) + "%";

applyPercentage("arousal", 150 - macro.arousal * 1.5);
applyPercentage("orgasm", 150 - (macro.arousal - 100) * 1.5);
applyPercentage("edge", 150 - macro.edge * 150);
stylePercentage("cum", macro.cumStorage);
stylePercentage("femcum", macro.femcumStorage);
stylePercentage("milk", macro.milkStorage);
@@ -3025,18 +3032,15 @@ function update(lines = [])
stylePercentage("scat", macro.scatStorage);
}

function stylePercentage(name, storage) {
document.getElementById(name).innerHTML = name + ": " + transformNumbers(volume(storage.amount,unit,false));
let meterPos = 150 - storage.amount / storage.limit * 150;
function applyPercentage(name, meterPos) {
meterPos = meterPos < 0 ? 0 : meterPos;
document.querySelector("#" + name + "Meter .fill").style.setProperty("transform", "translate(0px, " + Math.round(meterPos) + "px)");
}

function stylePercentages() {
document.querySelectorAll(".meter .fill").forEach(function(x) {
let amount = 150 - x.value / x.max * 150;
x.style.setProperty("transform", "translate(0px, " + amount + ")");
});
function stylePercentage(name, storage) {
document.getElementById(name).innerHTML = name + ": " + transformNumbers(volume(storage.amount,unit,false));
let meterPos = 150 - storage.amount / storage.limit * 150;
applyPercentage(name, meterPos);
}

function pick_move()
@@ -3302,7 +3306,7 @@ function enable_panel(name) {

function enable_stat(name) {
document.getElementById(name).style.display = 'block';
document.querySelector("#" + name + "Meter .meterLabel").style.display = 'block';
document.querySelector("#" + name + "Meter").style.display = 'inline-block';
}

function enable_growth_part(name) {
@@ -3367,6 +3371,12 @@ function startGame(e) {
enable_victim("chew","Chewed");
}

if (macro.arousalEnabled) {
document.querySelector("#arousalMeter").style.display = 'inline-block';
document.querySelector("#orgasmMeter").style.display = 'inline-block';
document.querySelector("#edgeMeter").style.display = 'inline-block';
}

if (macro.analVore) {
enable_button("anal_vore");
enable_victim("anal-vore","Anal vore");


+ 41
- 0
stroll.html Zobrazit soubor

@@ -31,6 +31,47 @@
<div class="stat-line" id="arousal"></div>
<div class="stat-line" id="edge"></div>


<div class="meter" id="arousalMeter">
<div class="meterLabel">
AROUSAL
</div>
<div class="fill">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="300px" height="300px" viewBox="0 0 300 300" enable-background="new 0 0 300 300" xml:space="preserve">
<path fill="#04ACFF" id="waveShape" d="M300,300V2.5c0,0-0.6-0.1-1.1-0.1c0,0-25.5-2.3-40.5-2.4c-15,0-40.6,2.4-40.6,2.4
c-12.3,1.1-30.3,1.8-31.9,1.9c-2-0.1-19.7-0.8-32-1.9c0,0-25.8-2.3-40.8-2.4c-15,0-40.8,2.4-40.8,2.4c-12.3,1.1-30.4,1.8-32,1.9
c-2-0.1-20-0.8-32.2-1.9c0,0-3.1-0.3-8.1-0.7V300H300z"/>
</svg>
</div>
</div>

<div class="meter" id="orgasmMeter">
<div class="meterLabel">
ORGASM
</div>
<div class="fill">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="300px" height="300px" viewBox="0 0 300 300" enable-background="new 0 0 300 300" xml:space="preserve">
<path fill="#04ACFF" id="waveShape" d="M300,300V2.5c0,0-0.6-0.1-1.1-0.1c0,0-25.5-2.3-40.5-2.4c-15,0-40.6,2.4-40.6,2.4
c-12.3,1.1-30.3,1.8-31.9,1.9c-2-0.1-19.7-0.8-32-1.9c0,0-25.8-2.3-40.8-2.4c-15,0-40.8,2.4-40.8,2.4c-12.3,1.1-30.4,1.8-32,1.9
c-2-0.1-20-0.8-32.2-1.9c0,0-3.1-0.3-8.1-0.7V300H300z"/>
</svg>
</div>
</div>

<div class="meter" id="edgeMeter">
<div class="meterLabel">
EDGING
</div>
<div class="fill">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="300px" height="300px" viewBox="0 0 300 300" enable-background="new 0 0 300 300" xml:space="preserve">
<path fill="#04ACFF" id="waveShape" d="M300,300V2.5c0,0-0.6-0.1-1.1-0.1c0,0-25.5-2.3-40.5-2.4c-15,0-40.6,2.4-40.6,2.4
c-12.3,1.1-30.3,1.8-31.9,1.9c-2-0.1-19.7-0.8-32-1.9c0,0-25.8-2.3-40.8-2.4c-15,0-40.8,2.4-40.8,2.4c-12.3,1.1-30.4,1.8-32,1.9
c-2-0.1-20-0.8-32.2-1.9c0,0-3.1-0.3-8.1-0.7V300H300z"/>
</svg>
</div>
</div>

<p>
<!-- external svg is such a pain in the ass -->

<div class="meter" id="cumMeter">


+ 16
- 1
style.css Zobrazit soubor

@@ -508,7 +508,6 @@ body.dark .meter {
}

.meter .meterLabel {
display: none;
z-index: 1;
writing-mode: vertical-lr;
text-orientation: upright;
@@ -531,6 +530,10 @@ body.dark .meterLabel {
mix-blend-mode: exclusion;
}

.meter {
display: none
}

.meter .fill {
position: absolute;
top: 0;
@@ -547,6 +550,18 @@ body.dark .meterLabel {
fill: #04ACFF;
}

.meter#arousalMeter #waveShape {
fill: #FF0000;
}

.meter#orgasmMeter #waveShape {
fill: #FFFFFF;
}

.meter#edgeMeter #waveShape {
fill: #FF6600;
}

.meter#cumMeter #waveShape {
fill: #EEEEEE;
}


+ 2
- 2
units.js Zobrazit soubor

@@ -257,11 +257,11 @@ function approxLength(m, singular=false) {
}

function metricArea(m2, singular=false) {
if (m2 < 1/1000) {
if (m2 < 1/10) {
let area = round(m2 * 10000,2);
return area + (singular || area == 1 ? " square centimeter" : " square centimeters");
} else if (m2 < 100000) {
let area = round(m2,0);
let area = round(m2,2);
return area + (singular || area == 1 ? " square meter" : " square meters");
} else {
let area = round(m2 / 1e6,2);


Načítá se…
Zrušit
Uložit