mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-24 02:03:01 +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:
@@ -1631,9 +1631,8 @@ export function applyForJob(entryPosType, sing=false) {
|
||||
document.getElementById("world-menu-header").click();
|
||||
|
||||
if (sing) { return true; }
|
||||
dialogBoxCreate("Congratulations! You were offered a new job at " + this.companyName + " as a " + pos.name + "!");
|
||||
|
||||
Engine.loadLocationContent(false);
|
||||
dialogBoxCreate("Congratulations! You were offered a new job at " + this.companyName + " as a " + pos.name + "!");
|
||||
}
|
||||
|
||||
//Returns your next position at a company given the field (software, business, etc.)
|
||||
@@ -1734,7 +1733,6 @@ export function applyForEmployeeJob(sing=false) {
|
||||
document.getElementById("world-menu-header").click();
|
||||
if (sing) {return true;}
|
||||
dialogBoxCreate("Congratulations, you are now employed at " + this.companyName);
|
||||
Engine.loadLocationContent(false);
|
||||
} else {
|
||||
if (sing) {return false;}
|
||||
dialogBoxCreate("Unforunately, you do not qualify for this position");
|
||||
@@ -1750,7 +1748,6 @@ export function applyForPartTimeEmployeeJob(sing=false) {
|
||||
document.getElementById("world-menu-header").click();
|
||||
if (sing) {return true;}
|
||||
dialogBoxCreate("Congratulations, you are now employed part-time at " + this.companyName);
|
||||
Engine.loadLocationContent(false);
|
||||
} else {
|
||||
if (sing) {return false;}
|
||||
dialogBoxCreate("Unforunately, you do not qualify for this position");
|
||||
@@ -1766,7 +1763,6 @@ export function applyForWaiterJob(sing=false) {
|
||||
document.getElementById("world-menu-header").click();
|
||||
if (sing) {return true;}
|
||||
dialogBoxCreate("Congratulations, you are now employed as a waiter at " + this.companyName);
|
||||
Engine.loadLocationContent(false);
|
||||
} else {
|
||||
if (sing) {return false;}
|
||||
dialogBoxCreate("Unforunately, you do not qualify for this position");
|
||||
@@ -1782,7 +1778,6 @@ export function applyForPartTimeWaiterJob(sing=false) {
|
||||
document.getElementById("world-menu-header").click();
|
||||
if (sing) {return true;}
|
||||
dialogBoxCreate("Congratulations, you are now employed as a part-time waiter at " + this.companyName);
|
||||
Engine.loadLocationContent(false);
|
||||
} else {
|
||||
if (sing) {return false;}
|
||||
dialogBoxCreate("Unforunately, you do not qualify for this position");
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
/**
|
||||
* Server and HacknetServer-related methods for the Player class (PlayerObject)
|
||||
*/
|
||||
import { IPlayer } from "../IPlayer";
|
||||
|
||||
import { CONSTANTS } from "../../Constants";
|
||||
import { AllServers } from "../../Server/AllServers";
|
||||
|
||||
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
|
||||
import { HacknetServer } from "../../Hacknet/HacknetServer";
|
||||
import { AddToAllServers,
|
||||
AllServers } from "../../Server/AllServers";
|
||||
import { SpecialServerIps } from "../../Server/SpecialServerIps";
|
||||
|
||||
export function hasTorRouter(this: IPlayer) {
|
||||
@@ -28,3 +34,22 @@ export function getUpgradeHomeRamCost(this: IPlayer) {
|
||||
var cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome * mult * BitNodeMultipliers.HomeComputerRamCost;
|
||||
return cost;
|
||||
}
|
||||
|
||||
export function createHacknetServer(this: IPlayer): HacknetServer {
|
||||
const numOwned = this.hacknetNodes.length;
|
||||
const name = `hacknet-node-${numOwned}`;
|
||||
const server = new HacknetServer({
|
||||
adminRights: true,
|
||||
hostname: name,
|
||||
player: this,
|
||||
});
|
||||
this.hacknetNodes.push(server.ip);
|
||||
|
||||
// Configure the HacknetServer to actually act as a Server
|
||||
AddToAllServers(server);
|
||||
const homeComputer = this.getHomeComputer();
|
||||
homeComputer.serversOnNetwork.push(server.ip);
|
||||
server.serversOnNetwork.push(homeComputer.ip);
|
||||
|
||||
return server;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user