From 957c07d9d22f372fb1d786ff50fef2a643d8ac03 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 14 Apr 2022 01:33:05 -0400 Subject: [PATCH] rm the last of source file flags --- src/Gang/Gang.ts | 1 + src/Prestige.ts | 2 -- src/SourceFile/SourceFileFlags.ts | 18 ------------------ src/engine.tsx | 3 --- 4 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 src/SourceFile/SourceFileFlags.ts diff --git a/src/Gang/Gang.ts b/src/Gang/Gang.ts index 688235a08..fc1747663 100644 --- a/src/Gang/Gang.ts +++ b/src/Gang/Gang.ts @@ -252,6 +252,7 @@ export class Gang implements IGang { const total = Object.values(AllGangs) .map((g) => g.territory) .reduce((p, c) => p + c, 0); + console.log(total); Object.values(AllGangs).forEach((g) => (g.territory /= total)); } } diff --git a/src/Prestige.ts b/src/Prestige.ts index 36e2c7acb..fec16b409 100755 --- a/src/Prestige.ts +++ b/src/Prestige.ts @@ -20,7 +20,6 @@ import { LiteratureNames } from "./Literature/data/LiteratureNames"; import { GetServer, AddToAllServers, initForeignServers, prestigeAllServers } from "./Server/AllServers"; import { prestigeHomeComputer } from "./Server/ServerHelpers"; -import { updateSourceFileFlags } from "./SourceFile/SourceFileFlags"; import { SpecialServers } from "./Server/data/SpecialServers"; import { deleteStockMarket, initStockMarket, initSymbolToStockMap } from "./StockMarket/StockMarket"; import { Terminal } from "./Terminal"; @@ -174,7 +173,6 @@ export function prestigeAugmentation(): void { // Prestige by destroying Bit Node and gaining a Source File export function prestigeSourceFile(flume: boolean): void { initBitNodeMultipliers(Player); - updateSourceFileFlags(Player); Player.prestigeSourceFile(); prestigeWorkerScripts(); // Delete all Worker Scripts objects diff --git a/src/SourceFile/SourceFileFlags.ts b/src/SourceFile/SourceFileFlags.ts deleted file mode 100644 index 118fb94fd..000000000 --- a/src/SourceFile/SourceFileFlags.ts +++ /dev/null @@ -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; - } -} diff --git a/src/engine.tsx b/src/engine.tsx index 25107b264..ab88276d4 100644 --- a/src/engine.tsx +++ b/src/engine.tsx @@ -31,7 +31,6 @@ import { saveObject, loadGame } from "./SaveObject"; import { initForeignServers } from "./Server/AllServers"; import { Settings } from "./Settings/Settings"; import { ThemeEvents } from "./Themes/ui/Theme"; -import { updateSourceFileFlags } from "./SourceFile/SourceFileFlags"; import { initSymbolToStockMap, processStockPrices } from "./StockMarket/StockMarket"; import { Terminal } from "./Terminal"; import { Sleeve } from "./PersonObjects/Sleeve/Sleeve"; @@ -255,7 +254,6 @@ const Engine: { ThemeEvents.emit(); initBitNodeMultipliers(Player); - updateSourceFileFlags(Player); initAugmentations(); // Also calls Player.reapplyAllAugmentations() Player.reapplyAllSourceFiles(); if (Player.hasWseAccount) { @@ -438,7 +436,6 @@ const Engine: { initCompanies(); initFactions(); initAugmentations(); - updateSourceFileFlags(Player); // Start interactive tutorial iTutorialStart();