Refactored icarus.msg check

This commit is contained in:
Undeemiss 2022-04-12 20:47:00 -05:00
parent 001e8f6d06
commit 0d26976f1a

@ -1,5 +1,4 @@
import { Message } from "./Message"; import { Message } from "./Message";
import { Augmentations } from "../Augmentation/Augmentations";
import { AugmentationNames } from "../Augmentation/data/AugmentationNames"; import { AugmentationNames } from "../Augmentation/data/AugmentationNames";
import { Router } from "../ui/GameRoot"; import { Router } from "../ui/GameRoot";
import { Programs } from "../Programs/Programs"; import { Programs } from "../Programs/Programs";
@ -63,18 +62,9 @@ function checkForMessagesToSend(): void {
const bitrunnersTest = Messages[MessageFilenames.BitRunnersTest]; const bitrunnersTest = Messages[MessageFilenames.BitRunnersTest];
const redpill = Messages[MessageFilenames.RedPill]; const redpill = Messages[MessageFilenames.RedPill];
let redpillOwned = false; if (Player.hasAugmentation(AugmentationNames.TheRedPill)) {
if (Augmentations[AugmentationNames.TheRedPill].owned) { //Force the message if the player has never destroyed a BitNode
redpillOwned = true; sendMessage(redpill, (Player.sourceFiles.length === 0));
}
if (redpillOwned && Player.sourceFiles.length === 0 && Router.page() !== Page.BitVerse) {
sendMessage(redpill, true);
} else if (redpillOwned) {
//If player has already destroyed a BitNode, message is not forced
if (Router.page() !== Page.BitVerse) {
sendMessage(redpill);
}
} else if (!jumper0.recvd && Player.hacking >= 25) { } else if (!jumper0.recvd && Player.hacking >= 25) {
sendMessage(jumper0); sendMessage(jumper0);
const flightName = Programs.Flight.name; const flightName = Programs.Flight.name;