Merge branch 'dev' into feature/add-back-api-export

This commit is contained in:
hydroflame 2022-09-23 00:34:19 -03:00 committed by GitHub
commit e49bd3d091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 66 additions and 37 deletions

2
.gitignore vendored

@ -18,3 +18,5 @@ Netburner.txt
# editor files
.vscode
.idea/

@ -39,21 +39,23 @@ List of Factions and their Requirements
.. _gameplay_factions::
+---------------------+----------------+-----------------------------------------+-------------------------------+
+---------------------+--------------------+-----------------------------------------+-------------------------------+
| Early Game | Faction Name | Requirements | Joining this Faction prevents |
| Factions | | | you from joining: |
+ +----------------+-----------------------------------------+-------------------------------+
+ +--------------------+-----------------------------------------+-------------------------------+
| | CyberSec | * Install a backdoor on the CSEC server | |
+ +----------------+-----------------------------------------+-------------------------------+
+ +--------------------+-----------------------------------------+-------------------------------+
| | Tian Di Hui | * $1m | |
| | | * Hacking Level 50 | |
| | | * Be in Chongqing, New Tokyo, or Ishima | |
+ +----------------+-----------------------------------------+-------------------------------+
+ +--------------------+-----------------------------------------+-------------------------------+
| | Netburners | * Hacking Level 80 | |
| | | * Total Hacknet Levels of 100 | |
| | | * Total Hacknet RAM of 8 | |
| | | * Total Hacknet Cores of 4 | |
+---------------------+----------------+-----------------------------------------+-------------------------------+
+ +--------------------+-----------------------------------------+-------------------------------+
| | Shadows of Anarchy | * Successfully infiltrate a company | |
+---------------------+--------------------+-----------------------------------------+-------------------------------+
.. raw:: html
</details>

@ -9,5 +9,6 @@ module.exports = {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/test/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js",
"\\!!raw-loader!.*$": "<rootDir>/test/__mocks__/rawLoader.js",
},
};

