Limit shareholder reservation on new shares relative to ownership

Updated the computations for issuing new corp shares so that
private investors cannot purchase a greater percentage of the
company than they already own. This change is an indirect buff
to corporations that elect not to use as many private investors
as possible.

Also updated UI elements to reflect the change. I'm not sure about
the wording I chose; I think it could be improved upon, but that
was the best I came up with.
This commit is contained in:
Undeemiss 2022-04-16 12:11:05 -05:00
parent 0fda1ecabf
commit f3bf872b23

@ -73,24 +73,31 @@ export function IssueNewSharesModal(props: IProps): React.ReactElement {
const profit = newShares * newSharePrice; const profit = newShares * newSharePrice;
corp.issueNewSharesCooldown = CorporationConstants.IssueNewSharesCooldown; corp.issueNewSharesCooldown = CorporationConstants.IssueNewSharesCooldown;
corp.totalShares += newShares;
// Determine how many are bought by private investors // Determine how many are bought by private investors
// Private investors get up to 50% at most // If private investors own n% of the company, private investors get up to 0.5n% at most
// Round # of private shares to the nearest millionth // Round # of private shares to the nearest million
let privateShares = getRandomInt(0, Math.round(newShares / 2)); const privateOwnedRatio = 1 - (corp.numShares + corp.issuedShares) / corp.totalShares;
privateShares = Math.round(privateShares / 1e6) * 1e6; const maxPrivateShares = Math.round((newShares / 2) * privateOwnedRatio);
const privateShares = Math.round(getRandomInt(0, maxPrivateShares) / 1e6) * 1e6;
corp.issuedShares += newShares - privateShares; corp.issuedShares += newShares - privateShares;
corp.totalShares += newShares;
corp.funds = corp.funds + profit; corp.funds = corp.funds + profit;
corp.immediatelyUpdateSharePrice(); corp.immediatelyUpdateSharePrice();
props.onClose(); props.onClose();
dialogBoxCreate(
`Issued ${numeralWrapper.format(newShares, "0.000a")} and raised ` + let dialogContents =
`${numeralWrapper.formatMoney(profit)}. ${numeralWrapper.format(privateShares, "0.000a")} ` + `Issued ${numeralWrapper.format(newShares, "0.000a")} new shares` +
`of these shares were bought by private investors.<br><br>` + ` and raised ${numeralWrapper.formatMoney(profit)}.`;
`Stock price decreased to ${numeralWrapper.formatMoney(corp.sharePrice)}`, if (privateShares > 0) {
); dialogContents += `<br>${numeralWrapper.format(
privateShares,
"0.000a",
)} of these shares were bought by private investors.`;
}
dialogContents += `<br><br>Stock price decreased to ${numeralWrapper.formatMoney(corp.sharePrice)}`;
dialogBoxCreate(dialogContents);
} }
function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void { function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {
@ -119,9 +126,9 @@ export function IssueNewSharesModal(props: IProps): React.ReactElement {
&nbsp;* Number of new shares issued must be a multiple of 10 million &nbsp;* Number of new shares issued must be a multiple of 10 million
<br /> <br />
<br /> <br />
When you choose to issue new equity, private shareholders have first priority for up to 50% of the new shares. When you choose to issue new equity, private shareholders have first priority for up to 0.5n% of the new shares,
If they choose to exercise this option, these newly issued shares become private, restricted shares, which means where n is the percentage of the company currently owned by private shareholders. If they choose to exercise
you cannot buy them back. this option, these newly issued shares become private, restricted shares, which means you cannot buy them back.
</Typography> </Typography>
<EffectText shares={shares} /> <EffectText shares={shares} />
<TextField autoFocus placeholder="# New Shares" onChange={onChange} onKeyDown={onKeyDown} /> <TextField autoFocus placeholder="# New Shares" onChange={onChange} onKeyDown={onKeyDown} />