mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 00:04:22 +02:00
merged from upstream
This commit is contained in:
@@ -59,17 +59,20 @@ export function NetscriptExtra(player: IPlayer, workerScript: WorkerScript, help
|
||||
player.giveExploit(Exploit.RealityAlteration);
|
||||
}
|
||||
},
|
||||
rainbow: function (guess: unknown): void {
|
||||
async function tryGuess(): Promise<void> {
|
||||
const verified = await bcrypt.compare(
|
||||
rainbow: function (guess: unknown): boolean {
|
||||
function tryGuess(): boolean {
|
||||
// eslint-disable-next-line no-sync
|
||||
const verified = bcrypt.compareSync(
|
||||
helper.string("rainbow", "guess", guess),
|
||||
"$2a$10$aertxDEkgor8baVtQDZsLuMwwGYmkRM/ohcA6FjmmzIHQeTCsrCcO",
|
||||
);
|
||||
if (verified) {
|
||||
player.giveExploit(Exploit.INeedARainbow);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
tryGuess();
|
||||
return tryGuess();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ import { FactionInfos } from "../Faction/FactionInfo";
|
||||
import { InternalAPI, NetscriptContext } from "src/Netscript/APIWrapper";
|
||||
import { BlackOperationNames } from "../Bladeburner/data/BlackOperationNames";
|
||||
import { enterBitNode } from "../RedPill";
|
||||
import { FactionNames } from "../Faction/data/FactionNames";
|
||||
|
||||
export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript): InternalAPI<ISingularity> {
|
||||
const getAugmentation = function (_ctx: NetscriptContext, name: string): Augmentation {
|
||||
@@ -1173,6 +1174,13 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
|
||||
);
|
||||
return false;
|
||||
}
|
||||
if (faction.name === FactionNames.ChurchOfTheMachineGod || faction.name === FactionNames.Bladeburners) {
|
||||
workerScript.log(
|
||||
"donateToFaction",
|
||||
() => `You can't donate to '${facName}' because they do not accept donations`,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
if (typeof amt !== "number" || amt <= 0 || isNaN(amt)) {
|
||||
workerScript.log("donateToFaction", () => `Invalid donation amount: '${amt}'.`);
|
||||
return false;
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
SleeveSkills,
|
||||
SleeveTask,
|
||||
} from "../ScriptEditor/NetscriptDefinitions";
|
||||
import { checkEnum } from "../utils/helpers/checkEnum";
|
||||
|
||||
export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): ISleeve {
|
||||
const checkSleeveAPIAccess = function (func: string): void {
|
||||
@@ -99,7 +100,11 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel
|
||||
const cityName = helper.string("travel", "cityName", _cityName);
|
||||
checkSleeveAPIAccess("travel");
|
||||
checkSleeveNumber("travel", sleeveNumber);
|
||||
return player.sleeves[sleeveNumber].travel(player, cityName as CityName);
|
||||
if (checkEnum(CityName, cityName)) {
|
||||
return player.sleeves[sleeveNumber].travel(player, cityName);
|
||||
} else {
|
||||
throw helper.makeRuntimeErrorMsg("sleeve.setToCompanyWork", `Invalid city name: '${cityName}'.`);
|
||||
}
|
||||
},
|
||||
setToCompanyWork: function (_sleeveNumber: unknown, acompanyName: unknown): boolean {
|
||||
updateRam("setToCompanyWork");
|
||||
|
||||
Reference in New Issue
Block a user