You will automatically finish after working for 20 hours. You can cancel earlier if you wish.
There is no penalty for cancelling earlier.
);
}
const className = player.className;
if (player.className !== "") {
function cancel(): void {
player.finishClass(true);
router.toCity();
}
let stopText = "";
if (
className == CONSTANTS.ClassGymStrength ||
className == CONSTANTS.ClassGymDefense ||
className == CONSTANTS.ClassGymDexterity ||
className == CONSTANTS.ClassGymAgility
) {
stopText = "Stop training at gym";
} else {
stopText = "Stop taking course";
}
return (
You have been {className} for {convertTimeMsToTimeElapsedString(player.timeWorked)}
This has cost you: (){" "}
You have gained:
{numeralWrapper.formatExp(player.workHackExpGained)} (
{numeralWrapper.formatExp(player.workHackExpGainRate * CYCLES_PER_SEC)} / sec) hacking exp
{numeralWrapper.formatExp(player.workStrExpGained)} (
{numeralWrapper.formatExp(player.workStrExpGainRate * CYCLES_PER_SEC)} / sec) strength exp
{numeralWrapper.formatExp(player.workDefExpGained)} (
{numeralWrapper.formatExp(player.workDefExpGainRate * CYCLES_PER_SEC)} / sec) defense exp
{numeralWrapper.formatExp(player.workDexExpGained)} (
{numeralWrapper.formatExp(player.workDexExpGainRate * CYCLES_PER_SEC)} / sec) dexterity exp
{numeralWrapper.formatExp(player.workAgiExpGained)} (
{numeralWrapper.formatExp(player.workAgiExpGainRate * CYCLES_PER_SEC)} / sec) agility exp
{numeralWrapper.formatExp(player.workChaExpGained)} (
{numeralWrapper.formatExp(player.workChaExpGainRate * CYCLES_PER_SEC)} / sec) charisma exp
You may cancel at any time
);
}
if (player.workType == CONSTANTS.WorkTypeCompany) {
const comp = Companies[player.companyName];
let companyRep = 0;
if (comp == null || !(comp instanceof Company)) {
throw new Error(`Could not find Company: ${player.companyName}`);
}
companyRep = comp.playerReputation;
function cancel(): void {
player.finishWork(true);
router.toJob();
}
function unfocus(): void {
player.stopFocusing();
router.toJob();
}
const position = player.jobs[player.companyName];
const penalty = player.cancelationPenalty();
const penaltyString = penalty === 0.5 ? "half" : "three-quarters";
return (
You are currently working as a {position} at {player.companyName} (Current Company Reputation:{" "}
)
You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}
You will automatically finish after working for 8 hours. You can cancel earlier if you wish, but you will
only gain {penaltyString} of the reputation you've earned so far.
);
}
if (player.workType == CONSTANTS.WorkTypeCompanyPartTime) {
function cancel(): void {
player.finishWorkPartTime(true);
router.toJob();
}
function unfocus(): void {
player.stopFocusing();
router.toJob();
}
const comp = Companies[player.companyName];
let companyRep = 0;
if (comp == null || !(comp instanceof Company)) {
throw new Error(`Could not find Company: ${player.companyName}`);
}
companyRep = comp.playerReputation;
const position = player.jobs[player.companyName];
return (
You are currently working as a {position} at {player.companyName} (Current Company Reputation:{" "}
)
You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}
You will automatically finish after working for 8 hours. You can cancel earlier if you wish, and there will
be no penalty because this is a part-time job.
);
}
if (player.crimeType !== "") {
const percent = Math.round((player.timeWorked / player.timeNeededToCompleteWork) * 100);
let numBars = Math.round(percent / 5);
if (numBars < 0) {
numBars = 0;
}
if (numBars > 20) {
numBars = 20;
}
// const progressBar = "[" + Array(numBars + 1).join("|") + Array(20 - numBars + 1).join(" ") + "]";
const progressBar = createProgressBarText({ progress: (numBars + 1) / 20, totalTicks: 20 });
return (
You are attempting to {player.crimeType}.
Time remaining: {convertTimeMsToTimeElapsedString(player.timeNeededToCompleteWork - player.timeWorked)}
{progressBar}
);
}
if (player.createProgramName !== "") {
return (
You are currently working on coding {player.createProgramName}.
You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}
The program is {((player.timeWorkedCreateProgram / player.timeNeededToCompleteWork) * 100).toFixed(2)}
% complete.
If you cancel, your work will be saved and you can come back to complete the program later.
);
}
if (!player.workType) router.toTerminal();
return <>>;
}