rm the last of source file flags

This commit is contained in:
Olivier Gagnon 2022-04-14 01:33:05 -04:00
parent 62d15ff3a1
commit 957c07d9d2
4 changed files with 1 additions and 23 deletions

@ -252,6 +252,7 @@ export class Gang implements IGang {
const total = Object.values(AllGangs) const total = Object.values(AllGangs)
.map((g) => g.territory) .map((g) => g.territory)
.reduce((p, c) => p + c, 0); .reduce((p, c) => p + c, 0);
console.log(total);
Object.values(AllGangs).forEach((g) => (g.territory /= total)); Object.values(AllGangs).forEach((g) => (g.territory /= total));
} }
} }

@ -20,7 +20,6 @@ import { LiteratureNames } from "./Literature/data/LiteratureNames";
import { GetServer, AddToAllServers, initForeignServers, prestigeAllServers } from "./Server/AllServers"; import { GetServer, AddToAllServers, initForeignServers, prestigeAllServers } from "./Server/AllServers";
import { prestigeHomeComputer } from "./Server/ServerHelpers"; import { prestigeHomeComputer } from "./Server/ServerHelpers";
import { updateSourceFileFlags } from "./SourceFile/SourceFileFlags";
import { SpecialServers } from "./Server/data/SpecialServers"; import { SpecialServers } from "./Server/data/SpecialServers";
import { deleteStockMarket, initStockMarket, initSymbolToStockMap } from "./StockMarket/StockMarket"; import { deleteStockMarket, initStockMarket, initSymbolToStockMap } from "./StockMarket/StockMarket";
import { Terminal } from "./Terminal"; import { Terminal } from "./Terminal";
@ -174,7 +173,6 @@ export function prestigeAugmentation(): void {
// Prestige by destroying Bit Node and gaining a Source File // Prestige by destroying Bit Node and gaining a Source File
export function prestigeSourceFile(flume: boolean): void { export function prestigeSourceFile(flume: boolean): void {
initBitNodeMultipliers(Player); initBitNodeMultipliers(Player);
updateSourceFileFlags(Player);
Player.prestigeSourceFile(); Player.prestigeSourceFile();
prestigeWorkerScripts(); // Delete all Worker Scripts objects prestigeWorkerScripts(); // Delete all Worker Scripts objects

@ -1,18 +0,0 @@
// Contains an array containing information about the player's source files
// Array[n] returns what level the player has of Source-File N.
import { CONSTANTS } from "../Constants";
import { IPlayer } from "../PersonObjects/IPlayer";
export const SourceFileFlags: number[] = Array(CONSTANTS.TotalNumBitNodes + 1); // Skip index 0
export function updateSourceFileFlags(p: IPlayer): void {
for (let i = 0; i < SourceFileFlags.length; ++i) {
SourceFileFlags[i] = 0;
}
for (let i = 0; i < p.sourceFiles.length; ++i) {
const sf = p.sourceFiles[i];
SourceFileFlags[sf.n] = sf.lvl;
}
}

@ -31,7 +31,6 @@ import { saveObject, loadGame } from "./SaveObject";
import { initForeignServers } from "./Server/AllServers"; import { initForeignServers } from "./Server/AllServers";
import { Settings } from "./Settings/Settings"; import { Settings } from "./Settings/Settings";
import { ThemeEvents } from "./Themes/ui/Theme"; import { ThemeEvents } from "./Themes/ui/Theme";
import { updateSourceFileFlags } from "./SourceFile/SourceFileFlags";
import { initSymbolToStockMap, processStockPrices } from "./StockMarket/StockMarket"; import { initSymbolToStockMap, processStockPrices } from "./StockMarket/StockMarket";
import { Terminal } from "./Terminal"; import { Terminal } from "./Terminal";
import { Sleeve } from "./PersonObjects/Sleeve/Sleeve"; import { Sleeve } from "./PersonObjects/Sleeve/Sleeve";
@ -255,7 +254,6 @@ const Engine: {
ThemeEvents.emit(); ThemeEvents.emit();
initBitNodeMultipliers(Player); initBitNodeMultipliers(Player);
updateSourceFileFlags(Player);
initAugmentations(); // Also calls Player.reapplyAllAugmentations() initAugmentations(); // Also calls Player.reapplyAllAugmentations()
Player.reapplyAllSourceFiles(); Player.reapplyAllSourceFiles();
if (Player.hasWseAccount) { if (Player.hasWseAccount) {
@ -438,7 +436,6 @@ const Engine: {
initCompanies(); initCompanies();
initFactions(); initFactions();
initAugmentations(); initAugmentations();
updateSourceFileFlags(Player);
// Start interactive tutorial // Start interactive tutorial
iTutorialStart(); iTutorialStart();