Added new Text Files (downloadable) and their corresponding Terminal commands. Added sprintf and vsprintf.

This commit is contained in:
danielyxie
2017-10-12 15:10:34 -05:00
parent dbb4a93a78
commit 4186326771
9 changed files with 388 additions and 107 deletions

View File

@ -35,9 +35,6 @@
font-family: 'Lucida Console', 'Lucida Sans Unicode', 'Fira Mono', 'Consolas', 'Courier New', Courier, monospace, 'Times New Roman';
}
#javascript-editor textarea {
}
.ace_line,
.ace_line * {
background-color:transparent;
@ -629,8 +626,6 @@ div.faction-clear {
padding: 6px;
}
.gang-member-header {
background-color: #444;
font-size: 20px;

View File

@ -24,18 +24,13 @@
}
.hack-mission-node {
color:gray;
z-index:5;
background-color:gray;
align-self: center;
justify-self: center;
display:inline-block;
}
.hack-mission-node p {
color:white;
font-size:12px;
margin-top: 8px;
text-align:center;
-webkit-user-select: none;
-moz-user-select: none;
@ -50,12 +45,11 @@
.hack-mission-player-node-active {
border: 2px solid white;
color: #6666ff;
background-color: #6666ff;
}
.hack-mission-enemy-node {
color:red;
color:white;
background-color:red;
}
@ -84,10 +78,39 @@
-webkit-transform: skew(-20deg);
-moz-transform: skew(-20deg);
-o-transform: skew(-20deg);
color:white;
font-size:12px;
margin-top: 8px;
text-align:center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.hack-mission-transfer-node {
width: 100%;
height: 90%;
-webkit-transform: skew(-20deg);
-moz-transform: skew(-20deg);
-o-transform: skew(-20deg);
}
.hack-mission-transfer-node p {
-webkit-transform: skew(20deg);
-moz-transform: skew(20deg);
-o-transform: skew(20deg);
color:white;
font-size:12px;
margin-top: 8px;
text-align:center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.hack-mission-spam-node,
.hack-mission-transfer-node,
.hack-mission-shield-node {
height:100%;
width: 100%;

399
dist/bundle.js vendored

File diff suppressed because one or more lines are too long

View File

@ -28,7 +28,7 @@ function initBitNodes() {
"people quickly succumbed to the innate human impulse of evil and savagery. The organized crime " +
"factions quickly rose to the top of the modern world.<br><br>" +
"In this BitNode:<br><br>The maximum amount of money available on a server is significantly decreased<br>" +
"The amount of money gained from crimes and Infiltration is doubled<br>" +
"The amount of money gained from crimes and Infiltration is tripled<br>" +
"Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, " +
"NiteSec, The Black Hand) give the player the ability to form and manage their own gangs. These gangs " +
"will earn the player money and reputation with the corresponding Faction<br>" +
@ -61,6 +61,7 @@ function initBitNodes() {
"The base security level of servers is doubled<br>" +
"The starting money on servers is halved, but the maximum money is doubled<br>" +
"Most methods of earning money now give significantly less<br>" +
"Infiltration gives 50% more reputation and money<br>" +
"Augmentations are more expensive<br>" +
"Hacking experience gain rates are reduced<br><br>" +
"Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will " +
@ -170,13 +171,15 @@ function initBitNodeMultipliers() {
break;
case 2: //Rise of the Underworld
BitNodeMultipliers.ServerMaxMoney = 0.2;
BitNodeMultipliers.CrimeMoney = 2;
BitNodeMultipliers.InfiltrationMoney = 2;
BitNodeMultipliers.ServerStartingMoney = 0.4;
BitNodeMultipliers.CrimeMoney = 3;
BitNodeMultipliers.InfiltrationMoney = 3;
BitNodeMultipliers.FactionWorkRepGain = 0.5;
BitNodeMultipliers.FactionPassiveRepGain = 0;
break;
case 4: //The Singularity
BitNodeMultipliers.ServerMaxMoney = 0.15;
BitNodeMultipliers.ServerStartingMoney = 0.75;
BitNodeMultipliers.ScriptHackMoney = 0.2;
BitNodeMultipliers.CompanyWorkMoney = 0.1;
BitNodeMultipliers.CrimeMoney = 0.2;
@ -192,9 +195,11 @@ function initBitNodeMultipliers() {
BitNodeMultipliers.ServerMaxMoney = 2;
BitNodeMultipliers.ServerStartingSecurity = 2;
BitNodeMultipliers.ServerStartingMoney = 0.5;
BitNodeMultipliers.ScriptHackMoney = 0.25;
BitNodeMultipliers.ScriptHackMoney = 0.2;
BitNodeMultipliers.HacknetNodeMoney = 0.2;
BitNodeMultipliers.CrimeMoney = 0.5;
BitNodeMultipliers.InfiltrationRep = 1.5;
BitNodeMultipliers.InfiltrationMoney = 1.5;
BitNodeMultipliers.AugmentationMoneyCost = 2;
BitNodeMultipliers.HackExpGain = 0.5;
break;

View File

@ -1046,12 +1046,19 @@ let CONSTANTS = {
"no longer have trouble saving the game when your save file gets too big (from running " +
"too many scripts). " +
"The game will still be saved to localStorage as well<br>" +
"-New file type: text files (.txt). You can read or write to text files using the read()/write() Netscript commands. " +
"You can view text files in Terminal using 'cat'. Eventually I will make it so you can edit them in the editor " +
"but that's not available yet. You can also download files to your real computer using the 'download' Terminal command<br>" +
"-Added a new Crime: Bond Forgery. This crime takes 5 minutes to attempt " +
"and gives $4,500,000 if successful. It is meant for mid game.<br>" +
"-Added commitCrime() and getStats() Singularity Functions.<br>" +
"-Removed getIntelligence() Netscript function<br>" +
"-Increased the amount of money gained from infiltration by 20%, and the amount of faction reputation by 12%<br>" +
"-Crime and Infiltration are now more lucrative in BitNodes 11 and 2<br>",
"-Added sprintf and vsprintf to Netscript. See <a href='https://github.com/alexei/sprintf.js' target='_blank'>this Github page for details</a><br>" +
"-Increased the amount of money gained from Infiltration by 20%, and the amount of faction reputation by 12%<br>" +
"-Rebalanced BitNode-2 so that Crime and Infiltration are more profitable but hacking is less profitable. Infiltration also gives more faction rep<br>" +
"-Rebalanced BitNode-4 so that hacking is slightly less profitable<br>" +
"-Rebalanced BitNode-5 so that Infiltration is more profitable and gives more faction rep<br>" +
"-Rebalanced BitNode-11 so that Crime and Infiltration are more profitable. Infiltration also gives more faction rep.<br>"
}
export {CONSTANTS};

View File

@ -696,12 +696,12 @@ HackingMission.prototype.createNodeDomElement = function(nodeObj) {
var txt;
switch (nodeObj.type) {
case NodeTypes.Core:
txt = "<p>CPU Core<br>" + "HP: " +
txt = "CPU Core<br>" + "HP: " +
formatNumber(nodeObj.hp, 1);
nodeDiv.classList.add("hack-mission-cpu-node");
break;
case NodeTypes.Firewall:
txt = "<p>Firewall<br>" + "HP: " +
txt = "Firewall<br>" + "HP: " +
formatNumber(nodeObj.hp, 1);
nodeDiv.classList.add("hack-mission-firewall-node");
break;
@ -711,7 +711,7 @@ HackingMission.prototype.createNodeDomElement = function(nodeObj) {
nodeDiv.classList.add("hack-mission-database-node");
break;
case NodeTypes.Spam:
txt = "<p>Spam<br>" + "HP: " +
txt = "Spam<br>" + "HP: " +
formatNumber(nodeObj.hp, 1);
nodeDiv.classList.add("hack-mission-spam-node");
break;
@ -722,14 +722,14 @@ HackingMission.prototype.createNodeDomElement = function(nodeObj) {
break;
case NodeTypes.Shield:
default:
txt = "<p>Shield<br>" + "HP: " +
txt = "<br>Shield<br>" + "HP: " +
formatNumber(nodeObj.hp, 1);
nodeDiv.classList.add("hack-mission-shield-node");
break;
}
txt += "<br>Atk: " + formatNumber(nodeObj.atk, 1) +
"<br>Def: " + formatNumber(nodeObj.def, 1) + "</p>";
"<br>Def: " + formatNumber(nodeObj.def, 1);
nodeDiv.innerHTML = txt;
}
@ -747,11 +747,11 @@ HackingMission.prototype.updateNodeDomElement = function(nodeObj) {
var txt;
switch (nodeObj.type) {
case NodeTypes.Core:
txt = "<p>CPU Core<br>" + "HP: " +
txt = "CPU Core<br>" + "HP: " +
formatNumber(nodeObj.hp, 1);
break;
case NodeTypes.Firewall:
txt = "<p>Firewall<br>" + "HP: " +
txt = "Firewall<br>" + "HP: " +
formatNumber(nodeObj.hp, 1);
break;
case NodeTypes.Database:
@ -759,7 +759,7 @@ HackingMission.prototype.updateNodeDomElement = function(nodeObj) {
formatNumber(nodeObj.hp, 1);
break;
case NodeTypes.Spam:
txt = "<p>Spam<br>" + "HP: " +
txt = "Spam<br>" + "HP: " +
formatNumber(nodeObj.hp, 1);
break;
case NodeTypes.Transfer:
@ -768,7 +768,7 @@ HackingMission.prototype.updateNodeDomElement = function(nodeObj) {
break;
case NodeTypes.Shield:
default:
txt = "<p>Shield<br>" + "HP: " +
txt = "<br>Shield<br>" + "HP: " +
formatNumber(nodeObj.hp, 1);
break;
}
@ -778,7 +778,7 @@ HackingMission.prototype.updateNodeDomElement = function(nodeObj) {
if (nodeObj.action) {
txt += "<br>" + nodeObj.action;
}
txt += "</p>";
//txt += "</p>";
nodeDiv.innerHTML = txt;
}

View File

@ -1,3 +1,6 @@
var sprintf = require('sprintf-js').sprintf,
vsprintf = require('sprintf-js').vsprintf
import {updateActiveScriptsItems} from "./ActiveScriptsUI.js";
import {Augmentations, Augmentation,
augmentationExists, installAugmentations,
@ -73,6 +76,8 @@ function NetscriptFunctions(workerScript) {
Math : Math,
Date : Date,
hacknetnodes : Player.hacknetNodes,
sprintf : sprintf,
vsprintf: vsprintf,
scan : function(ip=workerScript.serverIp, hostnames=true){
var server = getServer(ip);
if (server == null) {

View File

@ -402,6 +402,7 @@ function displayStockMarketContent() {
return;
}
//Create stock market content if you have an account
if (!stockMarketContentCreated && Player.hasWseAccount) {
console.log("Creating Stock Market UI");
document.getElementById("stock-market-commission").innerHTML =

View File

@ -44,7 +44,7 @@ function dialogBoxCreate(txt) {
closeButton.innerHTML = "&times;"
var textE = document.createElement("p");
textE.innerHTML = txt;
textE.innerHTML = txt.replace(/(?:\r\n|\r|\n)/g, '<br>');
content.appendChild(closeButton);
content.appendChild(textE);