Browse Source

Change base production values to be percentages.

Old saves will have their base production values cleared.
tags/v1.1.0
Fen Dweller 5 years ago
parent
commit
75b0c71faf
3 changed files with 47 additions and 26 deletions
  1. +18
    -18
      features.js
  2. +8
    -7
      game.js
  3. +21
    -1
      migrations.js

+ 18
- 18
features.js View File

@@ -1192,9 +1192,9 @@ options = [
"name": "Passive cum production", "name": "Passive cum production",
"id": "baseCumProduction", "id": "baseCumProduction",
"type": "float", "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", "name": "Cum storage factor",
@@ -1357,9 +1357,9 @@ options = [
"name": "Passive femcum production", "name": "Passive femcum production",
"id": "baseFemcumProduction", "id": "baseFemcumProduction",
"type": "float", "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", "name": "Femcum storage factor",
@@ -1486,9 +1486,9 @@ options = [
"name": "Passive milk production", "name": "Passive milk production",
"id": "baseLactationProduction", "id": "baseLactationProduction",
"type": "float", "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", "name": "Milk storage scale",
@@ -1618,9 +1618,9 @@ options = [
"name": "Passive gas production", "name": "Passive gas production",
"id": "baseGasProduction", "id": "baseGasProduction",
"type": "float", "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", "name": "Gas storage scale",
@@ -1716,9 +1716,9 @@ options = [
"name": "Passive piss production", "name": "Passive piss production",
"id": "basePissProduction", "id": "basePissProduction",
"type": "float", "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", "name": "Piss storage scale",
@@ -1809,9 +1809,9 @@ options = [
"name": "Passive scat production", "name": "Passive scat production",
"id": "baseScatProduction", "id": "baseScatProduction",
"type": "float", "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", "name": "Scat storage scale",


+ 8
- 7
game.js View File

@@ -1336,7 +1336,7 @@ let macro = //macro controls every customizable part of the players body
}, },


"fillCum": function(self) { "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) if (self.cumStorage.amount > self.cumStorage.limit)
self.arouse(1 * (self.cumStorage.amount / self.cumStorage.limit - 1)); self.arouse(1 * (self.cumStorage.amount / self.cumStorage.limit - 1));
setTimeout(function () { self.fillCum(self); }, 100); setTimeout(function () { self.fillCum(self); }, 100);
@@ -1344,7 +1344,7 @@ let macro = //macro controls every customizable part of the players body
}, },


"fillFemcum": function(self) { "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) if (self.femcumStorage.amount > self.femcumStorage.limit)
self.arouse(1 * (self.femcumStorage.amount / self.femcumStorage.limit - 1)); self.arouse(1 * (self.femcumStorage.amount / self.femcumStorage.limit - 1));
setTimeout(function () { self.fillFemcum(self); }, 100); setTimeout(function () { self.fillFemcum(self); }, 100);
@@ -1352,7 +1352,7 @@ let macro = //macro controls every customizable part of the players body
}, },


"fillBreasts": function(self) { "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) { if (self.milkStorage.amount > self.milkStorage.limit) {
breast_milk(self.milkStorage.amount - self.milkStorage.limit/2); 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) { "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; 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) { "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) if (self.pissStorage.amount > self.pissStorage.limit * 2)
piss(self.pissStorage.amount, false); piss(self.pissStorage.amount, false);
@@ -1408,7 +1408,7 @@ let macro = //macro controls every customizable part of the players body
}, },


"fillScat": function(self) { "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) if (self.scatStorage.amount > self.scatStorage.limit * 2)
scat(self.scatStorage.amount, false); scat(self.scatStorage.amount, false);
@@ -5355,7 +5355,8 @@ function updatePreview(name) {
result = volume(value * scale * scale * scale / 1000, unit); result = volume(value * scale * scale * scale / 1000, unit);
else if (unitType == "mass") else if (unitType == "mass")
result = mass(value * scale * scale * scale, unit); result = mass(value * scale * scale * scale, unit);

else if (unitType == "percentage")
result = value + "%";
document.getElementById(name + "Preview").innerHTML = result; document.getElementById(name + "Preview").innerHTML = result;
} }




+ 21
- 1
migrations.js View File

@@ -6,6 +6,7 @@ migrations = [
// does nothing // does nothing
save => { save => {
}, },

// 1 -> 2 // 1 -> 2


// automatic digestion is now a subcategory, so anyone with // automatic digestion is now a subcategory, so anyone with
@@ -35,8 +36,27 @@ migrations = [
save.cropTransferAuto = false; save.cropTransferAuto = false;
if (save.wingDigestTime == 0) if (save.wingDigestTime == 0)
save.wingDigestAuto = false; 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) { function migrate(save, target=null) {


Loading…
Cancel
Save