Merge pull request #1527 from danielyxie/dev

Fix working for the CIA #1526
This commit is contained in:
hydroflame 2021-10-16 12:20:08 -04:00 committed by GitHub
commit bb95cda256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -608,7 +608,7 @@ export function process(this: IPlayer, router: IRouter, numCycles = 1): void {
export function cancelationPenalty(this: IPlayer): number { export function cancelationPenalty(this: IPlayer): number {
const data = serverMetadata.find((s) => s.specialName === this.companyName); const data = serverMetadata.find((s) => s.specialName === this.companyName);
if (!data) throw new Error("Couldn't find server for company " + this.companyName); if (!data) return 0.5; // Does not have special server.
const server = GetServer(data.hostname); const server = GetServer(data.hostname);
if (server instanceof Server) { if (server instanceof Server) {
if (server && server.backdoorInstalled) return 0.75; if (server && server.backdoorInstalled) return 0.75;
@ -2658,9 +2658,12 @@ export function setMult(this: IPlayer, name: string, mult: number): void {
(this as any)[name] = mult; (this as any)[name] = mult;
} }
export function canAccessCotMG(this: IPlayer): boolean {
return this.bitNodeN === 13 || SourceFileFlags[13] > 0;
}
export function sourceFileLvl(this: IPlayer, n: number): number { export function sourceFileLvl(this: IPlayer, n: number): number {
for (const sf of this.sourceFiles) { const sf = this.sourceFiles.find((sf) => sf.n === n);
if (sf.n === n) return sf.lvl; if (!sf) return 0;
} return sf.lvl;
return 0;
} }