mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-23 14:42:28 +01:00
commit
93db9c513a
@ -58,8 +58,8 @@
|
|||||||
|
|
||||||
#terminal-input-td textarea {
|
#terminal-input-td textarea {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
resize:none;
|
resize: none;
|
||||||
height:auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#terminal-input-header {
|
#terminal-input-header {
|
||||||
|
@ -33,7 +33,7 @@ export const TerminalHelpText: string =
|
|||||||
"theme [preset] | bg txt hlgt Change the color scheme of the UI<br>" +
|
"theme [preset] | bg txt hlgt Change the color scheme of the UI<br>" +
|
||||||
"top Displays all running scripts and their RAM usage<br>" +
|
"top Displays all running scripts and their RAM usage<br>" +
|
||||||
'unalias "[alias name]" Deletes the specified alias<br>' +
|
'unalias "[alias name]" Deletes the specified alias<br>' +
|
||||||
'wget [url] [target file] Retrieves code/text from a web server<br>';
|
"wget [url] [target file] Retrieves code/text from a web server<br>";
|
||||||
|
|
||||||
interface IMap<T> {
|
interface IMap<T> {
|
||||||
[key: string]: T;
|
[key: string]: T;
|
||||||
|
@ -468,6 +468,8 @@ function updateInfiltrationLevelText(inst) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var expMultiplier = 2 * inst.clearanceLevel / inst.maxClearanceLevel;
|
var expMultiplier = 2 * inst.clearanceLevel / inst.maxClearanceLevel;
|
||||||
|
// TODO: fix this to not rely on <pre> and whitespace for formatting...
|
||||||
|
/* eslint-disable no-irregular-whitespace */
|
||||||
document.getElementById("infiltration-level-text").innerHTML =
|
document.getElementById("infiltration-level-text").innerHTML =
|
||||||
"Facility name: " + inst.companyName + "<br>" +
|
"Facility name: " + inst.companyName + "<br>" +
|
||||||
"Clearance Level: " + inst.clearanceLevel + "<br>" +
|
"Clearance Level: " + inst.clearanceLevel + "<br>" +
|
||||||
@ -481,6 +483,7 @@ function updateInfiltrationLevelText(inst) {
|
|||||||
"Dex exp gained: " + formatNumber(inst.dexExpGained * expMultiplier, 3) + "<br>" +
|
"Dex exp gained: " + formatNumber(inst.dexExpGained * expMultiplier, 3) + "<br>" +
|
||||||
"Agi exp gained: " + formatNumber(inst.agiExpGained * expMultiplier, 3) + "<br>" +
|
"Agi exp gained: " + formatNumber(inst.agiExpGained * expMultiplier, 3) + "<br>" +
|
||||||
"Cha exp gained: " + formatNumber(inst.chaExpGained * expMultiplier, 3);
|
"Cha exp gained: " + formatNumber(inst.chaExpGained * expMultiplier, 3);
|
||||||
|
/* eslint-enable no-irregular-whitespace */
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateInfiltrationButtons(inst, scenario) {
|
function updateInfiltrationButtons(inst, scenario) {
|
||||||
|
81
src/Stock.ts
81
src/Stock.ts
@ -1,5 +1,8 @@
|
|||||||
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
|
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the valuation of a company in the World Stock Exchange.
|
||||||
|
*/
|
||||||
export class Stock {
|
export class Stock {
|
||||||
/**
|
/**
|
||||||
* Initializes a Stock from a JSON save state
|
* Initializes a Stock from a JSON save state
|
||||||
@ -9,39 +12,9 @@ export class Stock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The stock's ticker symbol
|
* Bear or bull (more likely to go up or down, based on otlkMag)
|
||||||
*/
|
*/
|
||||||
readonly symbol: string;
|
b: boolean;
|
||||||
|
|
||||||
/**
|
|
||||||
* Name of the company that the stock is for
|
|
||||||
*/
|
|
||||||
readonly name: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Stock's share price
|
|
||||||
*/
|
|
||||||
price: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Number of shares the player owns in the LONG position
|
|
||||||
*/
|
|
||||||
playerShares: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Average price of stocks that the player owns in the LONG position
|
|
||||||
*/
|
|
||||||
playerAvgPx: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Number of shares the player owns in the SHORT position
|
|
||||||
*/
|
|
||||||
playerShortShares: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Average price of stocks that the player owns in the SHORT position
|
|
||||||
*/
|
|
||||||
playerAvgShortPx: number;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum volatility
|
* Maximum volatility
|
||||||
@ -49,9 +22,9 @@ export class Stock {
|
|||||||
readonly mv: number;
|
readonly mv: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bear or bull (more likely to go up or down, based on otlkMag)
|
* Name of the company that the stock is for
|
||||||
*/
|
*/
|
||||||
b: boolean;
|
readonly name: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Outlook magnitude. Represents the stock's forecast and likelihood
|
* Outlook magnitude. Represents the stock's forecast and likelihood
|
||||||
@ -59,16 +32,46 @@ export class Stock {
|
|||||||
*/
|
*/
|
||||||
otlkMag: number;
|
otlkMag: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Average price of stocks that the player owns in the LONG position
|
||||||
|
*/
|
||||||
|
playerAvgPx: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Average price of stocks that the player owns in the SHORT position
|
||||||
|
*/
|
||||||
|
playerAvgShortPx: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of shares the player owns in the LONG position
|
||||||
|
*/
|
||||||
|
playerShares: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of shares the player owns in the SHORT position
|
||||||
|
*/
|
||||||
|
playerShortShares: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The HTML element that displays the stock's info in the UI
|
* The HTML element that displays the stock's info in the UI
|
||||||
*/
|
*/
|
||||||
posTxtEl: HTMLElement | null;
|
posTxtEl: HTMLElement | null;
|
||||||
|
|
||||||
constructor(name: string="",
|
/**
|
||||||
symbol: string="",
|
* Stock's share price
|
||||||
mv: number=1,
|
*/
|
||||||
b: boolean=true,
|
price: number;
|
||||||
otlkMag: number=0,
|
|
||||||
|
/**
|
||||||
|
* The stock's ticker symbol
|
||||||
|
*/
|
||||||
|
readonly symbol: string;
|
||||||
|
|
||||||
|
constructor(name: string = "",
|
||||||
|
symbol: string = "",
|
||||||
|
mv: number = 1,
|
||||||
|
b: boolean = true,
|
||||||
|
otlkMag: number = 0,
|
||||||
initPrice: number = 10e3) {
|
initPrice: number = 10e3) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.symbol = symbol;
|
this.symbol = symbol;
|
||||||
|
@ -1400,6 +1400,7 @@ let Terminal = {
|
|||||||
post("Incorrect usage of scan-analyze command. usage: scan-analyze [depth]");
|
post("Incorrect usage of scan-analyze command. usage: scan-analyze [depth]");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
/* eslint-disable no-case-declarations */
|
||||||
case "scp":
|
case "scp":
|
||||||
if (commandArray.length != 2) {
|
if (commandArray.length != 2) {
|
||||||
post("Incorrect usage of scp command. Usage: scp [file] [destination hostname/ip]");
|
post("Incorrect usage of scp command. Usage: scp [file] [destination hostname/ip]");
|
||||||
@ -1493,6 +1494,7 @@ let Terminal = {
|
|||||||
}
|
}
|
||||||
post(`${scriptname} copied over to ${destServer.hostname}`);
|
post(`${scriptname} copied over to ${destServer.hostname}`);
|
||||||
break;
|
break;
|
||||||
|
/* eslint-enable no-case-declarations */
|
||||||
case "sudov":
|
case "sudov":
|
||||||
if (commandArray.length != 1) {
|
if (commandArray.length != 1) {
|
||||||
post("Incorrect number of arguments. Usage: sudov"); return;
|
post("Incorrect number of arguments. Usage: sudov"); return;
|
||||||
@ -1616,6 +1618,7 @@ let Terminal = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
/* eslint-disable no-case-declarations */
|
||||||
case "wget":
|
case "wget":
|
||||||
if (commandArray.length !== 2) {
|
if (commandArray.length !== 2) {
|
||||||
return post("Incorrect usage of wget command. Usage: wget [url] [target file]");
|
return post("Incorrect usage of wget command. Usage: wget [url] [target file]");
|
||||||
@ -1648,6 +1651,7 @@ let Terminal = {
|
|||||||
return post("wget failed: " + JSON.stringify(e));
|
return post("wget failed: " + JSON.stringify(e));
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
|
/* eslint-enable no-case-declarations */
|
||||||
default:
|
default:
|
||||||
post("Command not found");
|
post("Command not found");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user