mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
allbuild commit /usr/bin/git
This commit is contained in:
parent
bfa30dcdbb
commit
06b2ec8957
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -3,6 +3,7 @@ import { IPlayer } from "../PersonObjects/IPlayer";
|
|||||||
import { Exploit } from "../Exploits/Exploit";
|
import { Exploit } from "../Exploits/Exploit";
|
||||||
import * as bcrypt from "bcryptjs";
|
import * as bcrypt from "bcryptjs";
|
||||||
import { INetscriptHelper } from "./INetscriptHelper";
|
import { INetscriptHelper } from "./INetscriptHelper";
|
||||||
|
import { Augmentations } from "../Augmentation/Augmentations";
|
||||||
|
|
||||||
export interface INetscriptExtra {
|
export interface INetscriptExtra {
|
||||||
heart: {
|
heart: {
|
||||||
|
@ -91,25 +91,25 @@ export function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript, he
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
upgradeLevel: function (_i: unknown, _n: unknown): boolean {
|
upgradeLevel: function (_i: unknown, _n: unknown = 1): boolean {
|
||||||
const i = helper.number("upgradeLevel", "i", _i);
|
const i = helper.number("upgradeLevel", "i", _i);
|
||||||
const n = helper.number("upgradeLevel", "n", _n);
|
const n = helper.number("upgradeLevel", "n", _n);
|
||||||
const node = getHacknetNode(i, "upgradeLevel");
|
const node = getHacknetNode(i, "upgradeLevel");
|
||||||
return purchaseLevelUpgrade(player, node, n);
|
return purchaseLevelUpgrade(player, node, n);
|
||||||
},
|
},
|
||||||
upgradeRam: function (_i: unknown, _n: unknown): boolean {
|
upgradeRam: function (_i: unknown, _n: unknown = 1): boolean {
|
||||||
const i = helper.number("upgradeRam", "i", _i);
|
const i = helper.number("upgradeRam", "i", _i);
|
||||||
const n = helper.number("upgradeRam", "n", _n);
|
const n = helper.number("upgradeRam", "n", _n);
|
||||||
const node = getHacknetNode(i, "upgradeRam");
|
const node = getHacknetNode(i, "upgradeRam");
|
||||||
return purchaseRamUpgrade(player, node, n);
|
return purchaseRamUpgrade(player, node, n);
|
||||||
},
|
},
|
||||||
upgradeCore: function (_i: unknown, _n: unknown): boolean {
|
upgradeCore: function (_i: unknown, _n: unknown = 1): boolean {
|
||||||
const i = helper.number("upgradeCore", "i", _i);
|
const i = helper.number("upgradeCore", "i", _i);
|
||||||
const n = helper.number("upgradeCore", "n", _n);
|
const n = helper.number("upgradeCore", "n", _n);
|
||||||
const node = getHacknetNode(i, "upgradeCore");
|
const node = getHacknetNode(i, "upgradeCore");
|
||||||
return purchaseCoreUpgrade(player, node, n);
|
return purchaseCoreUpgrade(player, node, n);
|
||||||
},
|
},
|
||||||
upgradeCache: function (_i: unknown, _n: unknown): boolean {
|
upgradeCache: function (_i: unknown, _n: unknown = 1): boolean {
|
||||||
const i = helper.number("upgradeCache", "i", _i);
|
const i = helper.number("upgradeCache", "i", _i);
|
||||||
const n = helper.number("upgradeCache", "n", _n);
|
const n = helper.number("upgradeCache", "n", _n);
|
||||||
if (!hasHacknetServers(player)) {
|
if (!hasHacknetServers(player)) {
|
||||||
@ -126,25 +126,25 @@ export function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript, he
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
getLevelUpgradeCost: function (_i: unknown, _n: unknown): number {
|
getLevelUpgradeCost: function (_i: unknown, _n: unknown = 1): number {
|
||||||
const i = helper.number("getLevelUpgradeCost", "i", _i);
|
const i = helper.number("getLevelUpgradeCost", "i", _i);
|
||||||
const n = helper.number("getLevelUpgradeCost", "n", _n);
|
const n = helper.number("getLevelUpgradeCost", "n", _n);
|
||||||
const node = getHacknetNode(i, "upgradeLevel");
|
const node = getHacknetNode(i, "upgradeLevel");
|
||||||
return node.calculateLevelUpgradeCost(n, player.hacknet_node_level_cost_mult);
|
return node.calculateLevelUpgradeCost(n, player.hacknet_node_level_cost_mult);
|
||||||
},
|
},
|
||||||
getRamUpgradeCost: function (_i: unknown, _n: unknown): number {
|
getRamUpgradeCost: function (_i: unknown, _n: unknown = 1): number {
|
||||||
const i = helper.number("getRamUpgradeCost", "i", _i);
|
const i = helper.number("getRamUpgradeCost", "i", _i);
|
||||||
const n = helper.number("getRamUpgradeCost", "n", _n);
|
const n = helper.number("getRamUpgradeCost", "n", _n);
|
||||||
const node = getHacknetNode(i, "upgradeRam");
|
const node = getHacknetNode(i, "upgradeRam");
|
||||||
return node.calculateRamUpgradeCost(n, player.hacknet_node_ram_cost_mult);
|
return node.calculateRamUpgradeCost(n, player.hacknet_node_ram_cost_mult);
|
||||||
},
|
},
|
||||||
getCoreUpgradeCost: function (_i: unknown, _n: unknown): number {
|
getCoreUpgradeCost: function (_i: unknown, _n: unknown = 1): number {
|
||||||
const i = helper.number("getCoreUpgradeCost", "i", _i);
|
const i = helper.number("getCoreUpgradeCost", "i", _i);
|
||||||
const n = helper.number("getCoreUpgradeCost", "n", _n);
|
const n = helper.number("getCoreUpgradeCost", "n", _n);
|
||||||
const node = getHacknetNode(i, "upgradeCore");
|
const node = getHacknetNode(i, "upgradeCore");
|
||||||
return node.calculateCoreUpgradeCost(n, player.hacknet_node_core_cost_mult);
|
return node.calculateCoreUpgradeCost(n, player.hacknet_node_core_cost_mult);
|
||||||
},
|
},
|
||||||
getCacheUpgradeCost: function (_i: unknown, _n: unknown): number {
|
getCacheUpgradeCost: function (_i: unknown, _n: unknown = 1): number {
|
||||||
const i = helper.number("getCacheUpgradeCost", "i", _i);
|
const i = helper.number("getCacheUpgradeCost", "i", _i);
|
||||||
const n = helper.number("getCacheUpgradeCost", "n", _n);
|
const n = helper.number("getCacheUpgradeCost", "n", _n);
|
||||||
if (!hasHacknetServers(player)) {
|
if (!hasHacknetServers(player)) {
|
||||||
@ -177,10 +177,9 @@ export function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript, he
|
|||||||
|
|
||||||
return player.hashManager.getUpgradeCost(upgName);
|
return player.hashManager.getUpgradeCost(upgName);
|
||||||
},
|
},
|
||||||
spendHashes: function (_upgName: unknown, _upgTarget: unknown): boolean {
|
spendHashes: function (_upgName: unknown, _upgTarget: unknown = ""): boolean {
|
||||||
const upgName = helper.string("spendHashes", "upgName", _upgName);
|
const upgName = helper.string("spendHashes", "upgName", _upgName);
|
||||||
let upgTarget = "";
|
const upgTarget = helper.string("spendHashes", "upgTarget", _upgTarget);
|
||||||
if (_upgTarget !== undefined) upgTarget = helper.string("spendHashes", "upgTarget", _upgTarget);
|
|
||||||
if (!hasHacknetServers(player)) {
|
if (!hasHacknetServers(player)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user