mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-21 13:45:44 +01:00
commit
93db9c513a
@ -58,8 +58,8 @@
|
||||
|
||||
#terminal-input-td textarea {
|
||||
overflow: hidden;
|
||||
resize:none;
|
||||
height:auto;
|
||||
resize: none;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#terminal-input-header {
|
||||
|
@ -33,7 +33,7 @@ export const TerminalHelpText: string =
|
||||
"theme [preset] | bg txt hlgt Change the color scheme of the UI<br>" +
|
||||
"top Displays all running scripts and their RAM usage<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> {
|
||||
[key: string]: T;
|
||||
|
@ -468,6 +468,8 @@ function updateInfiltrationLevelText(inst) {
|
||||
}
|
||||
|
||||
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 =
|
||||
"Facility name: " + inst.companyName + "<br>" +
|
||||
"Clearance Level: " + inst.clearanceLevel + "<br>" +
|
||||
@ -481,6 +483,7 @@ function updateInfiltrationLevelText(inst) {
|
||||
"Dex exp gained: " + formatNumber(inst.dexExpGained * expMultiplier, 3) + "<br>" +
|
||||
"Agi exp gained: " + formatNumber(inst.agiExpGained * expMultiplier, 3) + "<br>" +
|
||||
"Cha exp gained: " + formatNumber(inst.chaExpGained * expMultiplier, 3);
|
||||
/* eslint-enable no-irregular-whitespace */
|
||||
}
|
||||
|
||||
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";
|
||||
|
||||
/**
|
||||
* Represents the valuation of a company in the World Stock Exchange.
|
||||
*/
|
||||
export class Stock {
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
b: boolean;
|
||||
|
||||
/**
|
||||
* Maximum volatility
|
||||
@ -49,9 +22,9 @@ export class Stock {
|
||||
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
|
||||
@ -59,16 +32,46 @@ export class Stock {
|
||||
*/
|
||||
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
|
||||
*/
|
||||
posTxtEl: HTMLElement | null;
|
||||
|
||||
constructor(name: string="",
|
||||
symbol: string="",
|
||||
mv: number=1,
|
||||
b: boolean=true,
|
||||
otlkMag: number=0,
|
||||
/**
|
||||
* Stock's share price
|
||||
*/
|
||||
price: number;
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
this.name = name;
|
||||
this.symbol = symbol;
|
||||
|
@ -1400,6 +1400,7 @@ let Terminal = {
|
||||
post("Incorrect usage of scan-analyze command. usage: scan-analyze [depth]");
|
||||
}
|
||||
break;
|
||||
/* eslint-disable no-case-declarations */
|
||||
case "scp":
|
||||
if (commandArray.length != 2) {
|
||||
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}`);
|
||||
break;
|
||||
/* eslint-enable no-case-declarations */
|
||||
case "sudov":
|
||||
if (commandArray.length != 1) {
|
||||
post("Incorrect number of arguments. Usage: sudov"); return;
|
||||
@ -1616,6 +1618,7 @@ let Terminal = {
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* eslint-disable no-case-declarations */
|
||||
case "wget":
|
||||
if (commandArray.length !== 2) {
|
||||
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));
|
||||
})
|
||||
break;
|
||||
/* eslint-enable no-case-declarations */
|
||||
default:
|
||||
post("Command not found");
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { getElementById } from "../../utils/uiHelpers/getElementById";
|
||||
import { getElementById } from "../../utils/uiHelpers/getElementById";
|
||||
|
||||
/**
|
||||
* Adds some output to the terminal.
|
||||
|
Loading…
Reference in New Issue
Block a user