dissalow corporations when multiplier is below 0.15

closes #3003
This commit is contained in:
phyzical 2022-04-01 21:05:01 +08:00
parent 1eca9449a0
commit 2efa3ac351
2 changed files with 10 additions and 2 deletions

@ -34,6 +34,7 @@ import { HacknetServer } from "../../Hacknet/HacknetServer";
import { GetServer } from "../../Server/AllServers";
import { ArcadeRoot } from "../../Arcade/ui/ArcadeRoot";
import { FactionNames } from "../../Faction/data/FactionNames";
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
type IProps = {
loc: Location;
@ -155,7 +156,11 @@ export function SpecialLocation(props: IProps): React.ReactElement {
if (!player.canAccessGrafting()) {
return <></>;
}
return <Button onClick={handleGrafting} sx={{ my: 5 }}>Enter the secret lab</Button>;
return (
<Button onClick={handleGrafting} sx={{ my: 5 }}>
Enter the secret lab
</Button>
);
}
function handleCotMG(): void {
@ -302,7 +307,7 @@ export function SpecialLocation(props: IProps): React.ReactElement {
return renderGrafting();
}
case LocationName.Sector12CityHall: {
return <CreateCorporation />;
return (BitNodeMultipliers.CorporationSoftCap >= 0.15 && <></>) || <CreateCorporation />;
}
case LocationName.Sector12NSA: {
return renderBladeburner();

@ -64,6 +64,7 @@ import { CorporationConstants } from "../Corporation/data/Constants";
import { IndustryUpgrades } from "../Corporation/IndustryUpgrades";
import { ResearchMap } from "../Corporation/ResearchMap";
import { Factions } from "../Faction/Factions";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
export function NetscriptCorporation(
player: IPlayer,
@ -74,6 +75,8 @@ export function NetscriptCorporation(
if (!player.canAccessCorporation() || player.hasCorporation()) return false;
if (!corporationName) return false;
if (player.bitNodeN !== 3 && !selfFund) throw new Error("cannot use seed funds outside of BitNode 3");
if (BitNodeMultipliers.CorporationSoftCap < 0.15)
throw new Error(`You cannot create a corporation for Bitnode ${player.bitNodeN}`);
if (selfFund) {
if (!player.canAfford(150e9)) return false;