with SLEEVE_8, fix workForFaction

This commit is contained in:
Olivier Gagnon 2022-03-20 23:27:53 -04:00
parent 05fe14a5ed
commit 699ae2e967
3 changed files with 9 additions and 88 deletions

@ -58,7 +58,9 @@ function bitNodeFinishedState(): boolean {
const wd = GetServer(SpecialServers.WorldDaemon); const wd = GetServer(SpecialServers.WorldDaemon);
if (!(wd instanceof Server)) return false; if (!(wd instanceof Server)) return false;
if (wd.backdoorInstalled) return true; if (wd.backdoorInstalled) return true;
return Player.bladeburner !== null && Player.bladeburner.blackops.hasOwnProperty(BlackOperationNames.OperationDaedalus); return (
Player.bladeburner !== null && Player.bladeburner.blackops.hasOwnProperty(BlackOperationNames.OperationDaedalus)
);
} }
function hasAccessToSF(player: PlayerObject, bn: number): boolean { function hasAccessToSF(player: PlayerObject, bn: number): boolean {
@ -564,7 +566,7 @@ export const achievements: IMap<Achievement> = {
...achievementData["SLEEVE_8"], ...achievementData["SLEEVE_8"],
Icon: "SLEEVE8", Icon: "SLEEVE8",
Visible: () => hasAccessToSF(Player, 10), Visible: () => hasAccessToSF(Player, 10),
Condition: () => Player.sleeves.length === 8, Condition: () => Player.sleeves.length === 8 && Player.sourceFileLvl(10) === 3,
}, },
INDECISIVE: { INDECISIVE: {
...achievementData["INDECISIVE"], ...achievementData["INDECISIVE"],

@ -43,6 +43,7 @@ import { calculateHackingTime } from "../Hacking";
import { Server } from "../Server/Server"; import { Server } from "../Server/Server";
import { netscriptCanHack } from "../Hacking/netscriptCanHack"; import { netscriptCanHack } from "../Hacking/netscriptCanHack";
import { FactionNames } from "../Faction/data/FactionNames"; import { FactionNames } from "../Faction/data/FactionNames";
import { FactionInfos } from "../Faction/FactionInfo";
export function NetscriptSingularity( export function NetscriptSingularity(
player: IPlayer, player: IPlayer,
@ -1038,93 +1039,12 @@ export function NetscriptSingularity(
const fac = Factions[name]; const fac = Factions[name];
// Arrays listing factions that allow each time of work // Arrays listing factions that allow each time of work
const hackAvailable = [
FactionNames.Illuminati as string,
FactionNames.Daedalus as string,
FactionNames.TheCovenant as string,
FactionNames.ECorp as string,
FactionNames.MegaCorp as string,
FactionNames.BachmanAssociates as string,
FactionNames.Bladeburners as string,
FactionNames.NWO as string,
FactionNames.ClarkeIncorporated as string,
FactionNames.OmniTekIncorporated as string,
FactionNames.FourSigma as string,
FactionNames.KuaiGongInternational as string,
FactionNames.FulcrumSecretTechnologies as string,
FactionNames.BitRunners as string,
FactionNames.TheBlackHand as string,
FactionNames.NiteSec as string,
FactionNames.Chongqing as string,
FactionNames.Sector12 as string,
FactionNames.NewTokyo as string,
FactionNames.Aevum as string,
FactionNames.Ishima as string,
FactionNames.Volhaven as string,
FactionNames.SpeakersForTheDead as string,
FactionNames.TheDarkArmy as string,
FactionNames.TheSyndicate as string,
FactionNames.Silhouette as string,
FactionNames.Netburners as string,
FactionNames.TianDiHui as string,
FactionNames.CyberSec as string,
];
const fdWkAvailable = [
FactionNames.Illuminati as string,
FactionNames.Daedalus as string,
FactionNames.TheCovenant as string,
FactionNames.ECorp as string,
FactionNames.MegaCorp as string,
FactionNames.BachmanAssociates as string,
FactionNames.Bladeburners as string,
FactionNames.NWO as string,
FactionNames.ClarkeIncorporated as string,
FactionNames.OmniTekIncorporated as string,
FactionNames.FourSigma as string,
FactionNames.KuaiGongInternational as string,
FactionNames.TheBlackHand as string,
FactionNames.Chongqing as string,
FactionNames.Sector12 as string,
FactionNames.NewTokyo as string,
FactionNames.Aevum as string,
FactionNames.Ishima as string,
FactionNames.Volhaven as string,
FactionNames.SpeakersForTheDead as string,
FactionNames.TheDarkArmy as string,
FactionNames.TheSyndicate as string,
FactionNames.Silhouette as string,
FactionNames.Tetrads as string,
FactionNames.SlumSnakes as string,
];
const scWkAvailable = [
FactionNames.ECorp as string,
FactionNames.MegaCorp as string,
FactionNames.BachmanAssociates as string,
FactionNames.Bladeburners as string,
FactionNames.NWO as string,
FactionNames.ClarkeIncorporated as string,
FactionNames.OmniTekIncorporated as string,
FactionNames.FourSigma as string,
FactionNames.KuaiGongInternational as string,
FactionNames.FulcrumSecretTechnologies as string,
FactionNames.Chongqing as string,
FactionNames.Sector12 as string,
FactionNames.NewTokyo as string,
FactionNames.Aevum as string,
FactionNames.Ishima as string,
FactionNames.Volhaven as string,
FactionNames.SpeakersForTheDead as string,
FactionNames.TheSyndicate as string,
FactionNames.Tetrads as string,
FactionNames.SlumSnakes as string,
FactionNames.TianDiHui as string,
];
switch (type.toLowerCase()) { switch (type.toLowerCase()) {
case "hacking": case "hacking":
case "hacking contracts": case "hacking contracts":
case "hackingcontracts": case "hackingcontracts":
if (!hackAvailable.includes(fac.name)) { if (!FactionInfos[fac.name].offerHackingWork) {
workerScript.log("workForFaction", () => `Faction '${fac.name}' do not need help with hacking contracts.`); workerScript.log("workForFaction", () => `Faction '${fac.name}' do not need help with hacking contracts.`);
return false; return false;
} }
@ -1141,7 +1061,7 @@ export function NetscriptSingularity(
case "field": case "field":
case "fieldwork": case "fieldwork":
case "field work": case "field work":
if (!fdWkAvailable.includes(fac.name)) { if (!FactionInfos[fac.name].offerFieldWork) {
workerScript.log("workForFaction", () => `Faction '${fac.name}' do not need help with field missions.`); workerScript.log("workForFaction", () => `Faction '${fac.name}' do not need help with field missions.`);
return false; return false;
} }
@ -1158,7 +1078,7 @@ export function NetscriptSingularity(
case "security": case "security":
case "securitywork": case "securitywork":
case "security work": case "security work":
if (!scWkAvailable.includes(fac.name)) { if (!FactionInfos[fac.name].offerSecurityWork) {
workerScript.log("workForFaction", () => `Faction '${fac.name}' do not need help with security work.`); workerScript.log("workForFaction", () => `Faction '${fac.name}' do not need help with security work.`);
return false; return false;
} }

@ -66,8 +66,7 @@ export function AlertManager(): React.ReactElement {
{alerts.length > 0 && ( {alerts.length > 0 && (
<Modal open={true} onClose={close}> <Modal open={true} onClose={close}>
<Box overflow="scroll" sx={{ overflowWrap: "break-word", whiteSpace: "pre-line" }}> <Box overflow="scroll" sx={{ overflowWrap: "break-word", whiteSpace: "pre-line" }}>
{typeof alerts[0].text === "string" && <Typography>{alerts[0].text}</Typography>} <Typography>{alerts[0].text}</Typography>
{typeof alerts[0].text !== "string" && alerts[0].text}
</Box> </Box>
</Modal> </Modal>
)} )}