mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 09:13:52 +01:00
Change the calculation of valuation (#1056)
This commit is contained in:
parent
903f812424
commit
65214c0322
@ -199,6 +199,11 @@ export class Corporation {
|
||||
assetDelta = (this.totalAssets - this.previousTotalAssets) / corpConstants.secondsPerMarketCycle;
|
||||
// Handle pre-totalAssets saves
|
||||
assetDelta ??= this.revenue - this.expenses;
|
||||
const numberOfOfficesAndWarehouses = [...this.divisions.values()]
|
||||
.map(
|
||||
(division: Division) => getRecordValues(division.offices).length + getRecordValues(division.warehouses).length,
|
||||
)
|
||||
.reduce((sum: number, currentValue: number) => sum + currentValue, 0);
|
||||
if (this.public) {
|
||||
// Account for dividends
|
||||
if (this.dividendRate > 0) {
|
||||
@ -206,14 +211,14 @@ export class Corporation {
|
||||
}
|
||||
|
||||
val = this.funds + assetDelta * 85e3;
|
||||
val *= Math.pow(1.1, this.divisions.size);
|
||||
val *= Math.pow(Math.pow(1.1, 1 / 12), numberOfOfficesAndWarehouses);
|
||||
val = Math.max(val, 0);
|
||||
} else {
|
||||
val = 10e9 + this.funds / 3;
|
||||
if (assetDelta > 0) {
|
||||
val += assetDelta * 315e3;
|
||||
}
|
||||
val *= Math.pow(1.1, this.divisions.size);
|
||||
val *= Math.pow(Math.pow(1.1, 1 / 12), numberOfOfficesAndWarehouses);
|
||||
val -= val % 1e6; //Round down to nearest million
|
||||
}
|
||||
if (val < 10e9) val = 10e9; // Base valuation
|
||||
|
Loading…
Reference in New Issue
Block a user