mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 12:45:45 +01:00
Remove cooldown from "Sell corporation and start over" (#919)
This commit is contained in:
parent
f2baa04f45
commit
34cc0441c2
@ -21,9 +21,10 @@ import { createEnumKeyedRecord, getRecordValues } from "../Types/Record";
|
||||
|
||||
export const CorporationResolvers: ((prevState: CorpStateName) => void)[] = [];
|
||||
|
||||
interface IParams {
|
||||
interface ICorporationParams {
|
||||
name?: string;
|
||||
seedFunded?: boolean;
|
||||
shareSaleCooldown?: number;
|
||||
}
|
||||
|
||||
export class Corporation {
|
||||
@ -70,9 +71,10 @@ export class Corporation {
|
||||
|
||||
state = new CorporationState();
|
||||
|
||||
constructor(params: IParams = {}) {
|
||||
constructor(params: ICorporationParams = {}) {
|
||||
this.name = params.name || "The Corporation";
|
||||
this.seedFunded = params.seedFunded ?? false;
|
||||
this.shareSaleCooldown = params.shareSaleCooldown ?? 0;
|
||||
}
|
||||
|
||||
addFunds(amt: number): void {
|
||||
|
@ -319,22 +319,13 @@ function SellDivisionButton(): React.ReactElement {
|
||||
function RestartButton(): React.ReactElement {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const corp = useCorporation();
|
||||
const sellSharesOnCd = corp.shareSaleCooldown > 0;
|
||||
|
||||
function restart(): void {
|
||||
setOpen(true);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ButtonWithTooltip
|
||||
normalTooltip={"Sell corporation and start over"}
|
||||
disabledTooltip={
|
||||
sellSharesOnCd ? "Sell corporation and start over. Cannot do this while Sell Shares is on cooldown." : ""
|
||||
}
|
||||
onClick={restart}
|
||||
>
|
||||
<ButtonWithTooltip normalTooltip={"Sell corporation and start over"} onClick={restart}>
|
||||
Sell CEO position
|
||||
</ButtonWithTooltip>
|
||||
<SellCorporationModal open={open} onClose={() => setOpen(false)} />
|
||||
|
@ -61,7 +61,7 @@ export function SellSharesModal(props: IProps): React.ReactElement {
|
||||
<li>Selling shares will cause stock price to fall due to market forces.</li>
|
||||
<li>The money from selling your shares will go directly to you (NOT your Corporation).</li>
|
||||
<li>
|
||||
You will not be able to sell shares again (or dissolve the corporation) for{" "}
|
||||
You will not be able to sell shares again for{" "}
|
||||
<b>{corp.convertCooldownToString(corpConstants.sellSharesCooldown)}</b>.
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -12,6 +12,7 @@ export function startCorporation(this: PlayerObject, corpName: string, seedFunde
|
||||
this.corporation = new Corporation({
|
||||
name: corpName,
|
||||
seedFunded: seedFunded,
|
||||
shareSaleCooldown: this.corporation?.shareSaleCooldown,
|
||||
});
|
||||
//reset the research tree in case the corporation was restarted
|
||||
resetIndustryResearchTrees();
|
||||
|
Loading…
Reference in New Issue
Block a user