mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 05:33:54 +01:00
Fixed Corporation bug with businessFactor for Products
This commit is contained in:
parent
19c8972fb4
commit
f60fe597fb
4
dist/bundle.js
vendored
4
dist/bundle.js
vendored
@ -40414,6 +40414,7 @@ Industry.prototype.processMaterials = function(marketCycles=1, company) {
|
|||||||
var maxSell = (mat.qlt + .001) * mat.dmd * (100 - mat.cmp)/100 * markup * businessFactor *
|
var maxSell = (mat.qlt + .001) * mat.dmd * (100 - mat.cmp)/100 * markup * businessFactor *
|
||||||
Math.pow(this.awareness + 1, 0.05) * Math.pow(this.popularity + 1, 0.07) *
|
Math.pow(this.awareness + 1, 0.05) * Math.pow(this.popularity + 1, 0.07) *
|
||||||
(this.awareness === 0 ? 0.01 : Math.max((this.popularity + .001) / this.awareness, 0.01));
|
(this.awareness === 0 ? 0.01 : Math.max((this.popularity + .001) / this.awareness, 0.01));
|
||||||
|
|
||||||
var sellAmt;
|
var sellAmt;
|
||||||
if (mat.sllman[1] !== -1) {
|
if (mat.sllman[1] !== -1) {
|
||||||
//Sell amount is manually limited
|
//Sell amount is manually limited
|
||||||
@ -40427,7 +40428,7 @@ Industry.prototype.processMaterials = function(marketCycles=1, company) {
|
|||||||
console.log("ERROR: sellAmt is negative");
|
console.log("ERROR: sellAmt is negative");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sellAmt && sCost) {
|
if (sellAmt && sCost >= 0) {
|
||||||
mat.qty -= sellAmt;
|
mat.qty -= sellAmt;
|
||||||
revenue += (sellAmt * sCost);
|
revenue += (sellAmt * sCost);
|
||||||
mat.sll = sellAmt / (SecsPerMarketCycle * marketCycles);
|
mat.sll = sellAmt / (SecsPerMarketCycle * marketCycles);
|
||||||
@ -40620,6 +40621,7 @@ Industry.prototype.processProduct = function(marketCycles=1, product, corporatio
|
|||||||
markup = markupLimit / (product.sCost - product.pCost);
|
markup = markupLimit / (product.sCost - product.pCost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var businessFactor = 1 + (office.employeeProd[EmployeePositions.Business] / office.employeeProd["total"]);
|
||||||
var maxSell = Math.pow(product.rat, 0.95) * product.dmd * (1-(product.cmp/100)) *
|
var maxSell = Math.pow(product.rat, 0.95) * product.dmd * (1-(product.cmp/100)) *
|
||||||
markup * businessFactor * Math.pow(this.awareness + 1, 0.05) * Math.pow(this.popularity + 1, 0.07) *
|
markup * businessFactor * Math.pow(this.awareness + 1, 0.05) * Math.pow(this.popularity + 1, 0.07) *
|
||||||
(this.awareness === 0 ? 0.01 : Math.max((this.popularity + .001) / this.awareness, 0.01));
|
(this.awareness === 0 ? 0.01 : Math.max((this.popularity + .001) / this.awareness, 0.01));
|
||||||
|
@ -1127,6 +1127,7 @@ Industry.prototype.processMaterials = function(marketCycles=1, company) {
|
|||||||
var maxSell = (mat.qlt + .001) * mat.dmd * (100 - mat.cmp)/100 * markup * businessFactor *
|
var maxSell = (mat.qlt + .001) * mat.dmd * (100 - mat.cmp)/100 * markup * businessFactor *
|
||||||
Math.pow(this.awareness + 1, 0.05) * Math.pow(this.popularity + 1, 0.07) *
|
Math.pow(this.awareness + 1, 0.05) * Math.pow(this.popularity + 1, 0.07) *
|
||||||
(this.awareness === 0 ? 0.01 : Math.max((this.popularity + .001) / this.awareness, 0.01));
|
(this.awareness === 0 ? 0.01 : Math.max((this.popularity + .001) / this.awareness, 0.01));
|
||||||
|
|
||||||
var sellAmt;
|
var sellAmt;
|
||||||
if (mat.sllman[1] !== -1) {
|
if (mat.sllman[1] !== -1) {
|
||||||
//Sell amount is manually limited
|
//Sell amount is manually limited
|
||||||
@ -1140,7 +1141,7 @@ Industry.prototype.processMaterials = function(marketCycles=1, company) {
|
|||||||
console.log("ERROR: sellAmt is negative");
|
console.log("ERROR: sellAmt is negative");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sellAmt && sCost) {
|
if (sellAmt && sCost >= 0) {
|
||||||
mat.qty -= sellAmt;
|
mat.qty -= sellAmt;
|
||||||
revenue += (sellAmt * sCost);
|
revenue += (sellAmt * sCost);
|
||||||
mat.sll = sellAmt / (SecsPerMarketCycle * marketCycles);
|
mat.sll = sellAmt / (SecsPerMarketCycle * marketCycles);
|
||||||
@ -1333,6 +1334,7 @@ Industry.prototype.processProduct = function(marketCycles=1, product, corporatio
|
|||||||
markup = markupLimit / (product.sCost - product.pCost);
|
markup = markupLimit / (product.sCost - product.pCost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var businessFactor = 1 + (office.employeeProd[EmployeePositions.Business] / office.employeeProd["total"]);
|
||||||
var maxSell = Math.pow(product.rat, 0.95) * product.dmd * (1-(product.cmp/100)) *
|
var maxSell = Math.pow(product.rat, 0.95) * product.dmd * (1-(product.cmp/100)) *
|
||||||
markup * businessFactor * Math.pow(this.awareness + 1, 0.05) * Math.pow(this.popularity + 1, 0.07) *
|
markup * businessFactor * Math.pow(this.awareness + 1, 0.05) * Math.pow(this.popularity + 1, 0.07) *
|
||||||
(this.awareness === 0 ? 0.01 : Math.max((this.popularity + .001) / this.awareness, 0.01));
|
(this.awareness === 0 ? 0.01 : Math.max((this.popularity + .001) / this.awareness, 0.01));
|
||||||
|
Loading…
Reference in New Issue
Block a user