CORPORATION: Use different term for dividend modifier instead of tax (#2237)

This commit is contained in:
catloversg
2025-07-12 02:55:46 +07:00
committed by GitHub
parent 3fc65a2de4
commit f182030385
15 changed files with 92 additions and 37 deletions

View File

@@ -1,13 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CorporationInfo](./bitburner.corporationinfo.md) &gt; [dividendTax](./bitburner.corporationinfo.dividendtax.md)
## CorporationInfo.dividendTax property
Tax applied on your earnings as a shareholder
**Signature:**
```typescript
dividendTax: number;
```

View File

@@ -18,7 +18,6 @@ interface CorporationInfo
| --- | --- | --- | --- |
| [dividendEarnings](./bitburner.corporationinfo.dividendearnings.md) | | number | Your earnings as a shareholder per second this cycle |
| [dividendRate](./bitburner.corporationinfo.dividendrate.md) | | number | Fraction of profits issued as dividends |
| [dividendTax](./bitburner.corporationinfo.dividendtax.md) | | number | Tax applied on your earnings as a shareholder |
| [divisions](./bitburner.corporationinfo.divisions.md) | | string\[\] | Array of all division names |
| [expenses](./bitburner.corporationinfo.expenses.md) | | number | Expenses per second this cycle |
| [funds](./bitburner.corporationinfo.funds.md) | | number | Funds available |
@@ -34,5 +33,6 @@ interface CorporationInfo
| [sharePrice](./bitburner.corporationinfo.shareprice.md) | | number | Price of the shares |
| [shareSaleCooldown](./bitburner.corporationinfo.sharesalecooldown.md) | | number | Cooldown until shares can be sold again |
| [totalShares](./bitburner.corporationinfo.totalshares.md) | | number | Total number of shares issued by this corporation. |
| [tributeModifier](./bitburner.corporationinfo.tributemodifier.md) | | number | Your income from dividend is negatively affected by this penalty modifier |
| [valuation](./bitburner.corporationinfo.valuation.md) | | number | Corporation valuation |

View File

@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CorporationInfo](./bitburner.corporationinfo.md) &gt; [tributeModifier](./bitburner.corporationinfo.tributemodifier.md)
## CorporationInfo.tributeModifier property
Your income from dividend is negatively affected by this penalty modifier
**Signature:**
```typescript
tributeModifier: number;
```

View File

