2021-04-29 02:07:26 +02:00
|
|
|
import { Milestone } from "./Milestone";
|
|
|
|
import { IPlayer } from "../PersonObjects/IPlayer";
|
|
|
|
import { Factions } from "../Faction/Factions";
|
|
|
|
import { Faction } from "../Faction/Faction";
|
|
|
|
import { GetServerByHostname } from "../Server/ServerHelpers";
|
|
|
|
|
|
|
|
function allFactionAugs(p: IPlayer, f: Faction): boolean {
|
2021-09-05 01:09:30 +02:00
|
|
|
const factionAugs = f.augmentations
|
|
|
|
.slice()
|
|
|
|
.filter((aug) => aug !== "NeuroFlux Governor");
|
|
|
|
for (const factionAug of factionAugs) {
|
|
|
|
if (
|
|
|
|
!p.augmentations.some((aug) => {
|
|
|
|
return aug.name == factionAug;
|
|
|
|
})
|
|
|
|
)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2021-04-29 02:07:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export const Milestones: Milestone[] = [
|
2021-09-05 01:09:30 +02:00
|
|
|
{
|
|
|
|
title: "Gain root access on CSEC",
|
|
|
|
fulfilled: (): boolean => {
|
|
|
|
const server = GetServerByHostname("CSEC");
|
|
|
|
if (!server || !server.hasOwnProperty("hasAdminRights")) return false;
|
|
|
|
return (server as any).hasAdminRights;
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Install the backdoor on CSEC",
|
|
|
|
fulfilled: (): boolean => {
|
|
|
|
const server = GetServerByHostname("CSEC");
|
|
|
|
if (!server || !server.hasOwnProperty("backdoorInstalled")) return false;
|
|
|
|
return (server as any).backdoorInstalled;
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Join the faction hinted at in csec-test.msg",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
return p.factions.includes("CyberSec");
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Install all the Augmentations from CyberSec",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
return allFactionAugs(p, Factions["CyberSec"]);
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Join the faction hinted at in nitesec-test.msg",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
return p.factions.includes("NiteSec");
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Install all the Augmentations from NiteSec",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
return allFactionAugs(p, Factions["NiteSec"]);
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Join the faction hinted at in j3.msg",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
return p.factions.includes("The Black Hand");
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Install all the Augmentations from The Black Hand",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
return allFactionAugs(p, Factions["The Black Hand"]);
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Join the faction hinted at in 19dfj3l1nd.msg",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
return p.factions.includes("BitRunners");
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Install all the Augmentations from BitRunners",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
return allFactionAugs(p, Factions["BitRunners"]);
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Complete fl1ght.exe",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
// technically wrong but whatever
|
|
|
|
return p.factions.includes("Daedalus");
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Install the special Augmentation from Daedalus",
|
|
|
|
fulfilled: (p: IPlayer): boolean => {
|
|
|
|
return p.augmentations.some((aug) => aug.name == "The Red Pill");
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Install the final backdoor and free yourself.",
|
|
|
|
fulfilled: (): boolean => {
|
|
|
|
return false;
|
2021-04-29 02:07:26 +02:00
|
|
|
},
|
2021-09-05 01:09:30 +02:00
|
|
|
},
|
|
|
|
];
|