@ -69,7 +69,7 @@ function checkForMessagesToSend(): void {
const truthGazer = Messages[MessageFilenames.TruthGazer];
const redpill = Messages[MessageFilenames.RedPill];
if (Player.hasAugmentation(AugmentationNames.TheRedPill)) {
if (Player.hasAugmentation(AugmentationNames.TheRedPill, true)) {
//Get the world daemon required hacking level
const worldDaemon = GetServer(SpecialServers.WorldDaemon);
if (!(worldDaemon instanceof Server)) {

@ -55,6 +55,7 @@ import { FactionWorkType } from "../Work/data/FactionWorkType";
import { CompanyWork } from "../Work/CompanyWork";
import { canGetBonus, onExport } from "../ExportBonus";
import { saveObject } from "../SaveObject";
import { calculateCrimeWorkStats } from "../Work/formulas/Crime";
export function NetscriptSingularity(): InternalAPI<ISingularity> {
const getAugmentation = function (ctx: NetscriptContext, name: string): Augmentation {
@ -1210,7 +1211,19 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
throw helpers.makeRuntimeErrorMsg(ctx, `Invalid crime: ${crimeRoughName}`);
}
return Object.assign({}, crime);
const crimeStatsWithMultipliers = calculateCrimeWorkStats(crime);
return Object.assign({}, crime, {
money: crimeStatsWithMultipliers.money,
reputation: crimeStatsWithMultipliers.reputation,
hacking_exp: crimeStatsWithMultipliers.hackExp,
strength_exp: crimeStatsWithMultipliers.strExp,
defense_exp: crimeStatsWithMultipliers.defExp,
dexterity_exp: crimeStatsWithMultipliers.dexExp,
agility_exp: crimeStatsWithMultipliers.agiExp,
charisma_exp: crimeStatsWithMultipliers.chaExp,
intelligence_exp: crimeStatsWithMultipliers.intExp,
});
},
getDarkwebPrograms: (ctx: NetscriptContext) =>
function (): string[] {

@ -142,7 +142,7 @@ export function NetscriptStanek(): InternalAPI<IStanek> {
//Return true iff the player is in CotMG and has the first Stanek aug installed
return (
Factions[FactionNames.ChurchOfTheMachineGod].isMember &&
player.hasAugmentation(AugmentationNames.StaneksGift1)
player.hasAugmentation(AugmentationNames.StaneksGift1, true)
);
},
};

@ -1462,7 +1462,7 @@ export function sourceFileLvl(this: IPlayer, n: number): number {
export function focusPenalty(this: IPlayer): number {
let focus = 1;
if (!this.hasAugmentation(AugmentationNames["NeuroreceptorManager"])) {
if (!this.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {
focus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;
}
return focus;

@ -159,6 +159,7 @@ export class Sleeve extends Person {
this.exp.agility = 0;
this.exp.charisma = 0;
this.updateStatLevels();
this.hp.current = this.hp.max;
// Reset task-related stuff
this.stopWork(p);
@ -440,6 +441,9 @@ export class Sleeve extends Person {
case "Diplomacy":
this.startWork(p, new SleeveBladeburnerWork({ type: "General", name: "Diplomacy" }));
return true;
case "Hyperbolic Regeneration Chamber":
this.startWork(p, new SleeveBladeburnerWork({ type: "General", name: "Hyperbolic Regeneration Chamber" }));
return true;
case "Infiltrate synthoids":
this.startWork(p, new SleeveInfiltrateWork());
return true;

@ -35,6 +35,7 @@ const bladeburnerSelectorOptions: string[] = [
"Field analysis",
"Recruitment",
"Diplomacy",
"Hyperbolic Regeneration Chamber",
"Infiltrate synthoids",
"Support main sleeve",
"Take on contracts",
@ -285,6 +286,8 @@ function getABC(sleeve: Sleeve): [string, string, string] {
return ["Perform Bladeburner Actions", "Diplomacy", "------"];
case "Recruitment":
return ["Perform Bladeburner Actions", "Recruitment", "------"];
case "Hyperbolic Regeneration Chamber":
return ["Perform Bladeburner Actions", "Hyperbolic Regeneration Chamber", "------"];
}
}

@ -55,15 +55,15 @@ export function prestigeAugmentation(): void {
AddToAllServers(homeComp);
prestigeHomeComputer(Player, homeComp);
if (augmentationExists(AugmentationNames.Neurolink) && Player.hasAugmentation(AugmentationNames.Neurolink)) {
if (augmentationExists(AugmentationNames.Neurolink) && Player.hasAugmentation(AugmentationNames.Neurolink, true)) {
homeComp.programs.push(Programs.FTPCrackProgram.name);
homeComp.programs.push(Programs.RelaySMTPProgram.name);
}
if (augmentationExists(AugmentationNames.CashRoot) && Player.hasAugmentation(AugmentationNames.CashRoot)) {
if (augmentationExists(AugmentationNames.CashRoot) && Player.hasAugmentation(AugmentationNames.CashRoot, true)) {
Player.setMoney(1e6);
homeComp.programs.push(Programs.BruteSSHProgram.name);
}
if (augmentationExists(AugmentationNames.PCMatrix) && Player.hasAugmentation(AugmentationNames.PCMatrix)) {
if (augmentationExists(AugmentationNames.PCMatrix) && Player.hasAugmentation(AugmentationNames.PCMatrix, true)) {
homeComp.programs.push(Programs.DeepscanV1.name);
homeComp.programs.push(Programs.AutoLink.name);
}
@ -151,7 +151,7 @@ export function prestigeAugmentation(): void {
}
// Red Pill
if (augmentationExists(AugmentationNames.TheRedPill) && Player.hasAugmentation(AugmentationNames.TheRedPill)) {
if (augmentationExists(AugmentationNames.TheRedPill) && Player.hasAugmentation(AugmentationNames.TheRedPill, true)) {
const WorldDaemon = GetServer(SpecialServers.WorldDaemon);
const DaedalusServer = GetServer(SpecialServers.DaedalusServer);
if (WorldDaemon && DaedalusServer) {
@ -160,7 +160,10 @@ export function prestigeAugmentation(): void {
}
}
if (augmentationExists(AugmentationNames.StaneksGift1) && Player.hasAugmentation(AugmentationNames.StaneksGift1)) {
if (
augmentationExists(AugmentationNames.StaneksGift1) &&
Player.hasAugmentation(AugmentationNames.StaneksGift1, true)
) {
joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);
}

@ -35,7 +35,7 @@ export class CompanyWork extends Work {
getGainRates(player: IPlayer): WorkStats {
let focusBonus = 1;
if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {
if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {
focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;
}
return scaleWorkStats(calculateCompanyWorkStats(player, player, this.getCompany()), focusBonus);

@ -58,7 +58,7 @@ export class CreateProgramWork extends Work {
process(player: IPlayer, cycles: number): boolean {
let focusBonus = 1;
if (!player.hasAugmentation(AugmentationNames["NeuroreceptorManager"])) {
if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {
focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;
}
//Higher hacking skill will allow you to create programs faster

@ -39,7 +39,7 @@ export class FactionWork extends Work {
getReputationRate(player: IPlayer): number {
let focusBonus = 1;
if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {
if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {
focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;
}
return calculateFactionRep(player, this.factionWorkType, this.getFaction().favor) * focusBonus;
@ -47,7 +47,7 @@ export class FactionWork extends Work {
getExpRates(player: IPlayer): WorkStats {
let focusBonus = 1;
if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {
if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {
focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;
}
const rate = calculateFactionExp(player, this.factionWorkType);

@ -37,7 +37,7 @@ export class GraftingWork extends Work {
process(player: IPlayer, cycles: number): boolean {
let focusBonus = 1;
if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {
if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager, true)) {
focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;
}
@ -52,7 +52,7 @@ export class GraftingWork extends Work {
if (!cancelled) {
applyAugmentation({ name: augName, level: 1 });
if (!player.hasAugmentation(AugmentationNames.CongruityImplant)) {
if (!player.hasAugmentation(AugmentationNames.CongruityImplant, true)) {
player.entropy += 1;
player.applyEntropy(player.entropy);
}
@ -62,7 +62,7 @@ export class GraftingWork extends Work {
<>
You've finished grafting {augName}.<br />
The augmentation has been applied to your body{" "}
{player.hasAugmentation(AugmentationNames.CongruityImplant) ? "." : ", but you feel a bit off."}
{player.hasAugmentation(AugmentationNames.CongruityImplant, true) ? "." : ", but you feel a bit off."}
</>,
);
}

@ -119,6 +119,7 @@ function ExpRows(rate: WorkStats): React.ReactElement[] {
];
}
/* Because crime exp is given all at once at the end, we don't care about the cycles per second. */
function CrimeExpRows(rate: WorkStats): React.ReactElement[] {
return [
rate.hackExp > 0 ? (
@ -126,7 +127,7 @@ function CrimeExpRows(rate: WorkStats): React.ReactElement[] {
name="Hacking Exp"
color={Settings.theme.hack}
data={{
content: `${numeralWrapper.formatExp(rate.hackExp * CYCLES_PER_SEC)}`,
content: `${numeralWrapper.formatExp(rate.hackExp)}`,
}}
/>
) : (
@ -137,7 +138,7 @@ function CrimeExpRows(rate: WorkStats): React.ReactElement[] {
name="Strength Exp"
color={Settings.theme.combat}
data={{
content: `${numeralWrapper.formatExp(rate.strExp * CYCLES_PER_SEC)}`,
content: `${numeralWrapper.formatExp(rate.strExp)}`,
}}
/>
) : (
@ -148,7 +149,7 @@ function CrimeExpRows(rate: WorkStats): React.ReactElement[] {
name="Defense Exp"
color={Settings.theme.combat}
data={{
content: `${numeralWrapper.formatExp(rate.defExp * CYCLES_PER_SEC)}`,
content: `${numeralWrapper.formatExp(rate.defExp)}`,
}}
/>
) : (
@ -159,7 +160,7 @@ function CrimeExpRows(rate: WorkStats): React.ReactElement[] {
name="Dexterity Exp"
color={Settings.theme.combat}
data={{
content: `${numeralWrapper.formatExp(rate.dexExp * CYCLES_PER_SEC)}`,
content: `${numeralWrapper.formatExp(rate.dexExp)}`,
}}
/>
) : (
@ -170,7 +171,7 @@ function CrimeExpRows(rate: WorkStats): React.ReactElement[] {
name="Agility Exp"
color={Settings.theme.combat}
data={{
content: `${numeralWrapper.formatExp(rate.agiExp * CYCLES_PER_SEC)}`,
content: `${numeralWrapper.formatExp(rate.agiExp)}`,
}}
/>
) : (
@ -181,7 +182,7 @@ function CrimeExpRows(rate: WorkStats): React.ReactElement[] {
name="Charisma Exp"
color={Settings.theme.cha}
data={{
content: `${numeralWrapper.formatExp(rate.chaExp * CYCLES_PER_SEC)}`,
content: `${numeralWrapper.formatExp(rate.chaExp)}`,
}}
/>
) : (