@@ -309,7 +309,7 @@
"CORPORATION_BRIBE": {
"ID": "CORPORATION_BRIBE",
"Name": "Lobbying is great!",
"Description": "Lower your taxes through lobbying."
"Description": "Lower your tribute through lobbying."
},
"CORPORATION_PROD_1000": {
"ID": "CORPORATION_PROD_1000",

View File

@@ -20,6 +20,7 @@ import { formatMoney } from "../ui/formatNumber";
import { isPositiveInteger, type Result } from "../types";
import { createEnumKeyedRecord, getRecordValues } from "../Types/Record";
import { getKeyList } from "../utils/helpers/getKeyList";
import { assertObject } from "../utils/TypeAssertion";
export const CorporationPromise: PromisePair<CorpStateName> = { promise: null, resolve: null };
@@ -50,7 +51,7 @@ export class Corporation {
shareSaleCooldown = 0; // Game cycles until player can sell shares again
issueNewSharesCooldown = 0; // Game cycles until player can issue shares again
dividendRate = 0;
dividendTax = 1 - currentNodeMults.CorporationSoftcap + 0.15;
tributeModifier = 1 - currentNodeMults.CorporationSoftcap + 0.15;
investorShares = 0;
issuedShares = 0;
sharePrice = 0;
@@ -191,7 +192,7 @@ export class Corporation {
const totalDividends = this.dividendRate * cycleProfit;
const dividendsPerShare = totalDividends / this.totalShares;
const dividends = this.numShares * dividendsPerShare;
return Math.pow(dividends, 1 - this.dividendTax);
return Math.pow(dividends, 1 - this.tributeModifier);
}
determineCycleValuation(): number {
@@ -390,10 +391,10 @@ export class Corporation {
// Apply effects for one-time unlocks
if (unlockName === CorpUnlockName.ShadyAccounting) {
this.dividendTax -= 0.05;
this.tributeModifier -= 0.05;
}
if (unlockName === CorpUnlockName.GovernmentPartnership) {
this.dividendTax -= 0.1;
this.tributeModifier -= 0.1;
}
return {
success: true,
@@ -504,6 +505,11 @@ export class Corporation {
corporation.numberOfOfficesAndWarehouses += getRecordValues(division.offices).length;
corporation.numberOfOfficesAndWarehouses += getRecordValues(division.warehouses).length;
}
// tributeModifier is divisionTax in pre-v3.0.0.
assertObject(value.data);
if (typeof value.data.dividendTax === "number") {
corporation.tributeModifier = value.data.dividendTax;
}
return corporation;
}
}

View File

@@ -60,15 +60,15 @@ export const CorpUnlocks: Record<CorpUnlockName, CorpUnlock> = {
price: 500e12,
desc:
"Utilize unscrupulous accounting practices and pay off government officials to save money " +
"on taxes. This reduces the dividend tax rate by 5%.",
"on tribute. This reduces the tribute modifier by 0.05.",
},
[CorpUnlockName.GovernmentPartnership]: {
name: CorpUnlockName.GovernmentPartnership,
price: 2e15,
desc:
"Help national governments further their agendas in exchange for lowered taxes. " +
"This reduces the dividend tax rate by 10%",
"Help national governments further their agendas in exchange for lowered tribute. " +
"This reduces the tribute modifier by 0.1",
},
[CorpUnlockName.WarehouseAPI]: {

View File

@@ -1,5 +1,6 @@
// React Component for displaying Corporation Overview info
import React, { useState } from "react";
import { MathJax } from "better-react-mathjax";
import { LevelableUpgrade } from "./LevelableUpgrade";
import { Unlock } from "./Unlock";
import { BribeFactionModal } from "./modals/BribeFactionModal";
@@ -33,6 +34,8 @@ import { getRecordKeys } from "../../Types/Record";
import { PositiveInteger } from "../../types";
import { ButtonWithTooltip } from "../../ui/Components/ButtonWithTooltip";
import { CreateCorporationModal } from "./modals/CreateCorporationModal";
import InfoIcon from "@mui/icons-material/Info";
import { CorruptibleText } from "../../ui/React/CorruptibleText";
interface IProps {
rerender: () => void;
@@ -362,7 +365,46 @@ function DividendsStats({ profit }: IDividendsStatsProps): React.ReactElement {
["Retained Profits (after dividends):", <MoneyRate key="profits" money={retainedEarnings} />],
["Dividend Percentage:", formatPercent(corp.dividendRate, 0)],
["Dividends per share:", <MoneyRate key="dividends" money={dividendsPerShare} />],
["Your earnings as a shareholder:", <MoneyRate key="earnings" money={playerEarnings} />],
[
<>
<Tooltip
title={
<>
Everything comes with a price.
<br />
<br />
Although your corporation grants you unlimited wealth, nobody dares try to sabotage your corporation
and take that wealth away from you. Why? All (alive) CEOs know this unspoken rule: If you pay a
"small" tribute to "them", "they" will protect you. Just a small free, and you are safe. Guaranteed.
<br />
<br />
Who are "they"? Nobody knows for certain. There is a rumour that they are{" "}
<CorruptibleText content={"||| BUFFER OVERFLOW DETECTED |||"} spoiler={true} />.
<br />
<br />
Due to this tribute, your dividend is negatively affected by a penalty modifier called
"TributeModifier". Formulas:
<br />
<br />
<MathJax>{`\\(TotalDividends = DividendRate\\ast(Revenue - Expenses)\\ast 10\\)`}</MathJax>
<br />
<MathJax>{`\\(Dividend = \\left(OwnedShares\\ast\\frac{TotalDividends}{TotalShares}\\right)^{1 - TributeModifier}\\)`}</MathJax>
</>
}
>
<div
style={{
display: "flex",
alignItems: "center",
}}
>
Your earnings as a shareholder:
<InfoIcon sx={{ fontSize: "1.1em", marginLeft: "10px" }} />
</div>
</Tooltip>
</>,
<MoneyRate key="earnings" money={playerEarnings} />,
],
]}
/>
);

View File

@@ -65,7 +65,7 @@ export function IssueDividendsModal(props: IProps): React.ReactElement {
<b>Example:</b> Assume your corporation makes <MoneyRate money={100e6} /> in profit and you allocate 40% of that
towards dividends. That means your corporation will gain <MoneyRate money={60e6} /> in funds and the remaining{" "}
<MoneyRate money={40e6} /> will be paid as dividends. Since your corporation starts with 1 billion shares, every
shareholder will be paid <Money money={0.04} /> per share per second before taxes.
shareholder will be paid <Money money={0.04} /> per share per second before tribute.
</Typography>
<br />
<TextField

View File

@@ -32,7 +32,7 @@ Go public and set a dividend.
#### Why is my "earnings as a shareholder" lower than my calculation ("Dividends per share" \* "Owned Stock Shares")?
You have to pay tax. ShadyAccounting and GovernmentPartnership reduce tax. Check this [section](./financial-statement.md) for details.
Your dividend is negatively affected by a penalty modifier called "tribute modifier". `ShadyAccounting` and `GovernmentPartnership` reduce this penalty modifier. Check this [section](./financial-statement.md) for details.
#### All corporation APIs require too much RAM. How do I deal with it?

View File

@@ -75,21 +75,21 @@ Analyses:
- `AssetDelta` is multiplied by 315000, so it is the main source of offer.
- Assuming that we can sell all produced units and not buy more boost materials, `AssetDelta` is the delta of funds, and the delta of funds is profit. This is why we try our best to improve profit.
## Dividend
## Dividend and Tribute modifier
`DividendTax` depends on `CorporationSoftcap`. In BN3, `CorporationSoftcap` is 1.
Your dividend is negatively affected by a penalty modifier called `TributeModifier`. `TributeModifier` depends on `CorporationSoftcap`. In BN3, `CorporationSoftcap` is 1.
$$DividendTax = 1 - CorporationSoftcap + 0.15$$
$$TributeModifier = 1.15 - CorporationSoftcap$$
`ShadyAccounting` reduces `DividendTax` by 0.05.
`ShadyAccounting` reduces `TributeModifier` by 0.05.
`GovernmentPartnership` reduces `DividendTax` by 0.1.
`GovernmentPartnership` reduces `TributeModifier` by 0.1.
Formula:
$$TotalDividends = DividendRate\ast(Revenue - Expenses)\ast 10$$
$$Dividend = \left(OwnedShares\ast\frac{TotalDividends}{TotalShares}\right)^{1 - DividendTax}$$
$$Dividend = \left(OwnedShares\ast\frac{TotalDividends}{TotalShares}\right)^{1 - TributeModifier}$$
Retained earning:

View File

@@ -348,7 +348,6 @@ import nsDoc_bitburner_corporation_selldivision_md from "../../markdown/bitburne
import nsDoc_bitburner_corporation_sellshares_md from "../../markdown/bitburner.corporation.sellshares.md?raw";
import nsDoc_bitburner_corporationinfo_dividendearnings_md from "../../markdown/bitburner.corporationinfo.dividendearnings.md?raw";
import nsDoc_bitburner_corporationinfo_dividendrate_md from "../../markdown/bitburner.corporationinfo.dividendrate.md?raw";
import nsDoc_bitburner_corporationinfo_dividendtax_md from "../../markdown/bitburner.corporationinfo.dividendtax.md?raw";
import nsDoc_bitburner_corporationinfo_divisions_md from "../../markdown/bitburner.corporationinfo.divisions.md?raw";
import nsDoc_bitburner_corporationinfo_expenses_md from "../../markdown/bitburner.corporationinfo.expenses.md?raw";
import nsDoc_bitburner_corporationinfo_funds_md from "../../markdown/bitburner.corporationinfo.funds.md?raw";
@@ -365,6 +364,7 @@ import nsDoc_bitburner_corporationinfo_revenue_md from "../../markdown/bitburner
import nsDoc_bitburner_corporationinfo_shareprice_md from "../../markdown/bitburner.corporationinfo.shareprice.md?raw";
import nsDoc_bitburner_corporationinfo_sharesalecooldown_md from "../../markdown/bitburner.corporationinfo.sharesalecooldown.md?raw";
import nsDoc_bitburner_corporationinfo_totalshares_md from "../../markdown/bitburner.corporationinfo.totalshares.md?raw";
import nsDoc_bitburner_corporationinfo_tributemodifier_md from "../../markdown/bitburner.corporationinfo.tributemodifier.md?raw";
import nsDoc_bitburner_corporationinfo_valuation_md from "../../markdown/bitburner.corporationinfo.valuation.md?raw";
import nsDoc_bitburner_corpproductdata_desc_md from "../../markdown/bitburner.corpproductdata.desc.md?raw";
import nsDoc_bitburner_corpproductdata_md from "../../markdown/bitburner.corpproductdata.md?raw";
@@ -1847,7 +1847,6 @@ AllPages["nsDoc/bitburner.corporation.selldivision.md"] = nsDoc_bitburner_corpor
AllPages["nsDoc/bitburner.corporation.sellshares.md"] = nsDoc_bitburner_corporation_sellshares_md;
AllPages["nsDoc/bitburner.corporationinfo.dividendearnings.md"] = nsDoc_bitburner_corporationinfo_dividendearnings_md;
AllPages["nsDoc/bitburner.corporationinfo.dividendrate.md"] = nsDoc_bitburner_corporationinfo_dividendrate_md;
AllPages["nsDoc/bitburner.corporationinfo.dividendtax.md"] = nsDoc_bitburner_corporationinfo_dividendtax_md;
AllPages["nsDoc/bitburner.corporationinfo.divisions.md"] = nsDoc_bitburner_corporationinfo_divisions_md;
AllPages["nsDoc/bitburner.corporationinfo.expenses.md"] = nsDoc_bitburner_corporationinfo_expenses_md;
AllPages["nsDoc/bitburner.corporationinfo.funds.md"] = nsDoc_bitburner_corporationinfo_funds_md;
@@ -1864,6 +1863,7 @@ AllPages["nsDoc/bitburner.corporationinfo.revenue.md"] = nsDoc_bitburner_corpora
AllPages["nsDoc/bitburner.corporationinfo.shareprice.md"] = nsDoc_bitburner_corporationinfo_shareprice_md;
AllPages["nsDoc/bitburner.corporationinfo.sharesalecooldown.md"] = nsDoc_bitburner_corporationinfo_sharesalecooldown_md;
AllPages["nsDoc/bitburner.corporationinfo.totalshares.md"] = nsDoc_bitburner_corporationinfo_totalshares_md;
AllPages["nsDoc/bitburner.corporationinfo.tributemodifier.md"] = nsDoc_bitburner_corporationinfo_tributemodifier_md;
AllPages["nsDoc/bitburner.corporationinfo.valuation.md"] = nsDoc_bitburner_corporationinfo_valuation_md;
AllPages["nsDoc/bitburner.corpproductdata.desc.md"] = nsDoc_bitburner_corpproductdata_desc_md;
AllPages["nsDoc/bitburner.corpproductdata.md"] = nsDoc_bitburner_corpproductdata_md;

View File

@@ -726,7 +726,7 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
issueNewSharesCooldown: corporation.issueNewSharesCooldown,
sharePrice: corporation.sharePrice,
dividendRate: corporation.dividendRate,
dividendTax: corporation.dividendTax,
tributeModifier: corporation.tributeModifier,
dividendEarnings: corporation.getCycleDividends() / corpConstants.secondsPerMarketCycle,
nextState: corporation.state.nextName,
prevState: corporation.state.prevName,

View File

@@ -9728,8 +9728,8 @@ interface CorporationInfo {
sharePrice: number;
/** Fraction of profits issued as dividends */
dividendRate: number;
/** Tax applied on your earnings as a shareholder */
dividendTax: number;
/** Your income from dividend is negatively affected by this penalty modifier */
tributeModifier: number;
/** Your earnings as a shareholder per second this cycle */
dividendEarnings: number;
/** The next state to be processed.

View File

@@ -215,5 +215,12 @@ export const breakingChanges300: VersionBreakingChange = {
info: 'The "DreamSense" upgrade was removed. The cost of that upgrade was refunded.',
showPopUp: false,
},
{
brokenAPIs: [{ name: "dividendTax", migration: { searchValue: "dividendTax", replaceValue: "tributeModifier" } }],
info:
"ns.corporation.getCorporation().dividendTax was removed.\n" +
'It has been automatically replaced with "ns.corporation.getCorporation().tributeModifier".',
showPopUp: false,
},
],
};

View File

@@ -291,7 +291,6 @@ exports[`Check Save File Continuity PlayerSave continuity 1`] = `
"data": {
"cycleValuation": 0,
"dividendRate": 0,
"dividendTax": 0.15,
"divisions": {
"ctor": "JSONMap",
"data": [],
@@ -321,6 +320,7 @@ exports[`Check Save File Continuity PlayerSave continuity 1`] = `
"storedCycles": 0,
"totalAssets": 150000000000,
"totalShares": 1000000000,
"tributeModifier": 0.15,
"unlocks": {
"ctor": "JSONSet",
"data": [],