From 3edbfd6916f2ff2dde76c1bf5fdd332773595e06 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 11 Nov 2021 20:09:38 -0500 Subject: [PATCH] wtf --- src/Corporation/Corporation.tsx | 10 +++++++++- src/Corporation/data/CorporationUnlockUpgrades.ts | 4 ++-- src/NetscriptFunctions.ts | 8 ++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Corporation/Corporation.tsx b/src/Corporation/Corporation.tsx index f5afa2558..2f6790c8b 100644 --- a/src/Corporation/Corporation.tsx +++ b/src/Corporation/Corporation.tsx @@ -148,7 +148,15 @@ export class Corporation { const totalDividends = (this.dividendPercentage / 100) * cycleProfit; const dividendsPerShare = totalDividends / this.totalShares; const dividends = this.numShares * dividendsPerShare * (1 - this.dividendTaxPercentage / 100); - return Math.pow(dividends, BitNodeMultipliers.CorporationSoftCap); + let upgrades = -0.15; + if (this.unlockUpgrades[5] === 1) { + upgrades += 0.05; + } + if (this.unlockUpgrades[6] === 1) { + upgrades += 0.1; + } + console.log(upgrades); + return Math.pow(dividends, BitNodeMultipliers.CorporationSoftCap + upgrades); } determineValuation(): number { diff --git a/src/Corporation/data/CorporationUnlockUpgrades.ts b/src/Corporation/data/CorporationUnlockUpgrades.ts index 57355a5f1..e0e81afe2 100644 --- a/src/Corporation/data/CorporationUnlockUpgrades.ts +++ b/src/Corporation/data/CorporationUnlockUpgrades.ts @@ -53,14 +53,14 @@ export const CorporationUnlockUpgrades: IMap = { ], "5": [ 5, - 500e9, + 500e12, "Shady Accounting", "Utilize unscrupulous accounting practices and pay off government officials to save money " + "on taxes. This reduces the dividend tax rate by 5%.", ], "6": [ 6, - 2e12, + 2e15, "Government Partnership", "Help national governments further their agendas in exchange for lowered taxes. " + "This reduces the dividend tax rate by 10%", diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 3df871269..440066dec 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -1294,9 +1294,9 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { // Return player's money workerScript.log( "getServerMoneyAvailable", - `returned player's money: ${numeralWrapper.formatMoney(Player.money.toNumber())}`, + `returned player's money: ${numeralWrapper.formatMoney(Player.money)}`, ); - return Player.money.toNumber(); + return Player.money; } workerScript.log( "getServerMoneyAvailable", @@ -1522,7 +1522,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { return ""; } - if (Player.money.lt(cost)) { + if (Player.money < cost) { workerScript.log( "purchaseServer", `Not enough money to purchase server. Need ${numeralWrapper.formatMoney(cost)}`, @@ -2126,7 +2126,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { company_rep_mult: Player.company_rep_mult, faction_rep_mult: Player.faction_rep_mult, numPeopleKilled: Player.numPeopleKilled, - money: Player.money.toNumber(), + money: Player.money, city: Player.city, location: Player.location, companyName: Player.companyName,