mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 12:15:44 +01:00
hotfix
This commit is contained in:
parent
34313e8100
commit
8db57d7e81
36
dist/vendor.bundle.js
vendored
36
dist/vendor.bundle.js
vendored
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
@ -1,6 +1,7 @@
|
|||||||
import { CONSTANTS } from "../Constants";
|
import { CONSTANTS } from "../Constants";
|
||||||
import { IPlayer } from "../PersonObjects/IPlayer";
|
import { IPlayer } from "../PersonObjects/IPlayer";
|
||||||
import { IPlayerOrSleeve } from "../PersonObjects/IPlayerOrSleeve";
|
import { IPlayerOrSleeve } from "../PersonObjects/IPlayerOrSleeve";
|
||||||
|
import { IRouter } from "../ui/Router";
|
||||||
|
|
||||||
export interface IConstructorParams {
|
export interface IConstructorParams {
|
||||||
hacking_success_weight?: number;
|
hacking_success_weight?: number;
|
||||||
@ -85,11 +86,12 @@ export class Crime {
|
|||||||
this.kills = params.kills ? params.kills : 0;
|
this.kills = params.kills ? params.kills : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
commit(p: IPlayer, div = 1, singParams: any = null): number {
|
commit(router: IRouter, p: IPlayer, div = 1, singParams: any = null): number {
|
||||||
if (div <= 0) {
|
if (div <= 0) {
|
||||||
div = 1;
|
div = 1;
|
||||||
}
|
}
|
||||||
p.startCrime(
|
p.startCrime(
|
||||||
|
router,
|
||||||
this.type,
|
this.type,
|
||||||
this.hacking_exp / div,
|
this.hacking_exp / div,
|
||||||
this.strength_exp / div,
|
this.strength_exp / div,
|
||||||
|
@ -104,13 +104,11 @@ export function FactionRoot(props: IProps): React.ReactElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function startFieldWork(faction: Faction): void {
|
function startFieldWork(faction: Faction): void {
|
||||||
player.startFactionFieldWork(faction);
|
player.startFactionFieldWork(router, faction);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function startHackingContracts(faction: Faction): void {
|
function startHackingContracts(faction: Faction): void {
|
||||||
player.startFactionHackWork(faction);
|
player.startFactionHackWork(router, faction);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function startHackingMission(faction: Faction): void {
|
function startHackingMission(faction: Faction): void {
|
||||||
@ -119,8 +117,7 @@ export function FactionRoot(props: IProps): React.ReactElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function startSecurityWork(faction: Faction): void {
|
function startSecurityWork(faction: Faction): void {
|
||||||
player.startFactionSecurityWork(faction);
|
player.startFactionSecurityWork(router, faction);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function MainPage({ faction }: { faction: Faction }): React.ReactElement {
|
function MainPage({ faction }: { faction: Faction }): React.ReactElement {
|
||||||
|
@ -168,9 +168,9 @@ export function CompanyLocation(props: IProps): React.ReactElement {
|
|||||||
const pos = companyPosition;
|
const pos = companyPosition;
|
||||||
if (pos instanceof CompanyPosition) {
|
if (pos instanceof CompanyPosition) {
|
||||||
if (pos.isPartTimeJob() || pos.isSoftwareConsultantJob() || pos.isBusinessConsultantJob()) {
|
if (pos.isPartTimeJob() || pos.isSoftwareConsultantJob() || pos.isBusinessConsultantJob()) {
|
||||||
p.startWorkPartTime(props.locName);
|
p.startWorkPartTime(router, props.locName);
|
||||||
} else {
|
} else {
|
||||||
p.startWork(props.locName);
|
p.startWork(router, props.locName);
|
||||||
}
|
}
|
||||||
router.toWork();
|
router.toWork();
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ export function GenericLocation({ loc }: IProps): React.ReactElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (loc.types.includes(LocationType.Gym)) {
|
if (loc.types.includes(LocationType.Gym)) {
|
||||||
content.push(<GymLocation key={"gymlocation"} loc={loc} p={player} />);
|
content.push(<GymLocation key={"gymlocation"} router={router} loc={loc} p={player} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loc.types.includes(LocationType.Hospital)) {
|
if (loc.types.includes(LocationType.Hospital)) {
|
||||||
|
@ -15,10 +15,12 @@ import { SpecialServerIps } from "../../Server/SpecialServerIps";
|
|||||||
|
|
||||||
import { StdButton } from "../../ui/React/StdButton";
|
import { StdButton } from "../../ui/React/StdButton";
|
||||||
import { Money } from "../../ui/React/Money";
|
import { Money } from "../../ui/React/Money";
|
||||||
|
import { IRouter } from "../../ui/Router";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
loc: Location;
|
loc: Location;
|
||||||
p: IPlayer;
|
p: IPlayer;
|
||||||
|
router: IRouter;
|
||||||
};
|
};
|
||||||
|
|
||||||
export class GymLocation extends React.Component<IProps, any> {
|
export class GymLocation extends React.Component<IProps, any> {
|
||||||
@ -50,7 +52,7 @@ export class GymLocation extends React.Component<IProps, any> {
|
|||||||
|
|
||||||
train(stat: string): void {
|
train(stat: string): void {
|
||||||
const loc = this.props.loc;
|
const loc = this.props.loc;
|
||||||
this.props.p.startClass(this.calculateCost(), loc.expMult, stat);
|
this.props.p.startClass(this.props.router, this.calculateCost(), loc.expMult, stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
trainStrength(): void {
|
trainStrength(): void {
|
||||||
|
@ -18,96 +18,84 @@ export function SlumsLocation(): React.ReactElement {
|
|||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.Shoplift.commit(player);
|
Crimes.Shoplift.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function robStore(e: React.MouseEvent<HTMLElement>): void {
|
function robStore(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.RobStore.commit(player);
|
Crimes.RobStore.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function mug(e: React.MouseEvent<HTMLElement>): void {
|
function mug(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.Mug.commit(player);
|
Crimes.Mug.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function larceny(e: React.MouseEvent<HTMLElement>): void {
|
function larceny(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.Larceny.commit(player);
|
Crimes.Larceny.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function dealDrugs(e: React.MouseEvent<HTMLElement>): void {
|
function dealDrugs(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.DealDrugs.commit(player);
|
Crimes.DealDrugs.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function bondForgery(e: React.MouseEvent<HTMLElement>): void {
|
function bondForgery(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.BondForgery.commit(player);
|
Crimes.BondForgery.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function traffickArms(e: React.MouseEvent<HTMLElement>): void {
|
function traffickArms(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.TraffickArms.commit(player);
|
Crimes.TraffickArms.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function homicide(e: React.MouseEvent<HTMLElement>): void {
|
function homicide(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.Homicide.commit(player);
|
Crimes.Homicide.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function grandTheftAuto(e: React.MouseEvent<HTMLElement>): void {
|
function grandTheftAuto(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.GrandTheftAuto.commit(player);
|
Crimes.GrandTheftAuto.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function kidnap(e: React.MouseEvent<HTMLElement>): void {
|
function kidnap(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.Kidnap.commit(player);
|
Crimes.Kidnap.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function assassinate(e: React.MouseEvent<HTMLElement>): void {
|
function assassinate(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.Assassination.commit(player);
|
Crimes.Assassination.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function heist(e: React.MouseEvent<HTMLElement>): void {
|
function heist(e: React.MouseEvent<HTMLElement>): void {
|
||||||
if (!e.isTrusted) {
|
if (!e.isTrusted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Crimes.Heist.commit(player);
|
Crimes.Heist.commit(router, player);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const shopliftChance = Crimes.Shoplift.successRate(player);
|
const shopliftChance = Crimes.Shoplift.successRate(player);
|
||||||
|
@ -34,8 +34,7 @@ export function UniversityLocation(props: IProps): React.ReactElement {
|
|||||||
|
|
||||||
function take(stat: string): void {
|
function take(stat: string): void {
|
||||||
const loc = props.loc;
|
const loc = props.loc;
|
||||||
player.startClass(calculateCost(), loc.expMult, stat);
|
player.startClass(router, calculateCost(), loc.expMult, stat);
|
||||||
router.toWork();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function study(): void {
|
function study(): void {
|
||||||
|
@ -136,7 +136,8 @@ import { Interpreter } from "./JSInterpreter";
|
|||||||
import { NetscriptPort } from "./NetscriptPort";
|
import { NetscriptPort } from "./NetscriptPort";
|
||||||
import { SleeveTaskType } from "./PersonObjects/Sleeve/SleeveTaskTypesEnum";
|
import { SleeveTaskType } from "./PersonObjects/Sleeve/SleeveTaskTypesEnum";
|
||||||
import { findSleevePurchasableAugs } from "./PersonObjects/Sleeve/SleeveHelpers";
|
import { findSleevePurchasableAugs } from "./PersonObjects/Sleeve/SleeveHelpers";
|
||||||
import { Exploit } from "./Exploits/Exploit.ts";
|
import { Exploit } from "./Exploits/Exploit";
|
||||||
|
import { Router } from "./ui/GameRoot";
|
||||||
|
|
||||||
import { numeralWrapper } from "./ui/numeralFormat";
|
import { numeralWrapper } from "./ui/numeralFormat";
|
||||||
import { setTimeoutRef } from "./utils/SetTimeoutRef";
|
import { setTimeoutRef } from "./utils/SetTimeoutRef";
|
||||||
@ -2894,7 +2895,7 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.log("universityCourse", `Invalid class name: ${className}.`);
|
workerScript.log("universityCourse", `Invalid class name: ${className}.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Player.startClass(costMult, expMult, task);
|
Player.startClass(Router, costMult, expMult, task);
|
||||||
workerScript.log("universityCourse", `Started ${task} at ${universityName}`);
|
workerScript.log("universityCourse", `Started ${task} at ${universityName}`);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@ -2971,19 +2972,19 @@ function NetscriptFunctions(workerScript) {
|
|||||||
switch (stat.toLowerCase()) {
|
switch (stat.toLowerCase()) {
|
||||||
case "strength".toLowerCase():
|
case "strength".toLowerCase():
|
||||||
case "str".toLowerCase():
|
case "str".toLowerCase():
|
||||||
Player.startClass(costMult, expMult, CONSTANTS.ClassGymStrength);
|
Player.startClass(Router, costMult, expMult, CONSTANTS.ClassGymStrength);
|
||||||
break;
|
break;
|
||||||
case "defense".toLowerCase():
|
case "defense".toLowerCase():
|
||||||
case "def".toLowerCase():
|
case "def".toLowerCase():
|
||||||
Player.startClass(costMult, expMult, CONSTANTS.ClassGymDefense);
|
Player.startClass(Router, costMult, expMult, CONSTANTS.ClassGymDefense);
|
||||||
break;
|
break;
|
||||||
case "dexterity".toLowerCase():
|
case "dexterity".toLowerCase():
|
||||||
case "dex".toLowerCase():
|
case "dex".toLowerCase():
|
||||||
Player.startClass(costMult, expMult, CONSTANTS.ClassGymDexterity);
|
Player.startClass(Router, costMult, expMult, CONSTANTS.ClassGymDexterity);
|
||||||
break;
|
break;
|
||||||
case "agility".toLowerCase():
|
case "agility".toLowerCase():
|
||||||
case "agi".toLowerCase():
|
case "agi".toLowerCase():
|
||||||
Player.startClass(costMult, expMult, CONSTANTS.ClassGymAgility);
|
Player.startClass(Router, costMult, expMult, CONSTANTS.ClassGymAgility);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
workerScript.log("gymWorkout", `Invalid stat: ${stat}.`);
|
workerScript.log("gymWorkout", `Invalid stat: ${stat}.`);
|
||||||
@ -3419,9 +3420,9 @@ function NetscriptFunctions(workerScript) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (companyPosition.isPartTimeJob()) {
|
if (companyPosition.isPartTimeJob()) {
|
||||||
Player.startWorkPartTime(companyName);
|
Player.startWorkPartTime(Router, companyName);
|
||||||
} else {
|
} else {
|
||||||
Player.startWork(companyName);
|
Player.startWork(Router, companyName);
|
||||||
}
|
}
|
||||||
workerScript.log("workForCompany", `Began working at '${Player.companyName}' as a '${companyPositionName}'`);
|
workerScript.log("workForCompany", `Began working at '${Player.companyName}' as a '${companyPositionName}'`);
|
||||||
return true;
|
return true;
|
||||||
@ -3660,7 +3661,7 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.log("workForFaction", `Faction '${fac.name}' do not need help with hacking contracts.`);
|
workerScript.log("workForFaction", `Faction '${fac.name}' do not need help with hacking contracts.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Player.startFactionHackWork(fac);
|
Player.startFactionHackWork(Router, fac);
|
||||||
workerScript.log("workForFaction", `Started carrying out hacking contracts for '${fac.name}'`);
|
workerScript.log("workForFaction", `Started carrying out hacking contracts for '${fac.name}'`);
|
||||||
return true;
|
return true;
|
||||||
case "field":
|
case "field":
|
||||||
@ -3670,7 +3671,7 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.log("workForFaction", `Faction '${fac.name}' do not need help with field missions.`);
|
workerScript.log("workForFaction", `Faction '${fac.name}' do not need help with field missions.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Player.startFactionFieldWork(fac);
|
Player.startFactionFieldWork(Router, fac);
|
||||||
workerScript.log("workForFaction", `Started carrying out field missions for '${fac.name}'`);
|
workerScript.log("workForFaction", `Started carrying out field missions for '${fac.name}'`);
|
||||||
return true;
|
return true;
|
||||||
case "security":
|
case "security":
|
||||||
@ -3680,7 +3681,7 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.log("workForFaction", `Faction '${fac.name}' do not need help with security work.`);
|
workerScript.log("workForFaction", `Faction '${fac.name}' do not need help with security work.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Player.startFactionSecurityWork(fac);
|
Player.startFactionSecurityWork(Router, fac);
|
||||||
workerScript.log("workForFaction", `Started carrying out security work for '${fac.name}'`);
|
workerScript.log("workForFaction", `Started carrying out security work for '${fac.name}'`);
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
@ -3781,7 +3782,7 @@ function NetscriptFunctions(workerScript) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player.startCreateProgramWork(p.name, p.create.time, p.create.level);
|
Player.startCreateProgramWork(Router, p.name, p.create.time, p.create.level);
|
||||||
workerScript.log("createProgram", `Began creating program: '${name}'`);
|
workerScript.log("createProgram", `Began creating program: '${name}'`);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@ -3806,7 +3807,7 @@ function NetscriptFunctions(workerScript) {
|
|||||||
throw makeRuntimeErrorMsg("commitCrime", `Invalid crime: '${crimeRoughName}'`);
|
throw makeRuntimeErrorMsg("commitCrime", `Invalid crime: '${crimeRoughName}'`);
|
||||||
}
|
}
|
||||||
workerScript.log("commitCrime", `Attempting to commit ${crime.name}...`);
|
workerScript.log("commitCrime", `Attempting to commit ${crime.name}...`);
|
||||||
return crime.commit(Player, 1, { workerscript: workerScript });
|
return crime.commit(Router, Player, 1, { workerscript: workerScript });
|
||||||
},
|
},
|
||||||
getCrimeChance: function (crimeRoughName) {
|
getCrimeChance: function (crimeRoughName) {
|
||||||
updateDynamicRam("getCrimeChance", getRamCost("getCrimeChance"));
|
updateDynamicRam("getCrimeChance", getRamCost("getCrimeChance"));
|
||||||
|
@ -25,6 +25,7 @@ import { ICorporation } from "../Corporation/ICorporation";
|
|||||||
import { IGang } from "../Gang/IGang";
|
import { IGang } from "../Gang/IGang";
|
||||||
import { IBladeburner } from "../Bladeburner/IBladeburner";
|
import { IBladeburner } from "../Bladeburner/IBladeburner";
|
||||||
import { ICodingContractReward } from "../CodingContracts";
|
import { ICodingContractReward } from "../CodingContracts";
|
||||||
|
import { IRouter } from "../ui/Router";
|
||||||
|
|
||||||
export interface IPlayer {
|
export interface IPlayer {
|
||||||
// Class members
|
// Class members
|
||||||
@ -200,9 +201,10 @@ export interface IPlayer {
|
|||||||
setMoney(amt: number): void;
|
setMoney(amt: number): void;
|
||||||
singularityStopWork(): void;
|
singularityStopWork(): void;
|
||||||
startBladeburner(p: any): void;
|
startBladeburner(p: any): void;
|
||||||
startClass(costMult: number, expMult: number, className: string): void;
|
startClass(router: IRouter, costMult: number, expMult: number, className: string): void;
|
||||||
startCorporation(corpName: string, additionalShares?: number): void;
|
startCorporation(corpName: string, additionalShares?: number): void;
|
||||||
startCrime(
|
startCrime(
|
||||||
|
router: IRouter,
|
||||||
crimeType: string,
|
crimeType: string,
|
||||||
hackExp: number,
|
hackExp: number,
|
||||||
strExp: number,
|
strExp: number,
|
||||||
@ -214,13 +216,13 @@ export interface IPlayer {
|
|||||||
time: number,
|
time: number,
|
||||||
singParams: any,
|
singParams: any,
|
||||||
): void;
|
): void;
|
||||||
startFactionFieldWork(faction: Faction): void;
|
startFactionFieldWork(router: IRouter, faction: Faction): void;
|
||||||
startFactionHackWork(faction: Faction): void;
|
startFactionHackWork(router: IRouter, faction: Faction): void;
|
||||||
startFactionSecurityWork(faction: Faction): void;
|
startFactionSecurityWork(router: IRouter, faction: Faction): void;
|
||||||
startFocusing(): void;
|
startFocusing(): void;
|
||||||
startGang(facName: string, isHacking: boolean): void;
|
startGang(facName: string, isHacking: boolean): void;
|
||||||
startWork(companyName: string): void;
|
startWork(router: IRouter, companyName: string): void;
|
||||||
startWorkPartTime(companyName: string): void;
|
startWorkPartTime(router: IRouter, companyName: string): void;
|
||||||
takeDamage(amt: number): boolean;
|
takeDamage(amt: number): boolean;
|
||||||
travel(to: CityName): boolean;
|
travel(to: CityName): boolean;
|
||||||
giveExploit(exploit: Exploit): void;
|
giveExploit(exploit: Exploit): void;
|
||||||
@ -229,7 +231,7 @@ export interface IPlayer {
|
|||||||
getCasinoWinnings(): number;
|
getCasinoWinnings(): number;
|
||||||
quitJob(company: string): void;
|
quitJob(company: string): void;
|
||||||
createHacknetServer(): void;
|
createHacknetServer(): void;
|
||||||
startCreateProgramWork(programName: string, time: number, reqLevel: number): void;
|
startCreateProgramWork(router: IRouter, programName: string, time: number, reqLevel: number): void;
|
||||||
queueAugmentation(augmentationName: string): void;
|
queueAugmentation(augmentationName: string): void;
|
||||||
receiveInvite(factionName: string): void;
|
receiveInvite(factionName: string): void;
|
||||||
updateSkillLevels(): void;
|
updateSkillLevels(): void;
|
||||||
|
@ -546,7 +546,7 @@ export function processWorkEarnings(numCycles = 1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Working for Company */
|
/* Working for Company */
|
||||||
export function startWork(companyName) {
|
export function startWork(router, companyName) {
|
||||||
this.resetWorkStatus(CONSTANTS.WorkTypeCompany, companyName);
|
this.resetWorkStatus(CONSTANTS.WorkTypeCompany, companyName);
|
||||||
this.isWorking = true;
|
this.isWorking = true;
|
||||||
this.focus = true;
|
this.focus = true;
|
||||||
@ -563,6 +563,7 @@ export function startWork(companyName) {
|
|||||||
this.workMoneyGainRate = this.getWorkMoneyGain();
|
this.workMoneyGainRate = this.getWorkMoneyGain();
|
||||||
|
|
||||||
this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;
|
this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;
|
||||||
|
router.toWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function cancelationPenalty() {
|
export function cancelationPenalty() {
|
||||||
@ -678,7 +679,7 @@ export function finishWork(cancelled, sing = false) {
|
|||||||
this.resetWorkStatus();
|
this.resetWorkStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function startWorkPartTime(companyName) {
|
export function startWorkPartTime(router, companyName) {
|
||||||
this.resetWorkStatus(CONSTANTS.WorkTypeCompanyPartTime, companyName);
|
this.resetWorkStatus(CONSTANTS.WorkTypeCompanyPartTime, companyName);
|
||||||
this.isWorking = true;
|
this.isWorking = true;
|
||||||
this.focus = true;
|
this.focus = true;
|
||||||
@ -695,6 +696,7 @@ export function startWorkPartTime(companyName) {
|
|||||||
this.workMoneyGainRate = this.getWorkMoneyGain();
|
this.workMoneyGainRate = this.getWorkMoneyGain();
|
||||||
|
|
||||||
this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;
|
this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;
|
||||||
|
router.toWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function workPartTime(numCycles) {
|
export function workPartTime(numCycles) {
|
||||||
@ -785,7 +787,7 @@ export function stopFocusing() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Working for Faction */
|
/* Working for Faction */
|
||||||
export function startFactionWork(faction) {
|
export function startFactionWork(router, faction) {
|
||||||
//Update reputation gain rate to account for faction favor
|
//Update reputation gain rate to account for faction favor
|
||||||
var favorMult = 1 + faction.favor / 100;
|
var favorMult = 1 + faction.favor / 100;
|
||||||
if (isNaN(favorMult)) {
|
if (isNaN(favorMult)) {
|
||||||
@ -800,9 +802,10 @@ export function startFactionWork(faction) {
|
|||||||
this.currentWorkFactionName = faction.name;
|
this.currentWorkFactionName = faction.name;
|
||||||
|
|
||||||
this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer20Hours;
|
this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer20Hours;
|
||||||
|
router.toWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function startFactionHackWork(faction) {
|
export function startFactionHackWork(router, faction) {
|
||||||
this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkHacking);
|
this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkHacking);
|
||||||
|
|
||||||
this.workHackExpGainRate = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;
|
this.workHackExpGainRate = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;
|
||||||
@ -814,10 +817,10 @@ export function startFactionHackWork(faction) {
|
|||||||
this.factionWorkType = CONSTANTS.FactionWorkHacking;
|
this.factionWorkType = CONSTANTS.FactionWorkHacking;
|
||||||
this.currentWorkFactionDescription = "carrying out hacking contracts";
|
this.currentWorkFactionDescription = "carrying out hacking contracts";
|
||||||
|
|
||||||
this.startFactionWork(faction);
|
this.startFactionWork(router, faction);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function startFactionFieldWork(faction) {
|
export function startFactionFieldWork(router, faction) {
|
||||||
this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkField);
|
this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkField);
|
||||||
|
|
||||||
this.workHackExpGainRate = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;
|
this.workHackExpGainRate = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;
|
||||||
@ -831,10 +834,10 @@ export function startFactionFieldWork(faction) {
|
|||||||
this.factionWorkType = CONSTANTS.FactionWorkField;
|
this.factionWorkType = CONSTANTS.FactionWorkField;
|
||||||
this.currentWorkFactionDescription = "carrying out field missions";
|
this.currentWorkFactionDescription = "carrying out field missions";
|
||||||
|
|
||||||
this.startFactionWork(faction);
|
this.startFactionWork(router, faction);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function startFactionSecurityWork(faction) {
|
export function startFactionSecurityWork(router, 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;
|
||||||
@ -848,7 +851,7 @@ export function startFactionSecurityWork(faction) {
|
|||||||
this.factionWorkType = CONSTANTS.FactionWorkSecurity;
|
this.factionWorkType = CONSTANTS.FactionWorkSecurity;
|
||||||
this.currentWorkFactionDescription = "performing security detail";
|
this.currentWorkFactionDescription = "performing security detail";
|
||||||
|
|
||||||
this.startFactionWork(faction);
|
this.startFactionWork(router, faction);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function workForFaction(numCycles) {
|
export function workForFaction(numCycles) {
|
||||||
@ -1171,7 +1174,7 @@ export function getWorkRepGain() {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
/* Creating a Program */
|
/* Creating a Program */
|
||||||
export function startCreateProgramWork(programName, time, reqLevel) {
|
export function startCreateProgramWork(router, programName, time, reqLevel) {
|
||||||
this.resetWorkStatus();
|
this.resetWorkStatus();
|
||||||
this.isWorking = true;
|
this.isWorking = true;
|
||||||
this.focus = true;
|
this.focus = true;
|
||||||
@ -1203,6 +1206,7 @@ export function startCreateProgramWork(programName, time, reqLevel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.createProgramName = programName;
|
this.createProgramName = programName;
|
||||||
|
router.toWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createProgramWork(numCycles) {
|
export function createProgramWork(numCycles) {
|
||||||
@ -1246,7 +1250,7 @@ export function finishCreateProgramWork(cancelled) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Studying/Taking Classes */
|
/* Studying/Taking Classes */
|
||||||
export function startClass(costMult, expMult, className) {
|
export function startClass(router, costMult, expMult, className) {
|
||||||
this.resetWorkStatus();
|
this.resetWorkStatus();
|
||||||
this.isWorking = true;
|
this.isWorking = true;
|
||||||
this.focus = true;
|
this.focus = true;
|
||||||
@ -1317,6 +1321,7 @@ export function startClass(costMult, expMult, className) {
|
|||||||
this.workDexExpGainRate = dexExp * this.dexterity_exp_mult * BitNodeMultipliers.ClassGymExpGain;
|
this.workDexExpGainRate = dexExp * this.dexterity_exp_mult * BitNodeMultipliers.ClassGymExpGain;
|
||||||
this.workAgiExpGainRate = agiExp * this.agility_exp_mult * BitNodeMultipliers.ClassGymExpGain;
|
this.workAgiExpGainRate = agiExp * this.agility_exp_mult * BitNodeMultipliers.ClassGymExpGain;
|
||||||
this.workChaExpGainRate = chaExp * this.charisma_exp_mult * BitNodeMultipliers.ClassGymExpGain;
|
this.workChaExpGainRate = chaExp * this.charisma_exp_mult * BitNodeMultipliers.ClassGymExpGain;
|
||||||
|
router.toWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function takeClass(numCycles) {
|
export function takeClass(numCycles) {
|
||||||
@ -1385,7 +1390,19 @@ export function finishClass(sing = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//The EXP and $ gains are hardcoded. Time is in ms
|
//The EXP and $ gains are hardcoded. Time is in ms
|
||||||
export function startCrime(crimeType, hackExp, strExp, defExp, dexExp, agiExp, chaExp, money, time, singParams = null) {
|
export function startCrime(
|
||||||
|
router,
|
||||||
|
crimeType,
|
||||||
|
hackExp,
|
||||||
|
strExp,
|
||||||
|
defExp,
|
||||||
|
dexExp,
|
||||||
|
agiExp,
|
||||||
|
chaExp,
|
||||||
|
money,
|
||||||
|
time,
|
||||||
|
singParams = null,
|
||||||
|
) {
|
||||||
this.crimeType = crimeType;
|
this.crimeType = crimeType;
|
||||||
|
|
||||||
this.resetWorkStatus();
|
this.resetWorkStatus();
|
||||||
@ -1407,6 +1424,7 @@ export function startCrime(crimeType, hackExp, strExp, defExp, dexExp, agiExp, c
|
|||||||
this.workMoneyGained = money * this.crime_money_mult * BitNodeMultipliers.CrimeMoney;
|
this.workMoneyGained = money * this.crime_money_mult * BitNodeMultipliers.CrimeMoney;
|
||||||
|
|
||||||
this.timeNeededToCompleteWork = time;
|
this.timeNeededToCompleteWork = time;
|
||||||
|
router.toWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function commitCrime(numCycles) {
|
export function commitCrime(numCycles) {
|
||||||
|
@ -37,8 +37,7 @@ export function ProgramsRoot(): React.ReactElement {
|
|||||||
<Tooltip key={program.name} title={create.tooltip}>
|
<Tooltip key={program.name} title={create.tooltip}>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
player.startCreateProgramWork(program.name, create.time, create.level);
|
player.startCreateProgramWork(router, program.name, create.time, create.level);
|
||||||
router.toWork();
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{program.name}
|
{program.name}
|
||||||
|
Loading…
Reference in New Issue
Block a user