mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 17:53:00 +02:00
Added hacknet node api functions for spending hashes. Fixed several bugs with v0.46.0. Rebalanced hash upgrades. continued working on terminal directory implementation
This commit is contained in:
@@ -36,12 +36,12 @@ import { netscriptCanGrow,
|
||||
import { getCostOfNextHacknetNode,
|
||||
getCostOfNextHacknetServer,
|
||||
purchaseHacknet,
|
||||
hasHacknetServers } from "./Hacknet/HacknetHelpers";
|
||||
hasHacknetServers,
|
||||
purchaseHashUpgrade } from "./Hacknet/HacknetHelpers";
|
||||
import { CityName } from "./Locations/data/CityNames";
|
||||
import { LocationName } from "./Locations/data/LocationNames";
|
||||
|
||||
import { HacknetServer } from "./Hacknet/HacknetServer";
|
||||
import {Locations} from "./Locations";
|
||||
import { Message } from "./Message/Message";
|
||||
import { Messages } from "./Message/MessageHelpers";
|
||||
import {inMission} from "./Missions";
|
||||
@@ -363,6 +363,19 @@ function NetscriptFunctions(workerScript) {
|
||||
if (!hasHacknetServers()) { return Infinity; }
|
||||
const node = getHacknetNode(i);
|
||||
return node.calculateCacheUpgradeCost(n);
|
||||
},
|
||||
numHashes : function() {
|
||||
if (!hasHacknetServers()) { return 0; }
|
||||
return Player.hashManager.hashes;
|
||||
},
|
||||
hashCost : function(upgName) {
|
||||
if (!hasHacknetServers()) { return Infinity; }
|
||||
|
||||
return Player.hashManager.getUpgradeCost(upgName);
|
||||
},
|
||||
spendHashes : function(upgName, upgTarget) {
|
||||
if (!hasHacknetServers()) { return false; }
|
||||
return purchaseHashUpgrade(upgName, upgTarget);
|
||||
}
|
||||
},
|
||||
sprintf : sprintf,
|
||||
@@ -2852,10 +2865,6 @@ function NetscriptFunctions(workerScript) {
|
||||
AddToAllServers(darkweb);
|
||||
SpecialServerIps.addIp("Darkweb Server", darkweb.ip);
|
||||
|
||||
const purchaseTor = document.getElementById("location-purchase-tor");
|
||||
purchaseTor.setAttribute("class", "a-link-button-bought");
|
||||
purchaseTor.innerHTML = "TOR Router - Purchased";
|
||||
|
||||
Player.getHomeComputer().serversOnNetwork.push(darkweb.ip);
|
||||
darkweb.serversOnNetwork.push(Player.getHomeComputer().ip);
|
||||
Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);
|
||||
|
||||
Reference in New Issue
Block a user