merge dev

This commit is contained in:
Olivier Gagnon 2021-10-16 15:46:25 -04:00
commit c0420d1787
5 changed files with 9 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2956,6 +2956,7 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
return true; return true;
}, },
workForFaction: function (name: any, type: any): any { workForFaction: function (name: any, type: any): any {
console.log(`${name} ${type}`);
updateDynamicRam("workForFaction", getRamCost("workForFaction")); updateDynamicRam("workForFaction", getRamCost("workForFaction"));
checkSingularityAccess("workForFaction", 2); checkSingularityAccess("workForFaction", 2);
getFaction("workForFaction", name); getFaction("workForFaction", name);

@ -516,6 +516,7 @@ export function resetWorkStatus(this: IPlayer, generalType?: string, group?: str
this.currentWorkFactionDescription = ""; this.currentWorkFactionDescription = "";
this.createProgramName = ""; this.createProgramName = "";
this.className = ""; this.className = "";
this.workType = "";
} }
export function processWorkEarnings(this: IPlayer, numCycles = 1): void { export function processWorkEarnings(this: IPlayer, numCycles = 1): void {
@ -608,7 +609,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;
@ -883,6 +884,7 @@ export function startFactionFieldWork(this: IPlayer, router: IRouter, faction: F
} }
export function startFactionSecurityWork(this: IPlayer, router: IRouter, faction: Faction): void { export function startFactionSecurityWork(this: IPlayer, router: IRouter, faction: Faction): void {
console.log(faction);
this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkSecurity); this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkSecurity);
this.workHackExpGainRate = 0.05 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain; this.workHackExpGainRate = 0.05 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;

@ -361,5 +361,7 @@ export function WorkInProgressRoot(): React.ReactElement {
); );
} }
if (!player.workType) router.toTerminal();
return <></>; return <></>;
} }