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