From 75b0c71faff5d452a696a45f4cf316539781e4a1 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Thu, 19 Dec 2019 09:32:27 -0500 Subject: [PATCH] Change base production values to be percentages. Old saves will have their base production values cleared. --- features.js | 36 ++++++++++++++++++------------------ game.js | 15 ++++++++------- migrations.js | 22 +++++++++++++++++++++- 3 files changed, 47 insertions(+), 26 deletions(-) diff --git a/features.js b/features.js index 1dd9df3..82d6cf1 100644 --- a/features.js +++ b/features.js @@ -1192,9 +1192,9 @@ options = [ "name": "Passive cum production", "id": "baseCumProduction", "type": "float", - "default": "0.01", - "unit": "volume", - "tooltip": "The fraction of your maximum capacity produced every second" + "default": "1", + "unit": "percentage", + "tooltip": "How much you fill up every second" }, { "name": "Cum storage factor", @@ -1357,9 +1357,9 @@ options = [ "name": "Passive femcum production", "id": "baseFemcumProduction", "type": "float", - "default": "0.01", - "unit": "volume", - "tooltip": "The fraction of your maximum capacity produced every second" + "default": "1", + "unit": "percentage", + "tooltip": "How much you fill up every second" }, { "name": "Femcum storage factor", @@ -1486,9 +1486,9 @@ options = [ "name": "Passive milk production", "id": "baseLactationProduction", "type": "float", - "default": "0.001", - "unit": "volume", - "tooltip": "The fraction of your maximum capacity produced every second" + "default": "0.1", + "unit": "percentage", + "tooltip": "How much you fill up every second" }, { "name": "Milk storage scale", @@ -1618,9 +1618,9 @@ options = [ "name": "Passive gas production", "id": "baseGasProduction", "type": "float", - "default": "0.01", - "unit": "volume", - "tooltip": "The fraction of your maximum capacity produced every second" + "default": "1", + "unit": "percentage", + "tooltip": "How much you fill up every second" }, { "name": "Gas storage scale", @@ -1716,9 +1716,9 @@ options = [ "name": "Passive piss production", "id": "basePissProduction", "type": "float", - "default": "0.01", - "unit": "volume", - "tooltip": "The fraction of your maximum capacity produced every second" + "default": "1", + "unit": "percentage", + "tooltip": "How much you fill up every second" }, { "name": "Piss storage scale", @@ -1809,9 +1809,9 @@ options = [ "name": "Passive scat production", "id": "baseScatProduction", "type": "float", - "default": "0.001", - "unit": "volume", - "tooltip": "The fraction of your maximum capacity produced every second" + "default": "0.1", + "unit": "percentage", + "tooltip": "How much you fill up every second" }, { "name": "Scat storage scale", diff --git a/game.js b/game.js index bba5eaa..7e8e1d0 100644 --- a/game.js +++ b/game.js @@ -1336,7 +1336,7 @@ let macro = //macro controls every customizable part of the players body }, "fillCum": function(self) { - self.cumStorage.amount += self.scaling(self.baseCumProduction / 10 / 1000, self.scale * self.ballScale, 3); + self.cumStorage.amount += self.cumStorage.limit * self.baseCumProduction / 10 / 100; if (self.cumStorage.amount > self.cumStorage.limit) self.arouse(1 * (self.cumStorage.amount / self.cumStorage.limit - 1)); setTimeout(function () { self.fillCum(self); }, 100); @@ -1344,7 +1344,7 @@ let macro = //macro controls every customizable part of the players body }, "fillFemcum": function(self) { - self.femcumStorage.amount += self.scaling(self.baseFemcumProduction / 10 / 1000, self.scale * self.wombScale, 3); + self.femcumStorage.amount += self.femcumStorage.limit * self.baseFemcumProduction / 10 / 100; if (self.femcumStorage.amount > self.femcumStorage.limit) self.arouse(1 * (self.femcumStorage.amount / self.femcumStorage.limit - 1)); setTimeout(function () { self.fillFemcum(self); }, 100); @@ -1352,7 +1352,7 @@ let macro = //macro controls every customizable part of the players body }, "fillBreasts": function(self) { - self.milkStorage.amount += self.scaling(self.baseLactationProduction / 10 / 1000, self.scale * self.breastScale, 3); + self.milkStorage.amount += self.milkStorage.limit * self.baseLactationProduction / 10 / 100; if (self.milkStorage.amount > self.milkStorage.limit) { breast_milk(self.milkStorage.amount - self.milkStorage.limit/2); @@ -1366,7 +1366,7 @@ let macro = //macro controls every customizable part of the players body }, "fillGas": function(self) { - self.gasStorage.amount += self.scaling(self.baseGasProduction / 10 / 1000, self.scale, 3); + self.gasStorage.amount += self.gasStorage.limit * self.baseGasProduction / 10 / 100; let ratio = self.gasStorage.amount / self.gasStorage.limit; @@ -1399,7 +1399,7 @@ let macro = //macro controls every customizable part of the players body }, "fillPiss": function(self) { - self.pissStorage.amount += self.scaling(self.basePissProduction / 10 / 1000, self.scale, 3); + self.pissStorage.amount += self.pissStorage.limit * self.basePissProduction / 10 / 100; if (self.pissStorage.amount > self.pissStorage.limit * 2) piss(self.pissStorage.amount, false); @@ -1408,7 +1408,7 @@ let macro = //macro controls every customizable part of the players body }, "fillScat": function(self) { - self.scatStorage.amount += self.scaling(self.baseScatProduction / 10 / 1000, self.scale, 3); + self.scatStorage.amount += self.scatStorage.limit * self.baseScatProduction / 10 / 100; if (self.scatStorage.amount > self.scatStorage.limit * 2) scat(self.scatStorage.amount, false); @@ -5355,7 +5355,8 @@ function updatePreview(name) { result = volume(value * scale * scale * scale / 1000, unit); else if (unitType == "mass") result = mass(value * scale * scale * scale, unit); - + else if (unitType == "percentage") + result = value + "%"; document.getElementById(name + "Preview").innerHTML = result; } diff --git a/migrations.js b/migrations.js index 40b631f..829b7d4 100644 --- a/migrations.js +++ b/migrations.js @@ -6,6 +6,7 @@ migrations = [ // does nothing save => { }, + // 1 -> 2 // automatic digestion is now a subcategory, so anyone with @@ -35,8 +36,27 @@ migrations = [ save.cropTransferAuto = false; if (save.wingDigestTime == 0) save.wingDigestAuto = false; - } + }, + // 2 -> 3 + + // passive production is now written as percentage points; + // old values won't make sense anymore, so we'll just + // erase them + save => { + if (save.baseCumProduction) + delete save.baseCumProduction; + if (save.baseFemcumProduction) + delete save.baseFemcumProduction; + if (save.baseLactationProduction) + delete save.baseLactationProduction; + if (save.baseGasProduction) + delete save.baseGasProduction; + if (save.basePissProduction) + delete save.basePissProduction; + if (save.baseScatProduction) + delete save.baseScatProduction; + } ]; function migrate(save, target=null) {