FACTIONS: Add "Rumors" system for learning about faction join requirements (#888)

This commit is contained in:
Jesse Clark
2023-11-02 07:20:24 -07:00
committed by GitHub
parent 023f32bce3
commit fdcb8306d9
27 changed files with 1049 additions and 601 deletions

View File

@@ -1,4 +1,4 @@
import { AugmentationName, CityName, CompletedProgramName, FactionName, LiteratureName } from "@enums";
import { AugmentationName, CityName, CompletedProgramName, FactionName, LiteratureName, CompanyName } from "@enums";
import { initBitNodeMultipliers } from "./BitNode/BitNode";
import { Companies } from "./Company/Companies";
import { resetIndustryResearchTrees } from "./Corporation/data/IndustryData";
@@ -34,9 +34,17 @@ function delayedDialog(message: string) {
export function prestigeAugmentation(): void {
initBitNodeMultipliers();
const maintainMembership = Player.factions.concat(Player.factionInvitations).filter(function (faction) {
return Factions[faction].getInfo().keep;
});
// Maintain invites to factions with the 'keepOnInstall' flag, and rumors about others
const maintainInvites = [];
const maintainRumors = [];
for (const facName of [...Player.factions, ...Player.factionInvitations]) {
if (Factions[facName].getInfo().keep) {
maintainInvites.push(facName);
} else {
maintainRumors.push(facName);
}
}
Player.prestigeAugmentation();
// Delete all Worker Scripts objects
@@ -84,8 +92,8 @@ export function prestigeAugmentation(): void {
// Recalculate the bonus for circadian modulator aug
initCircadianModulator();
Player.factionInvitations = Player.factionInvitations.concat(maintainMembership);
for (const factionName of maintainMembership) Factions[factionName].alreadyInvited = true;
Player.factionInvitations = Player.factionInvitations.concat(maintainInvites);
for (const factionName of maintainInvites) Factions[factionName].alreadyInvited = true;
Player.reapplyAllAugmentations();
Player.reapplyAllSourceFiles();
Player.hp.current = Player.hp.max;
@@ -144,12 +152,19 @@ export function prestigeAugmentation(): void {
}
}
// Bitnode 13: Church of the Machine God
if (Player.hasAugmentation(AugmentationName.StaneksGift1, true)) {
joinFaction(Factions[FactionName.ChurchOfTheMachineGod]);
} else if (Player.bitNodeN != 13) {
if (Player.augmentations.some((a) => a.name !== AugmentationName.NeuroFluxGovernor)) {
Factions[FactionName.ChurchOfTheMachineGod].isBanned = true;
}
}
staneksGift.prestigeAugmentation();
// Hear rumors after all invites/bans
for (const factionName of maintainRumors) Player.receiveRumor(factionName);
resetPidCounter();
ProgramsSeen.clear();
InvitationsSeen.clear();
@@ -230,7 +245,7 @@ export function prestigeSourceFile(isFlume: boolean): void {
// BitNode 6: Bladeburners and BitNode 7: Bladeburners 2079
if (Player.bitNodeN === 6 || Player.bitNodeN === 7) {
delayedDialog("NSA would like to have a word with you once you're ready.");
delayedDialog(`The ${CompanyName.NSA} would like to have a word with you once you're ready.`);
}
// BitNode 8: Ghost of Wall Street
@@ -245,7 +260,7 @@ export function prestigeSourceFile(isFlume: boolean): void {
// BitNode 10: Digital Carbon
if (Player.bitNodeN === 10) {
delayedDialog(
"Seek out The Covenant if you'd like to purchase a new sleeve or two! And see what VitaLife in New Tokyo has to offer for you",
`Seek out ${FactionName.TheCovenant} if you'd like to purchase a new sleeve or two! And see what ${CompanyName.VitaLife} in ${CityName.NewTokyo} has to offer for you`,
);
}