mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-19 06:03:50 +01:00
commit
4d3ef5cace
148
css/loader.css
Normal file
148
css/loader.css
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
@-webkit-keyframes LOADERSPINNER {
|
||||||
|
0% { -webkit-transform: translate(-50%,-50%) rotate(0deg); }
|
||||||
|
100% { -webkit-transform: translate(-50%,-50%) rotate(360deg); }
|
||||||
|
}
|
||||||
|
@-moz-keyframes LOADERSPINNER {
|
||||||
|
0% { -moz-transform: translate(-50%,-50%) rotate(0deg); }
|
||||||
|
100% { -moz-transform: translate(-50%,-50%) rotate(360deg); }
|
||||||
|
}
|
||||||
|
@-ms-keyframes LOADERSPINNER {
|
||||||
|
0% { -ms-transform: translate(-50%,-50%) rotate(0deg); }
|
||||||
|
100% { -ms-transform: translate(-50%,-50%) rotate(360deg); }
|
||||||
|
}
|
||||||
|
@-o-keyframes LOADERSPINNER {
|
||||||
|
0% { -o-transform: translate(-50%,-50%) rotate(0deg); }
|
||||||
|
100% { -o-transform: translate(-50%,-50%) rotate(360deg); }
|
||||||
|
}
|
||||||
|
@keyframes LOADERSPINNER {
|
||||||
|
0% { transform: translate(-50%,-50%) rotate(0deg); }
|
||||||
|
100% { transform: translate(-50%,-50%) rotate(360deg); }
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes LOADERLABEL {
|
||||||
|
0% { opacity: 1.0; -webkit-transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
5% { opacity: 0.5; -webkit-transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
95% { opacity: 0.5; -webkit-transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
100% { opacity: 1.0; -webkit-transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
}
|
||||||
|
@-moz-keyframes LOADERLABEL {
|
||||||
|
0% { opacity: 1.0; -moz-transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
5% { opacity: 0.5; -moz-transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
95% { opacity: 0.5; -moz-transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
100% { opacity: 1.0; -moz-transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
}
|
||||||
|
@-ms-keyframes LOADERLABEL {
|
||||||
|
0% { opacity: 1.0; -ms-transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
5% { opacity: 0.5; -ms-transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
95% { opacity: 0.5; -ms-transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
100% { opacity: 1.0; -ms-transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
}
|
||||||
|
@-o-keyframes LOADERLABEL {
|
||||||
|
0% { opacity: 1.0; -o-transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
5% { opacity: 0.5; -o-transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
95% { opacity: 0.5; -o-transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
100% { opacity: 1.0; -o-transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
}
|
||||||
|
@keyframes LOADERLABEL {
|
||||||
|
0% { opacity: 1.0; transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
5% { opacity: 0.5; transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
95% { opacity: 0.5; transform: translate(-50%,-50%) scale(0.5); }
|
||||||
|
100% { opacity: 1.0; transform: translate(-50%,-50%) scale(1.0); }
|
||||||
|
}
|
||||||
|
|
||||||
|
*, *:before, *:after {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.loaderoverlay {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(255,255,255,1.0);
|
||||||
|
}
|
||||||
|
.loaderoverlay .loaderspinner,
|
||||||
|
.loaderoverlay .loaderspinner:before,
|
||||||
|
.loaderoverlay .loaderspinner:after {
|
||||||
|
border: 20px solid rgba(0,0,0,0);
|
||||||
|
border-top: 20px solid #ccc;
|
||||||
|
border-bottom: 20px solid #ccc;
|
||||||
|
border-radius: 1000px;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
.loaderoverlay .loaderspinner:before,
|
||||||
|
.loaderoverlay .loaderspinner:after {
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
.loaderoverlay .loaderspinner {
|
||||||
|
width: 200px;
|
||||||
|
height: 200px;
|
||||||
|
-webkit-animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
-moz-animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
-ms-animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
-o-animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
}
|
||||||
|
.loaderoverlay .loaderspinner:before {
|
||||||
|
width: 160px;
|
||||||
|
height: 160px;
|
||||||
|
-webkit-animation: LOADERSPINNER 10s linear infinite;
|
||||||
|
-moz-animation: LOADERSPINNER 10s linear infinite;
|
||||||
|
-ms-animation: LOADERSPINNER 10s linear infinite;
|
||||||
|
-o-animation: LOADERSPINNER 10s linear infinite;
|
||||||
|
animation: LOADERSPINNER 10s linear infinite;
|
||||||
|
}
|
||||||
|
.loaderoverlay .loaderspinner:after {
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
-webkit-animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
-moz-animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
-ms-animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
-o-animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
animation: LOADERSPINNER 5s linear infinite;
|
||||||
|
}
|
||||||
|
.loaderoverlay .loaderlabel {
|
||||||
|
color: #66ff33;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
-webkit-animation: LOADERLABEL 5s linear infinite;
|
||||||
|
-moz-animation: LOADERLABEL 5s linear infinite;
|
||||||
|
-ms-animation: LOADERLABEL 5s linear infinite;
|
||||||
|
-o-animation: LOADERLABEL 5s linear infinite;
|
||||||
|
animation: LOADERLABEL 5s linear infinite;
|
||||||
|
}
|
||||||
|
button[type="button"] {
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
bottom: 10px;
|
||||||
|
left: 50%;
|
||||||
|
-webkit-transform: translateX(-50%);
|
||||||
|
-moz-transform: translateX(-50%);
|
||||||
|
-ms-transform: translateX(-50%);
|
||||||
|
-o-transform: translateX(-50%);
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Customize */
|
||||||
|
.loaderoverlay {
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
.loaderoverlay .loaderspinner,
|
||||||
|
.loaderoverlay .loaderspinner:before,
|
||||||
|
.loaderoverlay .loaderspinner:after {
|
||||||
|
border-top-color: #66ff33!important;
|
||||||
|
border-bottom-color:#66ff33 !important;
|
||||||
|
}
|
||||||
|
.loaderoverlay .loaderlabel {
|
||||||
|
color: #66ff33;
|
||||||
|
}
|
@ -345,28 +345,6 @@
|
|||||||
width: 70%;
|
width: 70%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.create-program-a-link-button {
|
|
||||||
text-decoration: none;
|
|
||||||
background-color: #555;
|
|
||||||
color: #FFFFFF;
|
|
||||||
padding: 4px;
|
|
||||||
border: 1px solid #333333;
|
|
||||||
/*width: 30%;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-program-a-link-button-inactive {
|
|
||||||
text-decoration: none;
|
|
||||||
background-color: #555;
|
|
||||||
color: #FFFFFF;
|
|
||||||
padding: 4px 4px 4px 4px;
|
|
||||||
border-top: 1px solid #333333;
|
|
||||||
border-right: 1px solid #333333;
|
|
||||||
border-bottom: 1px solid #333333;
|
|
||||||
border-left: 1px solid #333333;
|
|
||||||
pointer-events: none;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Factions and Faction (Single Faction page) */
|
/* Factions and Faction (Single Faction page) */
|
||||||
#factions-container {
|
#factions-container {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
background-color: var(--my-background-color);
|
background-color: var(--my-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p, pre, h2 {
|
||||||
color: var(--my-font-color);
|
color: var(--my-font-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,10 +27,6 @@ h1 {
|
|||||||
color: var(--my-font-color);
|
color: var(--my-font-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
|
||||||
color: var(--my-font-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
@ -54,7 +50,7 @@ tr:focus {
|
|||||||
outline:none;
|
outline:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Main menu */
|
/* Main navigation menu */
|
||||||
.mainmenu {
|
.mainmenu {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -70,27 +66,60 @@ tr:focus {
|
|||||||
background-color: #333;
|
background-color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Default buttons */
|
||||||
.mainmenu>li a {
|
.mainmenu>li a {
|
||||||
display: block;
|
display: block;
|
||||||
color: #e6e6e6;
|
color: #e6e6e6;
|
||||||
background-color: #333;
|
background-color: #555;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mainmenu>li a:hover:not(.active) {
|
/* Hovering makes them lighter */
|
||||||
background-color: #555;
|
.mainmenu>li a:hover,
|
||||||
color: white;
|
.mainmenu>li a:hover:not(.active),
|
||||||
}
|
|
||||||
|
|
||||||
.mainmenu>li a:focus {
|
.mainmenu>li a:focus {
|
||||||
background-color: #555;
|
background-color: #777;
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Panel headers can become active, and they are "lighter" than the rest */
|
||||||
.mainmenu>li a.active {
|
.mainmenu>li a.active {
|
||||||
background-color: #555;
|
background-color: #777;
|
||||||
color: white;
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mainmenu>li a.active:hover {
|
||||||
|
background-color:#aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Plus and minus signs */
|
||||||
|
.mainmenu-accordion-header:after {
|
||||||
|
content: '\02795';
|
||||||
|
font-size: 13px;
|
||||||
|
color: white;
|
||||||
|
float: right;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mainmenu-accordion-header.opened:after {
|
||||||
|
content: "\2796";
|
||||||
|
}
|
||||||
|
|
||||||
|
.mainmenu-accordion-header.opened {
|
||||||
|
background-color:#222;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Slide down transition */
|
||||||
|
.mainmenu-accordion-panel {
|
||||||
|
max-height: 0;
|
||||||
|
opacity: 1;
|
||||||
|
transition: max-height 0.2s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Borders */
|
||||||
|
.mainmenu-accordion-header {
|
||||||
|
border:2px solid white;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make html links ("a" elements) nice looking buttons with this class */
|
/* Make html links ("a" elements) nice looking buttons with this class */
|
||||||
@ -130,7 +159,7 @@ a:link, a:visited {
|
|||||||
|
|
||||||
|
|
||||||
/* Notification icon (for create program right now only) */
|
/* Notification icon (for create program right now only) */
|
||||||
.create-program-tab {
|
#create-program-tab {
|
||||||
position:relative;
|
position:relative;
|
||||||
}
|
}
|
||||||
#create-program-notification {
|
#create-program-notification {
|
||||||
@ -321,6 +350,7 @@ a:link, a:visited {
|
|||||||
-moz-box-shadow: 1px 1px 3px #000;
|
-moz-box-shadow: 1px 1px 3px #000;
|
||||||
-webkit-box-shadow: 1px 1px 3px #000;
|
-webkit-box-shadow: 1px 1px 3px #000;
|
||||||
box-shadow: 1px 1px 3px #000;
|
box-shadow: 1px 1px 3px #000;
|
||||||
|
height: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#character-overview-save-button:hover,
|
#character-overview-save-button:hover,
|
||||||
@ -333,7 +363,7 @@ a:link, a:visited {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#character-overview-options-button {
|
#character-overview-options-button {
|
||||||
display: inline-block;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scan analyze links from AutoLink */
|
/* Scan analyze links from AutoLink */
|
||||||
|
@ -11,11 +11,12 @@
|
|||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
height: auto;
|
height: auto;
|
||||||
width: 100%;
|
width: 70%;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
background-color: var(--my-background-color);
|
background-color: var(--my-background-color);
|
||||||
|
table-layout:fixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -41,5 +42,10 @@
|
|||||||
color: var(--my-font-color);
|
color: var(--my-font-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.terminal-line {
|
||||||
|
width: 70%;
|
||||||
|
word-wrap: break-word;
|
||||||
|
hyphens:auto;
|
||||||
|
-webkit-hyphens: auto;
|
||||||
|
-moz-hyphens: auto;
|
||||||
|
}
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
|
/* Both Work in progress and BitNode stuff */
|
||||||
#generic-fullscreen-container {
|
#generic-fullscreen-container {
|
||||||
color: var(--my-font-color);
|
color: var(--my-font-color);
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
margin: 10px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 99%;
|
width: 99%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#work-in-progress-container {
|
#work-in-progress-container {
|
||||||
color: var(--my-font-color);
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
padding-top: 10px;
|
|
||||||
padding-left: 10px;
|
|
||||||
height: 100%;
|
|
||||||
width: 99%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#work-in-progress-text {
|
#work-in-progress-text {
|
||||||
color: var(--my-font-color);
|
color: var(--my-font-color);
|
||||||
width: 70%;
|
width: 70%;
|
||||||
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#work-in-progress-cancel-button {
|
#work-in-progress-cancel-button {
|
||||||
@ -42,3 +40,18 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#red-pill-container {
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bitnode {
|
||||||
|
color:blue;
|
||||||
|
}
|
||||||
|
.bitnode-destroyed {
|
||||||
|
color:red;
|
||||||
|
}
|
||||||
|
.bitnode:hover,
|
||||||
|
.bitnode-destroyed:hover {
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
105
index.html
105
index.html
@ -9,6 +9,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="css/workinprogress.css" />
|
<link rel="stylesheet" type="text/css" href="css/workinprogress.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="css/popupboxes.css" />
|
<link rel="stylesheet" type="text/css" href="css/popupboxes.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="css/interactivetutorial.css" />
|
<link rel="stylesheet" type="text/css" href="css/interactivetutorial.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/loader.css" />
|
||||||
|
|
||||||
<!--jQuery library-->
|
<!--jQuery library-->
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||||
@ -37,6 +38,7 @@
|
|||||||
|
|
||||||
<!-- Main game files -->
|
<!-- Main game files -->
|
||||||
<script src="src/Constants.js"></script>
|
<script src="src/Constants.js"></script>
|
||||||
|
<script src="src/HelpText.js"></script>
|
||||||
<script src="src/SpecialServerIps.js"></script>
|
<script src="src/SpecialServerIps.js"></script>
|
||||||
<script src="src/Location.js"></script>
|
<script src="src/Location.js"></script>
|
||||||
<script src="src/Script.js"></script>
|
<script src="src/Script.js"></script>
|
||||||
@ -62,6 +64,8 @@
|
|||||||
<script src="src/ActiveScriptsUI.js"></script>
|
<script src="src/ActiveScriptsUI.js"></script>
|
||||||
<script src="src/Infiltration.js"></script>
|
<script src="src/Infiltration.js"></script>
|
||||||
<script src="src/StockMarket.js"></script>
|
<script src="src/StockMarket.js"></script>
|
||||||
|
<script src="src/RedPill.js"></script>
|
||||||
|
<script src="src/BitNode.js"></script>
|
||||||
|
|
||||||
<script src="src/engine.js"></script>
|
<script src="src/engine.js"></script>
|
||||||
|
|
||||||
@ -78,42 +82,66 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="entire-game-container" style="visibility:hidden;">
|
||||||
<div id="mainmenu-container">
|
<div id="mainmenu-container">
|
||||||
<!-- Main menu -->
|
<!-- Main menu -->
|
||||||
<ul class="mainmenu">
|
<ul class="mainmenu">
|
||||||
<li class="terminal-tab">
|
<!-- Hacking dropdown -->
|
||||||
|
<li id="hacking-menu-header-li">
|
||||||
|
<a id="hacking-menu-header" class="mainmenu-accordion-header"> Hacking </a>
|
||||||
|
</li>
|
||||||
|
<li id="terminal-tab" class="mainmenu-accordion-panel">
|
||||||
<a id="terminal-menu-link"> Terminal </a>
|
<a id="terminal-menu-link"> Terminal </a>
|
||||||
</li>
|
</li>
|
||||||
<li class="character-tab">
|
<li id="create-script-tab" class="mainmenu-accordion-panel">
|
||||||
<a id="character-menu-link"> Character </a>
|
|
||||||
</li>
|
|
||||||
<!-- These scripts stuff should be hidden until level 2, but leave them visible for now to test -->
|
|
||||||
<li class="create-script-tab">
|
|
||||||
<a id="create-script-menu-link"> Create Script </a>
|
<a id="create-script-menu-link"> Create Script </a>
|
||||||
</li>
|
</li>
|
||||||
<li class="active-scripts-tab">
|
<li id="active-scripts-tab" class="mainmenu-accordion-panel">
|
||||||
<a id="active-scripts-menu-link"> Active Scripts </a>
|
<a id="active-scripts-menu-link"> Active Scripts </a>
|
||||||
</li>
|
</li>
|
||||||
<li class="hacknet-nodes-tab">
|
<li id="create-program-tab" class="mainmenu-accordion-panel">
|
||||||
<a id="hacknet-nodes-menu-link"> Hacknet Nodes </a>
|
|
||||||
</li>
|
|
||||||
<li class="world-tab">
|
|
||||||
<a id="world-menu-link"> World </a>
|
|
||||||
</li>
|
|
||||||
<li class="create-program-tab">
|
|
||||||
<a id="create-program-menu-link"> Create Program </a>
|
<a id="create-program-menu-link"> Create Program </a>
|
||||||
<span id="create-program-notification" class="notification-off"> </span>
|
<span id="create-program-notification" class="notification-off"> </span>
|
||||||
</li>
|
</li>
|
||||||
<li class="factions-tab">
|
|
||||||
|
<!-- Character dropdown -->
|
||||||
|
<li id="character-menu-header-li">
|
||||||
|
<a id="character-menu-header" class="mainmenu-accordion-header"> Character </a>
|
||||||
|
</li>
|
||||||
|
<li id="stats-tab" class="mainmenu-accordion-panel">
|
||||||
|
<a id="stats-menu-link"> Stats </a>
|
||||||
|
</li>
|
||||||
|
<li id="factions-tab" class="mainmenu-accordion-panel">
|
||||||
<a id="factions-menu-link"> Factions </a>
|
<a id="factions-menu-link"> Factions </a>
|
||||||
</li>
|
</li>
|
||||||
<li class="augmentations-tab">
|
<li id="augmentations-tab" class="mainmenu-accordion-panel">
|
||||||
<a id="augmentations-menu-link" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> Augmentations </a>
|
<a id="augmentations-menu-link" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> Augmentations </a>
|
||||||
</li>
|
</li>
|
||||||
<li class="tutorial-tab">
|
<li id="hacknet-nodes-tab" class="mainmenu-accordion-panel">
|
||||||
|
<a id="hacknet-nodes-menu-link"> Hacknet Nodes </a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<!-- World dropdown -->
|
||||||
|
<li id="world-menu-header-li">
|
||||||
|
<a id="world-menu-header" class="mainmenu-accordion-header">World</a>
|
||||||
|
</li>
|
||||||
|
<li id="city-tab" class="mainmenu-accordion-panel">
|
||||||
|
<a id="city-menu-link"> City </a>
|
||||||
|
</li>
|
||||||
|
<li id="travel-tab" class="mainmenu-accordion-panel">
|
||||||
|
<a id="travel-menu-link">Travel</a>
|
||||||
|
</li>
|
||||||
|
<li id="job-tab" class="mainmenu-accordion-panel">
|
||||||
|
<a id="job-menu-link">Job</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="help-menu-header-li">
|
||||||
|
<a id="help-menu-header" class="mainmenu-accordion-header">Help</a>
|
||||||
|
</li>
|
||||||
|
<li id="tutorial-tab" class="mainmenu-accordion-panel">
|
||||||
<a id="tutorial-menu-link"> Tutorial </a>
|
<a id="tutorial-menu-link"> Tutorial </a>
|
||||||
</li>
|
</li>
|
||||||
<li class="options-tab">
|
<li id="options-tab" class="mainmenu-accordion-panel">
|
||||||
<a id="options-menu-link"> Options </a>
|
<a id="options-menu-link"> Options </a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -149,7 +177,7 @@
|
|||||||
<div id="script-editor-buttons-wrapper">
|
<div id="script-editor-buttons-wrapper">
|
||||||
<span id="script-editor-save-and-close-button" class="a-link-button">Save & Close (Ctrl + b)</span>
|
<span id="script-editor-save-and-close-button" class="a-link-button">Save & Close (Ctrl + b)</span>
|
||||||
<p id="script-editor-status-text"> </p>
|
<p id="script-editor-status-text"> </p>
|
||||||
<span id="script-editor-netscript-doc-button" class="a-link-button"> Netscript Documentation </span>
|
<a id="script-editor-netscript-doc-button" class="a-link-button" href="https://bitburner.wikia.com/wiki/Netscript" target="_blank"> Netscript Documentation </a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p> <br><br> </p>
|
<p> <br><br> </p>
|
||||||
@ -425,43 +453,43 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul id="create-program-list">
|
<ul id="create-program-list">
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-nuke">
|
<a class="a-link-button tooltip" id="create-program-nuke">
|
||||||
NUKE.exe
|
NUKE.exe
|
||||||
<span class="tooltiptext"> This virus is used to gain root access to a machine if enough ports are opened. </span>
|
<span class="tooltiptext"> This virus is used to gain root access to a machine if enough ports are opened. </span>
|
||||||
</a>
|
</a>
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-brutessh">
|
<a class="a-link-button tooltip" id="create-program-brutessh">
|
||||||
BruteSSH.exe
|
BruteSSH.exe
|
||||||
<span class="tooltiptext"> This program executes a brute force attack that opens SSH ports </span>
|
<span class="tooltiptext"> This program executes a brute force attack that opens SSH ports </span>
|
||||||
</a>
|
</a>
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-ftpcrack">
|
<a class="a-link-button tooltip" id="create-program-ftpcrack">
|
||||||
FTPCrack.exe
|
FTPCrack.exe
|
||||||
<span class="tooltiptext"> This program cracks open FTP ports</span>
|
<span class="tooltiptext"> This program cracks open FTP ports</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-relaysmtp">
|
<a class="a-link-button tooltip" id="create-program-relaysmtp">
|
||||||
relaySMTP.exe
|
relaySMTP.exe
|
||||||
<span class="tooltiptext"> This program opens SMTP ports by redirecting data </span>
|
<span class="tooltiptext"> This program opens SMTP ports by redirecting data </span>
|
||||||
</a>
|
</a>
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-httpworm">
|
<a class="a-link-button tooltip" id="create-program-httpworm">
|
||||||
HTTPWorm.exe
|
HTTPWorm.exe
|
||||||
<span class="tooltiptext"> This virus opens up HTTP ports </span>
|
<span class="tooltiptext"> This virus opens up HTTP ports </span>
|
||||||
</a>
|
</a>
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-sqlinject">
|
<a class="a-link-button tooltip" id="create-program-sqlinject">
|
||||||
SQLInject.exe
|
SQLInject.exe
|
||||||
<span class="tooltiptext"> This virus opens SQL ports</span>
|
<span class="tooltiptext"> This virus opens SQL ports</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-deepscanv1">
|
<a class="a-link-button tooltip" id="create-program-deepscanv1">
|
||||||
DeepscanV1.exe
|
DeepscanV1.exe
|
||||||
<span class="tooltiptext"> This program allows you to use the scan-analyze command with a depth up to 5</span>
|
<span class="tooltiptext"> This program allows you to use the scan-analyze command with a depth up to 5</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-deepscanv2">
|
<a class="a-link-button tooltip" id="create-program-deepscanv2">
|
||||||
DeepscanV2.exe
|
DeepscanV2.exe
|
||||||
<span class="tooltiptext"> This program allows you to use the scan-analyze command with a depth up to 10</span>
|
<span class="tooltiptext"> This program allows you to use the scan-analyze command with a depth up to 10</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-serverprofiler">
|
<a class="a-link-button tooltip" id="create-program-serverprofiler">
|
||||||
ServerProfiler.exe
|
ServerProfiler.exe
|
||||||
<span class="tooltiptext">This program is used to display hacking and Netscript-related information about servers</span>
|
<span class="tooltiptext">This program is used to display hacking and Netscript-related information about servers</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="create-program-a-link-button tooltip" id="create-program-autolink">
|
<a class="a-link-button tooltip" id="create-program-autolink">
|
||||||
AutoLink.exe
|
AutoLink.exe
|
||||||
<span class="tooltiptext">This program allows you to directly connect to other servers through the 'scan-analyze' command</span>
|
<span class="tooltiptext">This program allows you to directly connect to other servers through the 'scan-analyze' command</span>
|
||||||
</a>
|
</a>
|
||||||
@ -478,7 +506,7 @@
|
|||||||
<!-- Single Faction info (when you select a faction from the Factions menu) -->
|
<!-- Single Faction info (when you select a faction from the Factions menu) -->
|
||||||
<div id="faction-container" class="generic-menupage-container">
|
<div id="faction-container" class="generic-menupage-container">
|
||||||
<h1 id="faction-name"></h1>
|
<h1 id="faction-name"></h1>
|
||||||
<p id="faction-info"></p>
|
<pre id="faction-info"></pre>
|
||||||
<p> --------------- </p>
|
<p> --------------- </p>
|
||||||
<p id="faction-reputation" class="tooltip"></p>
|
<p id="faction-reputation" class="tooltip"></p>
|
||||||
<p> --------------- </p>
|
<p> --------------- </p>
|
||||||
@ -828,12 +856,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Work in progress screen -->
|
<!-- Work in progress screen -->
|
||||||
<div id="work-in-progress-container">
|
<div id="work-in-progress-container" class="generic-fullscreen-container">
|
||||||
<p id="work-in-progress-text"> </p>
|
<p id="work-in-progress-text"> </p>
|
||||||
|
|
||||||
<span id="work-in-progress-cancel-button"> Cancel Work </span>
|
<span id="work-in-progress-cancel-button"> Cancel Work </span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Red Pill Container -->
|
||||||
<div id="red-pill-container" class="generic-fullscreen-container">
|
<div id="red-pill-container" class="generic-fullscreen-container">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -858,7 +887,7 @@
|
|||||||
|
|
||||||
<!-- Status text -->
|
<!-- Status text -->
|
||||||
<div id="status-text-container">
|
<div id="status-text-container">
|
||||||
<p id="status-text">Test </p>
|
<p id="status-text"> </p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Game Options -->
|
<!-- Game Options -->
|
||||||
@ -867,12 +896,14 @@
|
|||||||
<span id="game-options-close-button">×</span>
|
<span id="game-options-close-button">×</span>
|
||||||
<h1> Game Options </h1>
|
<h1> Game Options </h1>
|
||||||
<br>
|
<br>
|
||||||
<a id="changelog-link" class="a-link-button" style="display:block;"> Changelog </a>
|
<a class="a-link-button" style="display:block;" href="https://bitburner.wikia.com/wiki/Changelog" target="_blank"> Changelog </a>
|
||||||
|
<a class="a-link-button" style="display:block;" href="https://bitburner.wikia.com" target="_blank">Wiki</a>
|
||||||
<a id="save-game-link" class="a-link-button" style="display:block;"> Save Game </a>
|
<a id="save-game-link" class="a-link-button" style="display:block;"> Save Game </a>
|
||||||
<a id="export-game-link" class="a-link-button" style="display:block;"> (BETA) Export Game </a>
|
<a id="export-game-link" class="a-link-button" style="display:block;"> (BETA) Export Game </a>
|
||||||
<input type="file" id="import-game-file-selector" name="file"/>
|
<input type="file" id="import-game-file-selector" name="file"/>
|
||||||
<a id="import-game-link" class="a-link-button" style="display:block;" onclick="saveObject.importGame();"> (BETA) Import Game </a>
|
<a id="import-game-link" class="a-link-button" style="display:block;" onclick="saveObject.importGame();"> (BETA) Import Game </a>
|
||||||
<a id="delete-game-link" class="a-link-button" style="display:block;"> Delete Game </a>
|
<a id="delete-game-link" class="a-link-button" style="display:block;"> Delete Game </a>
|
||||||
|
<a class="a-link-button" style="display:block;" href="https://bitburner.wikia.com/wiki/Shortcuts" target="_blank"> Keyboard Shortcuts </a>
|
||||||
<a id="debug-delete-scripts-link" class="a-link-button tooltip" style="display:block;">
|
<a id="debug-delete-scripts-link" class="a-link-button tooltip" style="display:block;">
|
||||||
(DEBUG) Delete Active Scripts
|
(DEBUG) Delete Active Scripts
|
||||||
<span class="tooltiptext">
|
<span class="tooltiptext">
|
||||||
@ -888,6 +919,12 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Loader (Loading screen) -->
|
||||||
|
<div id="loader" class="loaderoverlay">
|
||||||
|
<div class="loaderspinner"></div>
|
||||||
|
<div class="loaderlabel">Loading Bitburner...</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
23
src/BitNode.js
Normal file
23
src/BitNode.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/* BitNode.js */
|
||||||
|
|
||||||
|
BitNodes = {
|
||||||
|
BitNode1: new BitNode(1, "Source Genesis", "The original BitNode"),
|
||||||
|
BitNode2: new BitNode(2, "Rise of the Underworld", "COMING SOON"), //Gangs
|
||||||
|
BitNode3: new BitNode(3, "The Price of Civilization", "COMING SOON"), //Corporate Warfare, Run own company
|
||||||
|
BitNode4: new BitNode(4, "The Singularity", "COMING SOON"), //Everything automatable
|
||||||
|
BitNode5: new BitNode(5, "2084", "COMING SOON"), //Big Brother
|
||||||
|
BitNode6: new BitNode(6, "Hacktocracy", "COMING SOON"), //Healthy Hacknet balancing mechanic
|
||||||
|
BitNode7: new BitNode(7, "Do Androids Dream?", "COMING SOON"), //Build androids for automation
|
||||||
|
BitNode8: new BitNode(8, "Ghost of Wall Street", "COMING SOON"), //Trading only viable strategy
|
||||||
|
BitNode9: new BitNode(9, "MegaCorp", "COMING SOON"), //Single corp/server with increasing difficulty
|
||||||
|
BitNode10: new BitNode(10, "Wasteland", "COMING SOON"), //Postapocalyptic
|
||||||
|
BitNode11: new BitNode(11, "The Big Crash", "COMING SOON"), //Crashing economy
|
||||||
|
BitNode12: new BitNode(12, "Eye of the World", "COMING SOON"), //Become AI
|
||||||
|
}
|
||||||
|
|
||||||
|
function BitNode(n, name, desc="", info="") {
|
||||||
|
this.number = n;
|
||||||
|
this.name = name;
|
||||||
|
this.desc = desc;
|
||||||
|
this.info = info;
|
||||||
|
}
|
@ -79,7 +79,7 @@ PlayerObject.prototype.applyForJob = function(entryPosType) {
|
|||||||
if (leaveCompany) {
|
if (leaveCompany) {
|
||||||
dialogBoxCreate("Congratulations! You were offered a new job at " + this.companyName + " as a " +
|
dialogBoxCreate("Congratulations! You were offered a new job at " + this.companyName + " as a " +
|
||||||
pos.positionName + "!<br>" +
|
pos.positionName + "!<br>" +
|
||||||
"You lost 1000 reputatation at your old company " + oldCompanyName + " because you left.");
|
"You lost 1000 reputation at your old company " + oldCompanyName + " because you left.");
|
||||||
} else {
|
} else {
|
||||||
dialogBoxCreate("Congratulations! You were offered a new job at " + this.companyName + " as a " + pos.positionName + "!");
|
dialogBoxCreate("Congratulations! You were offered a new job at " + this.companyName + " as a " + pos.positionName + "!");
|
||||||
}
|
}
|
||||||
|
373
src/Constants.js
373
src/Constants.js
@ -1,5 +1,5 @@
|
|||||||
CONSTANTS = {
|
CONSTANTS = {
|
||||||
Version: "0.25.0",
|
Version: "0.26.0",
|
||||||
|
|
||||||
//Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
|
//Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
|
||||||
//and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
|
//and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
|
||||||
@ -10,7 +10,7 @@ CONSTANTS = {
|
|||||||
CorpFactionRepRequirement: 250000,
|
CorpFactionRepRequirement: 250000,
|
||||||
|
|
||||||
/* Base costs */
|
/* Base costs */
|
||||||
BaseCostFor1GBOfRamHome: 32000,
|
BaseCostFor1GBOfRamHome: 30000,
|
||||||
BaseCostFor1GBOfRamServer: 60000, //1 GB of RAM
|
BaseCostFor1GBOfRamServer: 60000, //1 GB of RAM
|
||||||
BaseCostFor1GBOfRamHacknetNode: 30000,
|
BaseCostFor1GBOfRamHacknetNode: 30000,
|
||||||
|
|
||||||
@ -40,6 +40,7 @@ CONSTANTS = {
|
|||||||
//Time (ms) it takes to run one operation in Netscript.
|
//Time (ms) it takes to run one operation in Netscript.
|
||||||
CodeInstructionRunTime: 100,
|
CodeInstructionRunTime: 100,
|
||||||
|
|
||||||
|
|
||||||
//RAM Costs for different commands
|
//RAM Costs for different commands
|
||||||
ScriptWhileRamCost: 0.2,
|
ScriptWhileRamCost: 0.2,
|
||||||
ScriptForRamCost: 0.2,
|
ScriptForRamCost: 0.2,
|
||||||
@ -75,22 +76,23 @@ CONSTANTS = {
|
|||||||
ScriptBuySellStockRamCost: 2.5,
|
ScriptBuySellStockRamCost: 2.5,
|
||||||
ScriptPurchaseServerRamCost: 2.0,
|
ScriptPurchaseServerRamCost: 2.0,
|
||||||
ScriptRoundRamCost: 0.05,
|
ScriptRoundRamCost: 0.05,
|
||||||
|
ScriptReadWriteRamCost: 1.0,
|
||||||
|
|
||||||
MultithreadingRAMCost: 1,
|
MultithreadingRAMCost: 1,
|
||||||
|
|
||||||
//Server constants
|
//Server constants
|
||||||
ServerBaseGrowthRate: 1.03, //Unadjusted Growth rate
|
ServerBaseGrowthRate: 1.025, //Unadjusted Growth rate
|
||||||
ServerMaxGrowthRate: 1.0045, //Maximum possible growth rate (max rate accounting for server security)
|
ServerMaxGrowthRate: 1.0035, //Maximum possible growth rate (max rate accounting for server security)
|
||||||
ServerFortifyAmount: 0.002, //Amount by which server's security increases when its hacked/grown
|
ServerFortifyAmount: 0.002, //Amount by which server's security increases when its hacked/grown
|
||||||
ServerWeakenAmount: 0.1, //Amount by which server's security decreases when weakened
|
ServerWeakenAmount: 0.05, //Amount by which server's security decreases when weakened
|
||||||
|
|
||||||
//Augmentation Constants
|
//Augmentation Constants
|
||||||
AugmentationCostMultiplier: 5, //Used for balancing costs without having to readjust every Augmentation cost
|
AugmentationCostMultiplier: 5, //Used for balancing costs without having to readjust every Augmentation cost
|
||||||
AugmentationRepMultiplier: 2.5, //Used for balancing rep cost without having to readjust every value
|
AugmentationRepMultiplier: 2.5, //Used for balancing rep cost without having to readjust every value
|
||||||
MultipleAugMultiplier: 1.9,
|
MultipleAugMultiplier: 1.9,
|
||||||
|
|
||||||
//Maximum number of log entries for a script
|
MaxLogCapacity: 50, //Maximum number of log entries for a script
|
||||||
MaxLogCapacity: 50,
|
MaxPortCapacity: 50, //Maximum amount of data in a Netscript port
|
||||||
|
|
||||||
//How much a TOR router costs
|
//How much a TOR router costs
|
||||||
TorRouterCost: 200000,
|
TorRouterCost: 200000,
|
||||||
@ -105,7 +107,7 @@ CONSTANTS = {
|
|||||||
StockMarketCommission: 100000,
|
StockMarketCommission: 100000,
|
||||||
|
|
||||||
//Hospital/Health
|
//Hospital/Health
|
||||||
HospitalCostPerHp: 75000,
|
HospitalCostPerHp: 100000,
|
||||||
|
|
||||||
MillisecondsPer20Hours: 72000000,
|
MillisecondsPer20Hours: 72000000,
|
||||||
GameCyclesPer20Hours: 72000000 / 200,
|
GameCyclesPer20Hours: 72000000 / 200,
|
||||||
@ -173,37 +175,6 @@ CONSTANTS = {
|
|||||||
CrimeAssassination: "assassinate a high-profile target",
|
CrimeAssassination: "assassinate a high-profile target",
|
||||||
CrimeHeist: "pull off the ultimate heist",
|
CrimeHeist: "pull off the ultimate heist",
|
||||||
|
|
||||||
//Text that is displayed when the 'help' command is ran in Terminal
|
|
||||||
HelpText: 'alias [-g] [name="value"] Create aliases for Terminal commands, or list existing aliases<br>' +
|
|
||||||
"analyze Get statistics and information about current machine <br>" +
|
|
||||||
"cat [message] Display a .msg file<br>" +
|
|
||||||
"check [script] [args...] Print logs to Terminal for the script with the specified name and arguments<br>" +
|
|
||||||
"clear Clear all text on the terminal <br>" +
|
|
||||||
"cls See 'clear' command <br>" +
|
|
||||||
"connect [ip/hostname] Connects to the machine given by its IP or hostname <br>" +
|
|
||||||
"free Check the machine's memory (RAM) usage<br>" +
|
|
||||||
"hack Hack the current machine<br>" +
|
|
||||||
"help Display this help text<br>" +
|
|
||||||
"home Connect to home computer<br>" +
|
|
||||||
"hostname Displays the hostname of the machine<br>" +
|
|
||||||
"ifconfig Displays the IP address of the machine<br>" +
|
|
||||||
"kill [script] [args...] Stops a script on the current server with the specified name and arguments<br>" +
|
|
||||||
"killall Stops all running scripts on the current machine<br>" +
|
|
||||||
"ls Displays all programs and scripts on the machine<br>" +
|
|
||||||
"mem [script] [-t] [n] Displays the amount of RAM the script requires to run with n threads<br>" +
|
|
||||||
"nano [script] Text editor - Open up and edit a script<br>" +
|
|
||||||
"ps Display all scripts that are currently running<br>" +
|
|
||||||
"rm Delete a script/program from the machine. (WARNING: Permanent)<br>" +
|
|
||||||
"run [name] [-t] [n] [args...] Execute a program or a script with n threads and the specified arguments<br>" +
|
|
||||||
"scan Displays all available network connections<br>" +
|
|
||||||
"scan-analyze [depth] Displays hacking-related information for all servers up to <i>depth</i> nodes away<br>" +
|
|
||||||
"scp [script] [server] Copies a script to a destination server (specified by ip or hostname)<br>" +
|
|
||||||
"sudov Shows whether or not you have root access on this computer<br>" +
|
|
||||||
"tail [script] [args...] Display dynamic logs for the script with the specified name and arguments<br>" +
|
|
||||||
"theme [preset] | bg txt hlgt Change the color scheme of the UI<br>" +
|
|
||||||
"top Display all running scripts and their RAM usage<br>" +
|
|
||||||
'unalias "[alias name]" Deletes the specified alias. Double quotation marks are required<br>',
|
|
||||||
|
|
||||||
/* Tutorial related things */
|
/* Tutorial related things */
|
||||||
TutorialGettingStartedText: "Todo...",
|
TutorialGettingStartedText: "Todo...",
|
||||||
|
|
||||||
@ -384,7 +355,10 @@ CONSTANTS = {
|
|||||||
"a server will raise that server's security level by 0.002. Returns true if the hack is successful and " +
|
"a server will raise that server's security level by 0.002. Returns true if the hack is successful and " +
|
||||||
"false otherwise. <br>" +
|
"false otherwise. <br>" +
|
||||||
"Examples: hack('foodnstuff'); or hack('148.192.0.12');<br><br>" +
|
"Examples: hack('foodnstuff'); or hack('148.192.0.12');<br><br>" +
|
||||||
"<i>sleep(n)</i><br>Suspends the script for n milliseconds. <br>Example: sleep(5000);<br><br>" +
|
"<i>sleep(n, log=true)</i><br>Suspends the script for n milliseconds. The second argument is an optional boolean that indicates " +
|
||||||
|
"whether or not the function should log the sleep action. If this argument is true, then calling this function will write " +
|
||||||
|
"'Sleeping for N milliseconds' to the script's logs. If it's false, then this function will not log anything. " +
|
||||||
|
"If this argument is not specified then it will be true by default. <br>Example: sleep(5000);<br><br>" +
|
||||||
"<i>grow(hostname/ip)</i><br>Use your hacking skills to increase the amount of money available on a server. The argument passed in " +
|
"<i>grow(hostname/ip)</i><br>Use your hacking skills to increase the amount of money available on a server. The argument passed in " +
|
||||||
"must be a string with either the IP or hostname of the target server. The runtime for this command depends on your hacking level and the target server's security level. " +
|
"must be a string with either the IP or hostname of the target server. The runtime for this command depends on your hacking level and the target server's security level. " +
|
||||||
"When grow() completes, the money available on a target server will be increased by a certain, fixed percentage. This percentage " +
|
"When grow() completes, the money available on a target server will be increased by a certain, fixed percentage. This percentage " +
|
||||||
@ -397,11 +371,12 @@ CONSTANTS = {
|
|||||||
"<i>weaken(hostname/ip)</i><br>Use your hacking skills to attack a server's security, lowering the server's security level. The argument passed " +
|
"<i>weaken(hostname/ip)</i><br>Use your hacking skills to attack a server's security, lowering the server's security level. The argument passed " +
|
||||||
"in must be a string with either the IP or hostname of the target server. The runtime for this command depends on your " +
|
"in must be a string with either the IP or hostname of the target server. The runtime for this command depends on your " +
|
||||||
"hacking level and the target server's security level. This function lowers the security level of the target server by " +
|
"hacking level and the target server's security level. This function lowers the security level of the target server by " +
|
||||||
"0.1.<br><br> Like hack() and grow(), weaken() can be called on " +
|
"0.05.<br><br> Like hack() and grow(), weaken() can be called on " +
|
||||||
"any server, regardless of where the script is running. This command requires root access to the target server, but " +
|
"any server, regardless of where the script is running. This command requires root access to the target server, but " +
|
||||||
"there is no required hacking level to run the command. Returns " +
|
"there is no required hacking level to run the command. Returns " +
|
||||||
"0.1. Works offline at a slower rate<br> Example: weaken('foodnstuff');<br><br>" +
|
"0.1. Works offline at a slower rate<br> Example: weaken('foodnstuff');<br><br>" +
|
||||||
"<i>print(x)</i> <br>Prints a value or a variable to the scripts logs (which can be viewed with the 'tail [script]' terminal command ). <br><br>" +
|
"<i>print(x)</i> <br>Prints a value or a variable to the scripts logs (which can be viewed with the 'tail [script]' terminal command ). <br><br>" +
|
||||||
|
"<i>clearLog()</i><br>Clears the script's logs. <br><br>" +
|
||||||
"<i>scan(hostname/ip)</i><br>Returns an array containing the hostnames of all servers that are one node away from the specified server. " +
|
"<i>scan(hostname/ip)</i><br>Returns an array containing the hostnames of all servers that are one node away from the specified server. " +
|
||||||
"The argument must be a string containing the IP or hostname of the target server. The hostnames in the returned array are strings.<br><br>" +
|
"The argument must be a string containing the IP or hostname of the target server. The hostnames in the returned array are strings.<br><br>" +
|
||||||
"<i>nuke(hostname/ip)</i><br>Run NUKE.exe on the target server. NUKE.exe must exist on your home computer. Does NOT work while offline <br> Example: nuke('foodnstuff'); <br><br>" +
|
"<i>nuke(hostname/ip)</i><br>Run NUKE.exe on the target server. NUKE.exe must exist on your home computer. Does NOT work while offline <br> Example: nuke('foodnstuff'); <br><br>" +
|
||||||
@ -508,6 +483,10 @@ CONSTANTS = {
|
|||||||
"This function returns the hostname of the newly purchased server as a string. If the function fails to purchase a server, then it will return " +
|
"This function returns the hostname of the newly purchased server as a string. If the function fails to purchase a server, then it will return " +
|
||||||
"an empty string. The function will fail if the arguments passed in are invalid or if the player does not have enough money to purchase the specified server.<br><br>" +
|
"an empty string. The function will fail if the arguments passed in are invalid or if the player does not have enough money to purchase the specified server.<br><br>" +
|
||||||
"<i>round(n)</i><br>Rounds the number n to the nearest integer. If the argument passed in is not a number, then the function will return 0.<br><br>" +
|
"<i>round(n)</i><br>Rounds the number n to the nearest integer. If the argument passed in is not a number, then the function will return 0.<br><br>" +
|
||||||
|
"<i>write(port, data)</i><br>Writes data to a port. The first argument must be a number between 1 and 10 that specifies the port. The second " +
|
||||||
|
"argument defines the data to write to the port. If the second argument is not specified then it will write an empty string to the port.<br><br>" +
|
||||||
|
"<i>read(port)</i><br>Reads data from a port. The first argument must be a number between 1 and 10 that specifies the port. A port is a serialized queue. " +
|
||||||
|
"This function will remove the first element from the queue and return it. If the queue is empty, then the string 'NULL PORT DATA' will be returned. <br><br>" +
|
||||||
"<u><h1>Hacknet Nodes API</h1></u><br>" +
|
"<u><h1>Hacknet Nodes API</h1></u><br>" +
|
||||||
"Netscript provides the following API for accessing and upgrading your Hacknet Nodes through scripts. This API does NOT work offline.<br><br>" +
|
"Netscript provides the following API for accessing and upgrading your Hacknet Nodes through scripts. This API does NOT work offline.<br><br>" +
|
||||||
"<i>hacknetnodes</i><br> A special variable. This is an array that maps to the Player's Hacknet Nodes. The Hacknet Nodes are accessed through " +
|
"<i>hacknetnodes</i><br> A special variable. This is an array that maps to the Player's Hacknet Nodes. The Hacknet Nodes are accessed through " +
|
||||||
@ -698,286 +677,36 @@ CONSTANTS = {
|
|||||||
"RAM Upgrades on your home computer<br>" +
|
"RAM Upgrades on your home computer<br>" +
|
||||||
"World Stock Exchange account and TIX API Access<br>",
|
"World Stock Exchange account and TIX API Access<br>",
|
||||||
|
|
||||||
Changelog:
|
|
||||||
"v0.25.0<br> " +
|
|
||||||
"-Refactored Netscript to use the open-source Acorns Parser. This re-implementation was done by Github users MrNuggelz. " +
|
|
||||||
"This has resulted in several changes in the Netscript language. Some scripts might break because of these changes. " +
|
|
||||||
"Changes listed below: <br>" +
|
|
||||||
"-Arrays are now fully functional Javascript arrays. You no longer need to use the 'Array' keyword to declare them. <br>" +
|
|
||||||
"-The length(), clear/clear(), insert(), and remove() functions no longer work for arrays. <br>" +
|
|
||||||
"-All Javascript array methods are available (splice(), push(), pop(), join(), shift(), indexOf(), etc. See documentation)<br>" +
|
|
||||||
"-Variables assigned to arrays are now passed by value rather than reference<br>" +
|
|
||||||
"-Incrementing/Decrementing are now available (i++, ++i)<br>" +
|
|
||||||
"-You no longer need semicolons at the end of block statements<br>" +
|
|
||||||
"-Elif is no longer valid. Use 'else if' instead<br>" +
|
|
||||||
"-Netscript's Hacknet Node API functions no longer log anything<br>" +
|
|
||||||
"-Stock prices now update every ~6 seconds when the game is active (was 10 seconds before)<br>" +
|
|
||||||
"-Added a new mechanic that affects how stock prices change<br>" +
|
|
||||||
"-Script editor now has dynamic indicators for RAM Usage and Line number<br>" +
|
|
||||||
"-Augmentation Rebalancing - Many late game augmentations are now slightly more expensive. Several early game " +
|
|
||||||
"augmentations had their effects slightly decreased<br>" +
|
|
||||||
"-Increased the amount of rewards (both money and rep) you get from infiltration<br>" +
|
|
||||||
"-Purchasing servers is now slightly more expensive<br>" +
|
|
||||||
"-Calling the Netscript function getServerMoneyAvailable('home') now return's the player's money<br>" +
|
|
||||||
"-Added round(n) Netscript function - Rounds a number<br>" +
|
|
||||||
"-Added purchaseServer(hostname, ram) Netscript function<br>" +
|
|
||||||
"-Added the TIX API. This must be purchased in the WSE. It persists through resets. Access to the TIX API " +
|
|
||||||
"allows you to write scripts that perform automated algorithmic trading. See Netscript documentation<br>" +
|
|
||||||
"-Minor rebalancing in a lot of different areas<br>" +
|
|
||||||
"-Changed the format of IP Addresses so that they are smaller (will consist mostly of single digit numbers now). This will reduce " +
|
|
||||||
"the size of the game's save file.<br><br>" +
|
|
||||||
"v0.24.1<br>" +
|
|
||||||
"-Adjusted cost of upgrading home computer RAM. Should be a little cheaper for the first few upgrades (up to ~64GB), and " +
|
|
||||||
"then will start being more expensive than before. High RAM upgrades should now be significantly more expensive than before.<br>" +
|
|
||||||
"-Slightly lowered the starting money available on most mid-game and end-game servers (servers with required hacking level " +
|
|
||||||
"greater than 200) by about 10-15%<br>" +
|
|
||||||
"-Rebalanced company/company position reputation gains and requirements<br>" +
|
|
||||||
"-Studying at a university now gives slightly more EXP and early jobs give slightly less EXP<br>" +
|
|
||||||
"-Studying at a university is now considerably more expensive<br>" +
|
|
||||||
"-Rebalanced stock market<br>" +
|
|
||||||
"-Significantly increased cost multiplier for purchasing additional Hacknet Nodes<br>" +
|
|
||||||
"-The rate at which facility security level increases during infiltration for each clearance level " +
|
|
||||||
"was lowered slightly for all companies<br>" +
|
|
||||||
"-Updated Faction descriptions<br>" +
|
|
||||||
"-Changed the way alias works. Normal aliases now only work at the start of a Terminal command (they will only " +
|
|
||||||
"replace the first word in the Terminal command). You can also create global aliases that work on any part of the " +
|
|
||||||
'command, like before. Declare global aliases by entering the optional -g flag: alias -g name="value" - Courtesy of Github user MrNuggelz<br>' +
|
|
||||||
"-'top' Terminal command implemented courtesy of Github user LTCNugget. Currently, the formatting gets screwed up " +
|
|
||||||
"if your script names are really long.<br><br>" +
|
|
||||||
"v0.24.0<br>" +
|
|
||||||
"-Players now have HP, which is displayed in the top right. To regain HP, visit the hospital. Currently " +
|
|
||||||
"the only way to lose HP is through infiltration<br>" +
|
|
||||||
"-Infiltration - Attempt to infiltrate a company and steal their classified secrets. See 'Companies' documentation for more details<br>" +
|
|
||||||
"-Stock Market - Added the World Stock Exchange (WSE), a brokerage that lets you buy/sell stocks. To begin trading you must first purchase " +
|
|
||||||
"an account. A WSE account will persist even after resetting by installing Augmentations. How the stock market works should hopefully be " +
|
|
||||||
"self explanatory. There is no documentation about it currently, I will add some later. NOTE: Stock prices only change when the game is open. " +
|
|
||||||
"The Stock Market is reset when installing Augmentations, which means you will lose all your stocks<br>" +
|
|
||||||
"-Decreased money gained from hacking by ~12%<br>" +
|
|
||||||
"-Increased reputation required for all Augmentations by ~40%<br>" +
|
|
||||||
"-Cost increase when purchasing multiple augmentations increased from 75% to 90%<br>" +
|
|
||||||
"-Added basic variable runtime to Netscript operations. Basic commands run in 100ms. Any function incurs another 100ms in runtime (200ms total). " +
|
|
||||||
"Any function that starts with getServer incurs another 100ms runtime (300ms total). exec() and scp() require 400ms total. <br>" +
|
|
||||||
"-Slightly reduced the amount of experience gained from hacking<br><br>" +
|
|
||||||
"v0.23.1<br>" +
|
|
||||||
"-scan() Netscript function now takes a single argument representing the server from which to scan. <br><br>" +
|
|
||||||
"v0.23.0<br>" +
|
|
||||||
"-You can now purchase multiple Augmentations in a run. When you purchase an Augmentation you will lose money equal to the price " +
|
|
||||||
"and then the cost of purchasing another Augmentation during this run will be increased by 75%. You do not gain the benefits " +
|
|
||||||
"of your purchased Augmentations until you install them. This installation can be done through the 'Augmentation' tab. When " +
|
|
||||||
"you install your Augmentations, your game will reset like before. <br>" +
|
|
||||||
"-Reputation needed to gain a favor from faction decreased from 7500 to 6500<br>" +
|
|
||||||
"-Reputation needed to gain a favor from company increased from 5000 to 6000<br>" +
|
|
||||||
"-Reputation cost of all Augmentations increased by 16%<br>" +
|
|
||||||
"-Higher positions at companies now grant slightly more reputation for working<br>" +
|
|
||||||
"-Added getServerMaxMoney() Netscript function<br>" +
|
|
||||||
"-Added scan() Netscript function<br>" +
|
|
||||||
"-Added getServerNumPortsRequired() Netscript function<br>" +
|
|
||||||
"-There is now no additional RAM cost incurred when multithreading a script<br><br>" +
|
|
||||||
"v0.22.1<br>" +
|
|
||||||
"-You no longer lose progress on creating programs when cancelling your work. Your progress will be saved and you will pick up " +
|
|
||||||
"where you left off when you start working on it again<br>" +
|
|
||||||
"-Added two new programs: AutoLink.exe and ServerProfiler.exe<br>" +
|
|
||||||
"-Fixed bug with Faction Field work reputation gain<br><br>" +
|
|
||||||
"v0.22.0 - Major rebalancing, optimization, and favor system<br>" +
|
|
||||||
"-Significantly nerfed most augmentations<br>" +
|
|
||||||
"-Almost every server with a required hacking level of 200 or more now has slightly randomized server parameters. This means that after every Augmentation " +
|
|
||||||
"purchase, the required hacking level, base security level, and growth factor of these servers will all be slightly different<br>" +
|
|
||||||
"-The hacking speed multiplier now increases rather than decreases. The hacking time is now divided by your hacking speed " +
|
|
||||||
"multiplier rather than multiplied. In other words, a higher hacking speed multiplier is better<br>" +
|
|
||||||
"-Servers now have a minimum server security, which is approximately one third of their starting ('base') server security<br>" +
|
|
||||||
"-If you do not steal any money from a server, then you gain hacking experience equal to the amount you would have gained " +
|
|
||||||
"had you failed the hack<br>" +
|
|
||||||
"-The effects of grow() were increased by 50%<br>" +
|
|
||||||
"-grow() and weaken() now give hacking experience based on the server's base security level, rather than a flat exp amount<br>" +
|
|
||||||
"-Slightly reduced amount of exp gained from hack(), weaken(), and grow()<br>" +
|
|
||||||
"-Rebalanced formulas that determine crime success<br>" +
|
|
||||||
"-Reduced RAM cost for multithreading a script. The RAM multiplier for each thread was reduced from 1.02 to 1.005<br>" +
|
|
||||||
"-Optimized Script objects so they take less space in the save file<br>" +
|
|
||||||
"-Added getServerBaseSecurityLevel() Netscript function<br>" +
|
|
||||||
"-New favor system for companies and factions. Earning reputation at a company/faction will give you favor for that entity when you " +
|
|
||||||
"reset after installing an Augmentation. This favor persists through the rest of the game. The more favor you have, the faster you will earn " +
|
|
||||||
"reputation with that faction/company<br>" +
|
|
||||||
"-You can no longer donate to a faction for reputation until you have 150 favor with that faction<br>" +
|
|
||||||
"-Added unalias Terminal command<br>" +
|
|
||||||
"-Changed requirements for endgame Factions<br><br>" +
|
|
||||||
"v0.21.1<br>" +
|
|
||||||
"-IF YOUR GAME BREAKS, DO THE FOLLOWING: Options -> Soft Reset -> Save Game -> Reload Page. Sorry about that! <br>" +
|
|
||||||
"-Autocompletion for aliases - courtesy of Github user LTCNugget<br><br>" +
|
|
||||||
"v0.21.0<br>" +
|
|
||||||
"-Added dynamic arrays. See Netscript documentation<br>" +
|
|
||||||
"-Added ability to pass arguments into scripts. See documentation<br>" +
|
|
||||||
"-The implementation/function signature of functions that deal with scripts have changed. Therefore, some old scripts might not " +
|
|
||||||
"work anymore. Some of these functions include run(), exec(), isRunning(), kill(), and some others I may have forgot about. " +
|
|
||||||
"Please check the updated Netscript documentation if you run into issues." +
|
|
||||||
"-Note that scripts are now uniquely identified by the script name and their arguments. For example, you can run " +
|
|
||||||
"a script using <br>run foodnstuff.script 1<br> and you can also run the same script with a different argument " +
|
|
||||||
"<br>run foodnstuff.script 2<br>These will be considered two different scripts. To kill the first script you must " +
|
|
||||||
"run <br>kill foodnstuff.script 1<br> and to kill the second you must run <br>kill foodnstuff.script 2<br> Similar concepts " +
|
|
||||||
"apply for Terminal Commands such as tail, and Netscript commands such as run(), exec(), kill(), isRunning(), etc.<br>" +
|
|
||||||
"-Added basic theme functionality using the 'theme' Terminal command - All credit goes to /u/0x726564646974 who implemented the awesome feature<br>" +
|
|
||||||
"-Optimized Script objects, which were causing save errors when the player had too many scripts<br>" +
|
|
||||||
"-Formula for determining exp gained from hacking was changed<br>" +
|
|
||||||
"-Fixed bug where you could purchase Darkweb items without TOR router<br>" +
|
|
||||||
"-Slightly increased cost multiplier for Home Computer RAM<br>" +
|
|
||||||
"-Fixed bug where you could hack too much money from a server (and bring its money available below zero)<br>" +
|
|
||||||
"-Changed tail command so that it brings up a display box with dynamic log contents. To get " +
|
|
||||||
"old functionality where the logs are printed to the Terminal, use the new 'check' command<br>" +
|
|
||||||
"-As a result of the change above, you can no longer call tail/check on scripts that are not running<br>" +
|
|
||||||
"-Added autocompletion for buying Programs in Darkweb<br>" +
|
|
||||||
"v0.20.2<br>" +
|
|
||||||
"-Fixed several small bugs<br>" +
|
|
||||||
"-Added basic array functionality to Netscript<br>" +
|
|
||||||
"-Added ability to run scripts with multiple threads. Running a script with n threads will multiply the effects of all " +
|
|
||||||
"hack(), grow(), and weaken() commands by n. However, running a script with multiple threads has drawbacks in terms of " +
|
|
||||||
"RAM usage. A script's ram usage when it is 'multithreaded' is calculated as: base cost * numThreads * (1.02 ^ numThreads). " +
|
|
||||||
"A script can be run multithreaded using the 'run [script] -t n' Terminal command or by passing in an argument to the " +
|
|
||||||
"run() and exec() Netscript commands. See documentation.<br>" +
|
|
||||||
"-RAM is slightly (~10%) more expensive (affects purchasing server and upgrading RAM on home computer)<br>" +
|
|
||||||
"-NeuroFlux Governor augmentation cost multiplier decreased<br>" +
|
|
||||||
"-Netscript default operation runtime lowered to 200ms (was 500ms previously)<br><br>" +
|
|
||||||
"v0.20.1<br>" +
|
|
||||||
"-Fixed bug where sometimes scripts would crash without showing the error<br>" +
|
|
||||||
"-Added Deepscan programs to Dark Web<br>" +
|
|
||||||
"-Declining a faction invite will stop you from receiving invitations from that faction for the rest of the run<br>" +
|
|
||||||
"-(BETA) Added functionality to export/import saves. WARNING This is only lightly tested. You cannot choose where to save your file " +
|
|
||||||
"it just goes to the default save location. Also I have no idea what will happen if you try to import a file " +
|
|
||||||
"that is not a valid save. I will address these in later updates<br><br>" +
|
|
||||||
"v0.20.0<br>" +
|
|
||||||
"-Refactored Netscript Interpreter code. Operations in Netscript should now run significantly faster (Every operation " +
|
|
||||||
"such as a variable assignment, a function call, a binary operator, getting a variable's value, etc. used to take up to several seconds, " +
|
|
||||||
"now each one should only take ~500 milliseconds). <br><br>" +
|
|
||||||
"-Percentage money stolen when hacking lowered to compensate for faster script speeds<br><br>" +
|
|
||||||
"-Hacking experience granted by grow() halved<br><br>" +
|
|
||||||
"-Weaken() is now ~11% faster, but only grants 3 base hacking exp upon completion instead of 5 <br><br>" +
|
|
||||||
"-Rebalancing of script RAM costs. Base RAM Cost for a script increased from 1GB to 1.5GB. Loops, hack(), grow() " +
|
|
||||||
"and weaken() all cost slightly less RAM than before <br><br>" +
|
|
||||||
"-Added getServerRequiredHackingLevel(server) Netscript command. <br><br>" +
|
|
||||||
"-Added fileExists(file, [server]) Netscript command, which is used to check if a script/program exists on a " +
|
|
||||||
"specified server<br><br>" +
|
|
||||||
"-Added isRunning(script, [server]) Netscript command, which is used to check if a script is running on the specified server<br><br>" +
|
|
||||||
"-Added killall Terminal command. Kills all running scripts on the current machine<br><br>" +
|
|
||||||
"-Added kill() and killall() Netscript commands. Used to kill scripts on specified machines. See Netscript documentation<br><br>" +
|
|
||||||
"-Re-designed 'Active Scripts' tab<br><br>" +
|
|
||||||
"-Hacknet Node base production rate lowered from 1.6 to 1.55 ($/second)<br><br>" +
|
|
||||||
"-Increased monetary cost of RAM (Upgrading home computer and purchasing servers will now be more expensive)<br><br>" +
|
|
||||||
"-NEW GROWTH MECHANICS - The rate of growth on a server now depends on a server's security level. A higher security level " +
|
|
||||||
"will result in lower growth on a server when using the grow() command. Furthermore, calling grow() on a server raises that " +
|
|
||||||
"server's security level by 0.004. For reference, if a server has a security level of 10 " +
|
|
||||||
"it will have approximately the same growth rate as before. <br><br>" +
|
|
||||||
"-Server growth no longer happens naturally<br><br>" +
|
|
||||||
"-Servers now have a maximum limit to their money. This limit is 50 times it's starting money<br><br>" +
|
|
||||||
"-Hacking now grants 10% less hacking experience<br><br>" +
|
|
||||||
"-You can now edit scripts that are running<br><br>" +
|
|
||||||
"-Augmentations cost ~11% more money and 25% more faction reputation<br><br>" +
|
|
||||||
"v0.19.7<br>" +
|
|
||||||
"-Added changelog to Options menu<br>" +
|
|
||||||
"-Bug fix with autocompletion (wasn't working properly for capitalized filenames/programs<br><br>" +
|
|
||||||
"v0.19.6<br>" +
|
|
||||||
"-Script editor now saves its state even when you change tabs <br>" +
|
|
||||||
"-scp() command in Terminal/script will now overwrite files at the destination <br>" +
|
|
||||||
"-Terminal commands are no longer case-sensitive (only the commands themselves such as 'run' or 'nano'. Filenames are " +
|
|
||||||
"still case sensitive<br>" +
|
|
||||||
"-Tab automcompletion will now work on commands<br><br>" +
|
|
||||||
"v0.19<br>" +
|
|
||||||
"-Hacknet Nodes have slightly higher base production, and slightly increased RAM multiplier. " +
|
|
||||||
"But they are also a bit more expensive at higher levels<br>" +
|
|
||||||
"-Calling grow() and weaken() in a script will now work offline, at slower rates than while online (The script now " +
|
|
||||||
"keeps track of the rate at which grow() and weaken() are called when the game is open. These calculated rates " +
|
|
||||||
"are used to determine how many times the calls would be made while the game is offline)<br>" +
|
|
||||||
"-Augmentations now cost 20% more reputation and 50% more money<br>" +
|
|
||||||
"-Changed the mechanic for getting invited to the hacking factions (CyberSec, NiteSec, The Black Hand, BitRunners) " +
|
|
||||||
"Now when you get to the required level to join these factions you will get a message giving " +
|
|
||||||
"you instructions on what to do in order to get invited.<br>" +
|
|
||||||
"-Added a bit of backstory/plot into the game. It's not fully fleshed out yet but it will be " +
|
|
||||||
"used in the future<br>" +
|
|
||||||
"-Made the effects of many Augmentations slightly more powerful<br>" +
|
|
||||||
"-Slightly increased company job wages across the board (~5-10% for each position)<br>" +
|
|
||||||
"-Gyms and classes are now significantly more expensive<br>" +
|
|
||||||
"-Doubled the amount by which a server's security increases when it is hacked. Now, it will " +
|
|
||||||
"increase by 0.002. Calling weaken() on a server will lower the security by 0.1.<br><br>" +
|
|
||||||
"v0.18<br>" +
|
|
||||||
"-Major rebalancing (sorry didn't record specifics. But in general hacking gives more money " +
|
|
||||||
"and hacknet nodes give less)<br>" +
|
|
||||||
"-Server growth rate (both natural and manual using grow()) doubled<br>" +
|
|
||||||
"-Added option to Soft Reset<br>" +
|
|
||||||
"-Cancelling a full time job early now only results in halved gains for reputation. Exp and money earnings are gained in full<br>" +
|
|
||||||
"-Added exec() Netscript command, used to run scripts on other servers. <br>" +
|
|
||||||
"-NEW HACKING MECHANICS: Whenever a server is hacked, its 'security level' is increased by a very small amount. " +
|
|
||||||
"The security level is denoted by a number between 1-100. A higher security level makes it harder " +
|
|
||||||
"to hack a server and also decreases the amount of money you steal from it. Two Netscript functions, " +
|
|
||||||
"weaken() and getServerSecurityLevel() level, were added. The weaken(server) function lowers a server's " +
|
|
||||||
"security level. See the Netscript documentation for more details<br>" +
|
|
||||||
"-When donating to factions, the base rate is now $1,000,000 for 1 reputation point. Before, it was " +
|
|
||||||
"$1,000 for 1 reputation point.<br>" +
|
|
||||||
"-Monetary costs for all Augmentations increased. They are now about ~3.3 - 3.75 times more expensive than before<br><br>" +
|
|
||||||
"v0.17.1 <br>" +
|
|
||||||
"-Fixed issue with purchasing Augmentations that are 'upgrades' and require previous Augmentations to be installed<br>" +
|
|
||||||
"-Increased the percentage of money stolen from servers when hacking<br><br>" +
|
|
||||||
"v0.17<br>" +
|
|
||||||
"-Greatly increased amount of money gained for crimes (by about 400% for most crimes)<br>" +
|
|
||||||
"-Criminal factions require slightly less negative karma to get invited to<br>" +
|
|
||||||
"-Increased the percentage of money stolen from servers when hacking<br>" +
|
|
||||||
"-Increased the starting amount of money available on beginning servers (servers with <50 required hacking))<br>" +
|
|
||||||
"-Increased the growth rate of servers (both naturally and manually when using the grow() command in a script)<br>" +
|
|
||||||
"-Added getHostname() command in Netscript that returns the hostname of the server a script is running on<br>" +
|
|
||||||
"-jQuery preventDefault() called when pressing ctrl+b in script editor<br>" +
|
|
||||||
"-The Neuroflux Governor augmentation (the one that can be repeatedly leveled up) now increases ALL multipliers by 1%. To balance it out, it's price multiplier when it levels up was increased<br>" +
|
|
||||||
"-Hacknet Node base production decreased from $1.75/s to $1.65/s<br>" +
|
|
||||||
"-Fixed issue with nested for loops in Netscript (stupid Javascript references)<br>" +
|
|
||||||
"-Added 'scp' command to Terminal and Netscript<br>" +
|
|
||||||
"-Slightly nerfed Hacknet Node Kernel DNI and Hacknet Node Core DNI Augmentations<br>" +
|
|
||||||
"-Increased TOR Router cost to $200k<br><br>" +
|
|
||||||
"v0.16<br>" +
|
|
||||||
"-New Script Editor interface <br>" +
|
|
||||||
"-Rebalanced hacknet node - Increased base production but halved the multiplier from additional cores. This should boost its early-game production but nerf its late-game production<br>" +
|
|
||||||
"-Player now starts with 8GB of RAM on home computer<br>" +
|
|
||||||
"-'scan-analyze' terminal command displays RAM on servers<br>" +
|
|
||||||
"-Slightly buffed the amount of money the player steals when hacking servers (by about ~8%)<br>" +
|
|
||||||
"-Time to execute grow() now depends on hacking skill and server security, rather than taking a flat 2 minutes.<br>" +
|
|
||||||
"-Clicking outside of a pop-up dialog box will now close it<br>" +
|
|
||||||
"-BruteSSH.exe takes 33% less time to create<br>" +
|
|
||||||
"-'iron-gym' and 'max-hardware' servers now have 2GB of RAM<br>" +
|
|
||||||
"-Buffed job salaries across the board<br>" +
|
|
||||||
"-Updated Tutorial<br>" +
|
|
||||||
"-Created a Hacknet Node API for Netscript that allows you to access and upgrade your Hacknet Nodes. See the Netscript documentation for more details. WARNING The old upgradeHacknetNode() and getNumHacknetNodes() functions waere removed so any script that has these will no longer work <br><br>" +
|
|
||||||
"v0.15 <br>" +
|
|
||||||
"-Slightly reduced production multiplier for Hacknet Node RAM<br>" +
|
|
||||||
"-Faction pages now scroll<br>" +
|
|
||||||
"-Slightly increased amount of money gained from hacking<br>" +
|
|
||||||
"-Added 'alias' command<br>" +
|
|
||||||
"-Added 'scan-analyze' terminal command - used to get basic hacking info about all immediate network connections<br>" +
|
|
||||||
"-Fixed bugs with upgradeHacknetNode() and purchaseHacknetNode() commands<br>" +
|
|
||||||
"-Added getNumHacknetNodes() and hasRootAccess(hostname/ip) commands to Netscript<br>" +
|
|
||||||
"-Increased Cost of university classes/gym<br>" +
|
|
||||||
"-You can now see what an Augmentation does and its price even while its locked<br><br>",
|
|
||||||
|
|
||||||
LatestUpdate:
|
LatestUpdate:
|
||||||
"v0.25.0<br> " +
|
"v0.26.0<br>" +
|
||||||
"-Refactored Netscript to use the open-source Acorns Parser. This re-implementation was done by Github users MrNuggelz. " +
|
"-Game now has a real ending, although it's not very interesting/satisfying right now. It sets up the framework for the secondary prestige system " +
|
||||||
"This has resulted in several changes in the Netscript language. Some scripts might break because of these changes. " +
|
"in the future<br>" +
|
||||||
"Changes listed below: <br>" +
|
"-Forgot to mention that since last update, comments now work in Netscript. Use // for single line comments or /* and */ for multiline comments " +
|
||||||
"-Arrays are now fully functional Javascript arrays. You no longer need to use the 'Array' keyword to declare them. <br>" +
|
"just like in Javascript<br>" +
|
||||||
"-The length(), clear/clear(), insert(), and remove() functions no longer work for arrays. <br>" +
|
"-Added ports to Netscript. These ports are essentially serialized queues. You can use the write() Netscript function to write a value " +
|
||||||
"-All Javascript array methods are available (splice(), push(), pop(), join(), shift(), indexOf(), etc. See documentation)<br>" +
|
"to a queue, and then you can use the read() Netscript function to read the value from the queue. Once you read a value from the queue it will be " +
|
||||||
"-Variables assigned to arrays are now passed by value rather than reference<br>" +
|
"removed. There are only 10 queues (1-10), and each has a maximum capacity of 50 entries. If you try to write to a queue that is full, the " +
|
||||||
"-Incrementing/Decrementing are now available (i++, ++i)<br>" +
|
"the first value is removed. See wiki/Netscript documentation for more details<br>" +
|
||||||
"-You no longer need semicolons at the end of block statements<br>" +
|
"-You can now use the 'help' Terminal command for specific commands<br>" +
|
||||||
"-Elif is no longer valid. Use 'else if' instead<br>" +
|
"-You can now use './' to run a script/program (./NUKE.exe). However, tab completion currently doesn't work for it (I'm working on it)<br>" +
|
||||||
"-Netscript's Hacknet Node API functions no longer log anything<br>" +
|
"-Decreased the base growth rate of servers by ~25%<br>" +
|
||||||
"-Stock prices now update every ~6 seconds when the game is active (was 10 seconds before)<br>" +
|
"-Both the effect of weaken() and its time to execute were halved. In other words, calling weaken() on a server only lowers its security by 0.05 (was 0.1 before) " +
|
||||||
"-Added a new mechanic that affects how stock prices change<br>" +
|
"but the time to execute the function is half of what it was before. Therefore, the effective rate of weaken() should be about the same<br>" +
|
||||||
"-Script editor now has dynamic indicators for RAM Usage and Line number<br>" +
|
"-Increased all Infiltration rewards by ~10%, and increased infiltration rep gains by an additional 20% (~32% total for rep gains)<br>" +
|
||||||
"-Augmentation Rebalancing - Many late game augmentations are now slightly more expensive. Several early game " +
|
"-The rate at which the security level of a facility increases during Infiltration was decreased significantly (~33%)<br>" +
|
||||||
"augmentations had their effects slightly decreased<br>" +
|
"-Getting treated at the Hospital is now 33% more expensive<br>" +
|
||||||
"-Increased the amount of rewards (both money and rep) you get from infiltration<br>" +
|
"-Slightly increased the amount of time it takes to hack a server<br>" +
|
||||||
"-Purchasing servers is now slightly more expensive<br>" +
|
"-Slightly decreased the amount of money gained when hacking a server (~6%)<br>" +
|
||||||
"-Calling the Netscript function getServerMoneyAvailable('home') now return's the player's money<br>" +
|
"-Slightly decreased the base cost for RAM on home computer, but increased the cost multiplier. This means " +
|
||||||
"-Added round(n) Netscript function - Rounds a number<br>" +
|
"that upgrading RAM on the home computer should be slightly cheaper at the start, but slightly more expensive " +
|
||||||
"-Added purchaseServer(hostname, ram) Netscript function<br>" +
|
"later on<br>" +
|
||||||
"-Added the TIX API. This must be purchased in the WSE. It persists through resets. Access to the TIX API " +
|
"-Increased the required hacking level for many late game servers<br>" +
|
||||||
"allows you to write scripts that perform automated algorithmic trading. See Netscript documentation<br>" +
|
"-The sleep() Netscript function now takes an optional 'log' argument that specifies whether or " +
|
||||||
"-Minor rebalancing in a lot of different areas<br>" +
|
"not the 'Sleeping for N milliseconds' will be logged for the script<br>" +
|
||||||
"-Changed the format of IP Addresses so that they are smaller (will consist mostly of single digit numbers now). This will reduce " +
|
"-Added clearLog() Netscript function<br>" +
|
||||||
"the size of the game's save file.<br>",
|
"-Deleted a few stocks. Didn't see a reason for having so many, and it just affects performance. Won't take " +
|
||||||
|
"effect until you reset by installing Augmentations<br>" +
|
||||||
|
"-There was a typo with Zeus Medical's server hostname. It is now 'zeus-med' rather than 'zeud-med'<br>" +
|
||||||
|
"-Added keyboard shortcuts to quickly navigate between different menus. See wiki link <a href='http://bitburner.wikia.com/wiki/Shortcuts' target='_blank'>here</a><br>" +
|
||||||
|
"-Changed the Navigation Menu UI",
|
||||||
}
|
}
|
||||||
|
@ -351,9 +351,9 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
|
|||||||
if (!illuminatiFac.isBanned && !illuminatiFac.isMember && !illuminatiFac.alreadyInvited &&
|
if (!illuminatiFac.isBanned && !illuminatiFac.isMember && !illuminatiFac.alreadyInvited &&
|
||||||
numAugmentations >= 30 &&
|
numAugmentations >= 30 &&
|
||||||
this.money >= 150000000000 &&
|
this.money >= 150000000000 &&
|
||||||
this.hacking_skill >= 1200 &&
|
this.hacking_skill >= 1500 &&
|
||||||
this.strength >= 1000 && this.defense >= 1000 &&
|
this.strength >= 1200 && this.defense >= 1200 &&
|
||||||
this.dexterity >= 1000 && this.agility >= 1000) {
|
this.dexterity >= 1200 && this.agility >= 1200) {
|
||||||
invitedFactions.push(illuminatiFac);
|
invitedFactions.push(illuminatiFac);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,20 +62,20 @@ FactionInfo = {
|
|||||||
" .' NITESECNITESECn <br>" +
|
" .' NITESECNITESECn <br>" +
|
||||||
" / NITESECNITESEC; <br>" +
|
" / NITESECNITESEC; <br>" +
|
||||||
" : :NITESECNITESEC; <br>" +
|
" : :NITESECNITESEC; <br>" +
|
||||||
" ; @ NITESECNITESECN <br>" +
|
" ; $ NITESECNITESECN <br>" +
|
||||||
" : _, ,N'ITESECNITESEC <br>" +
|
" : _, ,N'ITESECNITESEC <br>" +
|
||||||
" : .+''`, : `NITESECNIT <br>" +
|
" : .+^^`, : `NITESECNIT <br>" +
|
||||||
" ) /), `-,-=,NITESECNI <br>" +
|
" ) /), `-,-=,NITESECNI <br>" +
|
||||||
" / ` ,-;|NITESECN; <br>" +
|
" / ^ ,-;|NITESECN; <br>" +
|
||||||
" / _.'(o) '-';NITESECN <br>" +
|
" / _.' '-';NITESECN <br>" +
|
||||||
" ( , o ,-''`^NITE' <br>" +
|
" ( , ,-''`^NITE' <br>" +
|
||||||
" )` :`. .' <br>" +
|
" )` :`. .' <br>" +
|
||||||
" )-. ; `- / <br>" +
|
" )-- ; `- / <br>" +
|
||||||
" \ _.-' : <br>" +
|
" \' _.-' : <br>" +
|
||||||
" ( _.-' \. \ <br>" +
|
" ( _.-' \. \ <br>" +
|
||||||
" \------. \ \ <br>" +
|
" \------. \ \ <br>" +
|
||||||
" \. \ \ <br>" +
|
" \. \ \ <br>" +
|
||||||
" bug \ _.nIt <br>" +
|
" \ _.nIt <br>" +
|
||||||
" \ _.nITESECNi <br>" +
|
" \ _.nITESECNi <br>" +
|
||||||
" nITESECNIT^' \ <br>" +
|
" nITESECNIT^' \ <br>" +
|
||||||
" NITE^' ___ \ <br>" +
|
" NITE^' ___ \ <br>" +
|
||||||
@ -85,12 +85,12 @@ FactionInfo = {
|
|||||||
" / d; `b| <br>" +
|
" / d; `b| <br>" +
|
||||||
" /, $; @ `: <br>" +
|
" /, $; @ `: <br>" +
|
||||||
" /' $$ ; <br>" +
|
" /' $$ ; <br>" +
|
||||||
" .' $$b (o) | <br>" +
|
" .' $$b o | <br>" +
|
||||||
" .' d$$$; : <br>" +
|
" .' d$$$; : <br>" +
|
||||||
" / .d$$$$; , ; <br>" +
|
" / .d$$$$; , ; <br>" +
|
||||||
" d .d$$$$$$$ $ | <br>" +
|
" d .dNITESEC $ | <br>" +
|
||||||
" :bp.__.g$$$$$$$$$ :$ ; <br>" +
|
" :bp.__.gNITESEC$$ :$ ; <br>" +
|
||||||
" $$$$$$$$$$$$$$$$$ $$b : <br>",
|
" NITESECNITESECNIT $$b : <br>",
|
||||||
|
|
||||||
//City factions, essentially governments
|
//City factions, essentially governments
|
||||||
ChongqingInfo: "Serve the people",
|
ChongqingInfo: "Serve the people",
|
||||||
|
181
src/HelpText.js
Normal file
181
src/HelpText.js
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
/* HelpText.js */
|
||||||
|
TerminalHelpText =
|
||||||
|
"Type 'help name' to learn more about the command 'name'<br><br>" +
|
||||||
|
'alias [-g] [name="value"] Create or display Terminal aliases<br>' +
|
||||||
|
"analyze Get information about the current machine <br>" +
|
||||||
|
"cat [message] Display a .msg file<br>" +
|
||||||
|
"check [script] [args...] Print a script's logs to Terminal<br>" +
|
||||||
|
"clear Clear all text on the terminal <br>" +
|
||||||
|
"cls See 'clear' command <br>" +
|
||||||
|
"connect [ip/hostname] Connects to a remote server<br>" +
|
||||||
|
"free Check the machine's memory (RAM) usage<br>" +
|
||||||
|
"hack Hack the current machine<br>" +
|
||||||
|
"help [command] Display this help text, or the help text for a command<br>" +
|
||||||
|
"home Connect to home computer<br>" +
|
||||||
|
"hostname Displays the hostname of the machine<br>" +
|
||||||
|
"ifconfig Displays the IP address of the machine<br>" +
|
||||||
|
"kill [script] [args...] Stops the specified script on the current server <br>" +
|
||||||
|
"killall Stops all running scripts on the current machine<br>" +
|
||||||
|
"ls Displays all programs and scripts on the machine<br>" +
|
||||||
|
"mem [script] [-t] [n] Displays the amount of RAM required to run the script<br>" +
|
||||||
|
"nano [script] Script editor - Open up and edit a script<br>" +
|
||||||
|
"ps Display all scripts that are currently running<br>" +
|
||||||
|
"rm [file] Delete a file from the server<br>" +
|
||||||
|
"run [name] [-t] [n] [args...] Execute a program or script<br>" +
|
||||||
|
"scan Prints all immediately-available network connections<br>" +
|
||||||
|
"scan-analyze [d] Prints info for all servers up to <i>d</i> nodes away<br>" +
|
||||||
|
"scp [script] [server] Copies a script to a destination server<br>" +
|
||||||
|
"sudov Shows whether you have root access on this computer<br>" +
|
||||||
|
"tail [script] [args...] Displays dynamic logs for the specified script<br>" +
|
||||||
|
"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>';
|
||||||
|
|
||||||
|
HelpTexts = {
|
||||||
|
alias: 'alias [-g] [name="value"] <br>' +
|
||||||
|
"Create or display aliases. An alias enables a replacement of a word with another string. " +
|
||||||
|
"It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME " +
|
||||||
|
"of an alias defines the word that will be replaced, while the VALUE defines what it will be replaced by. For example, " +
|
||||||
|
"you could create the alias 'nuke' for the Terminal command 'run NUKE.exe' using the following: <br><br>" +
|
||||||
|
'alias nuke="run NUKE.exe"<br><br>' +
|
||||||
|
"Then, to run the NUKE.exe program you would just have to enter 'nuke' in Terminal rather than the full command. " +
|
||||||
|
"It is important to note that 'default' aliases will only be substituted for the first word of a Terminal command. For " +
|
||||||
|
"example, if the following alias was set: <br><br>" +
|
||||||
|
'alias worm="HTTPWorm.exe"<br><br>' +
|
||||||
|
"and then you tried to run the following terminal command: <br><br>" +
|
||||||
|
"run worm<br><br>" +
|
||||||
|
"This would fail because the worm alias is not the first word of a Terminal command. To allow an alias to be substituted " +
|
||||||
|
"anywhere in a Terminal command, rather than just the first word, you must set it to be a global alias using the -g flag: <br><br>" +
|
||||||
|
'alias -g worm="HTTPWorm.exe"<br><br>' +
|
||||||
|
"Now, the 'worm' alias will be substituted anytime it shows up as an individual word in a Terminal command. <br><br>" +
|
||||||
|
"Entering just the command 'alias' without any arguments prints the list of all defined aliases in the reusable form " +
|
||||||
|
"'alias NAME=VALUE' on the Terminal. <br><br>" +
|
||||||
|
"The 'unalias' command can be used to remove aliases.<br><br>",
|
||||||
|
cat: "cat [message]<br>" +
|
||||||
|
"Display message files, which are files ending with the '.msg' extension. Example:<br><br>" +
|
||||||
|
"cat j1.msg",
|
||||||
|
check: "check [script name] [args...]<br>" +
|
||||||
|
"Print the logs of the script specified by the script name and arguments to the Terminal. Each argument must be separated by " +
|
||||||
|
"a space. Remember that a running script is uniquely " +
|
||||||
|
"identified both by its name and the arguments that are used to start it. So, if a script was ran with the following arguments: <br><br>" +
|
||||||
|
"run foo.script 1 2 foodnstuff<br><br>" +
|
||||||
|
"Then to run the 'check' command on this script you would have to pass the same arguments in: <br><br>" +
|
||||||
|
"check foo.script 1 2 foodnstuff",
|
||||||
|
clear: "clear<br>" +
|
||||||
|
"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up " +
|
||||||
|
"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'cls' command",
|
||||||
|
cls: "cls<br>" +
|
||||||
|
"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up " +
|
||||||
|
"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'clear' command",
|
||||||
|
connect: "connect [hostname/ip]<br>" +
|
||||||
|
"Connect to a remote server. The hostname or IP address of the remote server must be given as the argument " +
|
||||||
|
"to this command. Note that only servers that are immediately adjacent to the current server in the network can be connected to. To " +
|
||||||
|
"see which servers can be connected to, use the 'scan' command.",
|
||||||
|
free: "free<br>" +
|
||||||
|
"Display's the memory usage on the current machine. Print the amount of RAM that is available on the current server as well as " +
|
||||||
|
"how much of it is being used.",
|
||||||
|
hack: "hack<br>" +
|
||||||
|
"Attempt to hack the current server. Requires root access in order to be run. See the wiki page for hacking mechanics<br>",
|
||||||
|
help: "help [command]<br>" +
|
||||||
|
"Display Terminal help information. Without arguments, 'help' prints a list of all valid Terminal commands and a brief " +
|
||||||
|
"description of their functionality. You can also pass the name of a Terminal command as an argument to 'help' to print " +
|
||||||
|
"more detailed information about the Terminal command. Examples: <br><br>" +
|
||||||
|
"help alias<br>" +
|
||||||
|
"help scan-analyze",
|
||||||
|
home: "home<br>" +
|
||||||
|
"Connect to your home computer. This will work no matter what server you are currently connected to.",
|
||||||
|
hostname: "hostname<br>" +
|
||||||
|
"Prints the hostname of the current server",
|
||||||
|
ifconfig: "ipconfig<br>" +
|
||||||
|
"Prints the IP address of the current server",
|
||||||
|
kill: "kill [script name] [args...]<br>" +
|
||||||
|
"Kill the script specified by the script name and arguments. Each argument must be separated by " +
|
||||||
|
"a space. Remember that a running script is uniquely identified by " +
|
||||||
|
"both its name and the arguments that are used to start it. So, if a script was ran with the following arguments:<br><br>" +
|
||||||
|
"run foo.script 1 sigma-cosmetics<br><br>" +
|
||||||
|
"Then to kill this script the same arguments would have to be used:<br><br>" +
|
||||||
|
"kill foo.script 1 sigma-cosmetics<br><br>" +
|
||||||
|
"Note that after issuing the 'kill' command for a script, it may take a while for the script to actually stop running. " +
|
||||||
|
"This will happen if the script is in the middle of a command such as grow() or weaken() that takes time to execute. " +
|
||||||
|
"The script will not be stopped/killed until after that time has elapsed.",
|
||||||
|
killall: "killall<br>" +
|
||||||
|
"Kills all scripts on the current server. " +
|
||||||
|
"Note that after the 'kill' command is issued for a script, it may take a while for the script to actually stop running. " +
|
||||||
|
"This will happen if the script is in the middle of a command such as grow() or weaken() that takes time to execute. " +
|
||||||
|
"The script will not be stopped/killed until after that time has elapsed.",
|
||||||
|
ls: "ls<br>" +
|
||||||
|
"Prints all files on the current server to the Terminal screen. This includes all scripts, programs, and message files. " +
|
||||||
|
"The files will be displayed in alphabetical order.",
|
||||||
|
mem: "mem [script name] [-t] [num threads]<br>" +
|
||||||
|
"Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print " +
|
||||||
|
"the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then " +
|
||||||
|
"an argument for the number of threads must be passed in afterwards. Examples:<br><br>" +
|
||||||
|
"mem foo.script<br>" +
|
||||||
|
"mem foo.script -t 50<br>" +
|
||||||
|
"The first example above will print the amount of RAM needed to run 'foo.script' with a single thread. The second example " +
|
||||||
|
"above will print the amount of RAM needed to run 'foo.script' with 50 threads.",
|
||||||
|
nano: "nano [script name]<br>" +
|
||||||
|
"Opens up the specified script in the Script Editor. If the script does not already exist, then a new, empty script " +
|
||||||
|
"will be created",
|
||||||
|
ps: "ps<br>" +
|
||||||
|
"Prints all scripts that are running on the current server",
|
||||||
|
rm: "rm [file]<br>" +
|
||||||
|
"Removes the specified file from the current server. A file can be a script, a program, or a message file. <br><br>" +
|
||||||
|
"WARNING: This is permanent and cannot be undone",
|
||||||
|
run: "run [file name] [-t] [num threads] [args...]<br>" +
|
||||||
|
"Execute a program or a script.<br><br>" +
|
||||||
|
"The '[-t]', '[num threads]', and '[args...]' arguments are only valid when running a script. The '-t' flag is used " +
|
||||||
|
"to indicate that the script should be run with the specified number of threads. If the flag is omitted, " +
|
||||||
|
"then the script will be run with a single thread by default. " +
|
||||||
|
"If the '-t' flag is used, then it MUST come immediately " +
|
||||||
|
"after the script name, and the [num threads] argument MUST come immediately afterwards. <br><br>" +
|
||||||
|
"[args...] represents a variable number of arguments that will be passed into the script. See the documentation " +
|
||||||
|
"about script arguments. Each specified argument must be separated by a space. <br><br>",
|
||||||
|
scan: "scan<br>" +
|
||||||
|
"Prints all immediately-available network connection. This will print a list of all servers that you can currently connect " +
|
||||||
|
"to using the 'connect' Terminal command.",
|
||||||
|
"scan-analyze": "scan-analyze [depth]<br>" +
|
||||||
|
"Prints detailed information about all servers up to [depth] nodes away on the network. Calling " +
|
||||||
|
"'scan-analyze 1' will display information for the same servers that are shown by the 'scan' Terminal " +
|
||||||
|
"command. This command also shows the relative paths to reach each server.<br><br>" +
|
||||||
|
"By default, the maximum depth that can be specified for 'scan-analyze' is 3. However, once you have " +
|
||||||
|
"the DeepscanV1.exe and DeepscanV2.exe programs, you can execute 'scan-analyze' with a depth up to " +
|
||||||
|
"5 and 10, respectively.<br><br>" +
|
||||||
|
"The information 'scan-analyze' displays about each server includes whether or not you have root access to it, " +
|
||||||
|
"its required hacking level, the number of open ports required to run NUKE.exe on it, and how much RAM " +
|
||||||
|
"it has",
|
||||||
|
scp: "scp [script name] [target server]<br>" +
|
||||||
|
"Copies the specified script from the current server to the target server. " +
|
||||||
|
"The second argument passed in must be the hostname or IP of the target server.",
|
||||||
|
sudov: "sudov<br>" +
|
||||||
|
"Prints whether or not you have root access to the current machine",
|
||||||
|
tail: "tail [script name] [args...]<br>" +
|
||||||
|
"Displays dynamic logs for the script specified by the script name and arguments. Each argument must be separated " +
|
||||||
|
"by a space. Remember that a running script is uniquely identified by both its name and the arguments that were used " +
|
||||||
|
"to run it. So, if a script was ran with the following arguments: <br><br>" +
|
||||||
|
"run foo.script 10 50000<br><br>" +
|
||||||
|
"Then in order to check its logs with 'tail' the same arguments must be used: <br><br>" +
|
||||||
|
"tail foo.script 10 50000",
|
||||||
|
theme: "theme [preset] | [#background #text #highlight]<br>" +
|
||||||
|
"Change the color of the game's user interface<br><br>" +
|
||||||
|
"This command can be called with a preset theme. Currently, the supported presets are 'default', 'muted', and 'solarized'. " +
|
||||||
|
"However, you can also specify your own color scheme using hex values. To do so, you must specify three hex color values " +
|
||||||
|
"for the background color, the text color, and the highlight color. These hex values must be preceded by a pound sign (#) and " +
|
||||||
|
"must be either 3 or 6 digits. Example:<br><br>" +
|
||||||
|
"theme #ffffff #385 #235012<br><br>" +
|
||||||
|
"A color picker such as " +
|
||||||
|
"<a href='https://www.google.com/search?q=color+picker&oq=color+picker&aqs=chrome.0.0l6.951j0j1&sourceid=chrome&ie=UTF-8' target='_blank'>Google's</a> " +
|
||||||
|
"can be used to get your desired hex color values<br><br>" +
|
||||||
|
"Themes are not saved, so when the game is closed and then re-opened or reloaded then it will revert back to the default theme.",
|
||||||
|
top: "top<br>" +
|
||||||
|
"Prints a list of all scripts running on the current server as well as their thread count and how much " +
|
||||||
|
"RAM they are using in total.",
|
||||||
|
unalias: 'unalias "[alias name]"<br>' +
|
||||||
|
"Deletes the specified alias. Note that the double quotation marks are required. <br><br>" +
|
||||||
|
"As an example, if an alias was declared using:<br><br>" +
|
||||||
|
'alias r="run"<br><br>' +
|
||||||
|
"Then it could be removed using:<br><br>" +
|
||||||
|
'unalias "r"<br><br>' +
|
||||||
|
"It is not necessary to differentiate between global and non-global aliases when using 'unalias'",
|
||||||
|
|
||||||
|
}
|
@ -397,9 +397,9 @@ function endInfiltrationLevel(inst) {
|
|||||||
//Check if you gained any secrets
|
//Check if you gained any secrets
|
||||||
if (inst.clearanceLevel % 5 == 0) {
|
if (inst.clearanceLevel % 5 == 0) {
|
||||||
var baseSecretValue = inst.baseValue * inst.clearanceLevel / 2;
|
var baseSecretValue = inst.baseValue * inst.clearanceLevel / 2;
|
||||||
var secretValue = baseSecretValue * Player.faction_rep_mult;
|
var secretValue = baseSecretValue * Player.faction_rep_mult * 1.2;
|
||||||
var secretMoneyValue = baseSecretValue * CONSTANTS.InfiltrationMoneyValue;
|
var secretMoneyValue = baseSecretValue * CONSTANTS.InfiltrationMoneyValue;
|
||||||
inst.secretsStolen.push(secretValue);
|
inst.secretsStolen.push(baseSecretValue);
|
||||||
dialogBoxCreate("You found and stole a set of classified documents from the company. " +
|
dialogBoxCreate("You found and stole a set of classified documents from the company. " +
|
||||||
"These classified secrets could probably be sold for money ($" +
|
"These classified secrets could probably be sold for money ($" +
|
||||||
formatNumber(secretMoneyValue, 2) + "), or they " +
|
formatNumber(secretMoneyValue, 2) + "), or they " +
|
||||||
|
@ -79,7 +79,7 @@ function iTutorialEvaluateStep() {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case iTutorialSteps.GoToCharacterPage:
|
case iTutorialSteps.GoToCharacterPage:
|
||||||
iTutorialSetText("Let's start by heading to the Character page. Click the 'Character' tab on " +
|
iTutorialSetText("Let's start by heading to the Stats page. Click the 'Stats' tab on " +
|
||||||
"the main navigation menu (left-hand side of the screen)");
|
"the main navigation menu (left-hand side of the screen)");
|
||||||
|
|
||||||
//No next button
|
//No next button
|
||||||
@ -87,20 +87,20 @@ function iTutorialEvaluateStep() {
|
|||||||
next.style.display = "none";
|
next.style.display = "none";
|
||||||
|
|
||||||
//Flash Character tab
|
//Flash Character tab
|
||||||
document.getElementById("character-menu-link").setAttribute("class", "flashing-button");
|
document.getElementById("stats-menu-link").setAttribute("class", "flashing-button");
|
||||||
|
|
||||||
//Initialize everything necessary to open the "Character" page
|
//Initialize everything necessary to open the "Character" page
|
||||||
var charaterMainMenuButton = document.getElementById("character-menu-link");
|
var charaterMainMenuButton = document.getElementById("stats-menu-link");
|
||||||
charaterMainMenuButton.addEventListener("click", function() {
|
charaterMainMenuButton.addEventListener("click", function() {
|
||||||
Engine.loadCharacterContent();
|
Engine.loadCharacterContent();
|
||||||
iTutorialNextStep(); //Opening the character page will go to the next step
|
iTutorialNextStep(); //Opening the character page will go to the next step
|
||||||
clearEventListeners("character-menu-link");
|
clearEventListeners("stats-menu-link");
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case iTutorialSteps.CharacterPage:
|
case iTutorialSteps.CharacterPage:
|
||||||
iTutorialSetText("The Character page shows a lot of important information about your progress, " +
|
iTutorialSetText("The Stats page shows a lot of important information about your progress, " +
|
||||||
"such as your stats, skills, money, and bonuses/multipliers. ")
|
"such as your skills, money, and bonuses/multipliers. ")
|
||||||
var next = clearEventListeners("interactive-tutorial-next");
|
var next = clearEventListeners("interactive-tutorial-next");
|
||||||
next.style.display = "inline-block";
|
next.style.display = "inline-block";
|
||||||
next.addEventListener("click", function() {
|
next.addEventListener("click", function() {
|
||||||
@ -339,13 +339,13 @@ function iTutorialEvaluateStep() {
|
|||||||
"earn you money over time, both online and offline. When you get enough " +
|
"earn you money over time, both online and offline. When you get enough " +
|
||||||
" money, you can upgrade " +
|
" money, you can upgrade " +
|
||||||
"your newly-purchased Hacknet Node below. <br><br>" +
|
"your newly-purchased Hacknet Node below. <br><br>" +
|
||||||
"Let's go to the 'World' page through the main navigation menu.");
|
"Let's go to the 'City' page through the main navigation menu.");
|
||||||
document.getElementById("world-menu-link").setAttribute("class", "flashing-button");
|
document.getElementById("city-menu-link").setAttribute("class", "flashing-button");
|
||||||
var worldButton = clearEventListeners("world-menu-link");
|
var worldButton = clearEventListeners("city-menu-link");
|
||||||
worldButton.addEventListener("click", function() {
|
worldButton.addEventListener("click", function() {
|
||||||
Engine.loadWorldContent();
|
Engine.loadWorldContent();
|
||||||
iTutorialNextStep();
|
iTutorialNextStep();
|
||||||
clearEventListeners("world-menu-link");
|
clearEventListeners("city-menu-link");
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@ -398,7 +398,7 @@ function iTutorialNextStep() {
|
|||||||
iTutorialEvaluateStep();
|
iTutorialEvaluateStep();
|
||||||
break;
|
break;
|
||||||
case iTutorialSteps.GoToCharacterPage:
|
case iTutorialSteps.GoToCharacterPage:
|
||||||
document.getElementById("character-menu-link").removeAttribute("class");
|
document.getElementById("stats-menu-link").removeAttribute("class");
|
||||||
currITutorialStep = iTutorialSteps.CharacterPage;
|
currITutorialStep = iTutorialSteps.CharacterPage;
|
||||||
iTutorialEvaluateStep();
|
iTutorialEvaluateStep();
|
||||||
break;
|
break;
|
||||||
@ -499,7 +499,7 @@ function iTutorialNextStep() {
|
|||||||
iTutorialEvaluateStep();
|
iTutorialEvaluateStep();
|
||||||
break;
|
break;
|
||||||
case iTutorialSteps.HacknetNodesGoToWorldPage:
|
case iTutorialSteps.HacknetNodesGoToWorldPage:
|
||||||
document.getElementById("world-menu-link").removeAttribute("class");
|
document.getElementById("city-menu-link").removeAttribute("class");
|
||||||
currITutorialStep = iTutorialSteps.WorldDescription;
|
currITutorialStep = iTutorialSteps.WorldDescription;
|
||||||
iTutorialEvaluateStep();
|
iTutorialEvaluateStep();
|
||||||
break;
|
break;
|
||||||
|
@ -369,7 +369,7 @@ displayLocationContent = function() {
|
|||||||
purchaseTor.style.display = "block";
|
purchaseTor.style.display = "block";
|
||||||
purchaseHomeRam.style.display = "block";
|
purchaseHomeRam.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumECorp,
|
setInfiltrateButton(infiltrate, Locations.AevumECorp,
|
||||||
6000, 106, 150, 13);
|
6000, 116, 150, 9.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumBachmanAndAssociates:
|
case Locations.AevumBachmanAndAssociates:
|
||||||
@ -382,7 +382,7 @@ displayLocationContent = function() {
|
|||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumBachmanAndAssociates,
|
setInfiltrateButton(infiltrate, Locations.AevumBachmanAndAssociates,
|
||||||
1500, 38, 60, 9.5);
|
1500, 42, 60, 6.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumClarkeIncorporated:
|
case Locations.AevumClarkeIncorporated:
|
||||||
@ -395,7 +395,7 @@ displayLocationContent = function() {
|
|||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumClarkeIncorporated,
|
setInfiltrateButton(infiltrate, Locations.AevumClarkeIncorporated,
|
||||||
2400, 30, 75, 9);
|
2400, 34, 75, 6);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumFulcrumTechnologies:
|
case Locations.AevumFulcrumTechnologies:
|
||||||
@ -414,7 +414,7 @@ displayLocationContent = function() {
|
|||||||
purchaseTor.style.display = "block";
|
purchaseTor.style.display = "block";
|
||||||
purchaseHomeRam.style.display = "block";
|
purchaseHomeRam.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumFulcrumTechnologies,
|
setInfiltrateButton(infiltrate, Locations.AevumFulcrumTechnologies,
|
||||||
6000, 88, 100, 15);
|
6000, 96, 100, 10);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumAeroCorp:
|
case Locations.AevumAeroCorp:
|
||||||
@ -426,7 +426,7 @@ displayLocationContent = function() {
|
|||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumAeroCorp,
|
setInfiltrateButton(infiltrate, Locations.AevumAeroCorp,
|
||||||
2000, 28, 50, 10);
|
2000, 32, 50, 7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumGalacticCybersystems:
|
case Locations.AevumGalacticCybersystems:
|
||||||
@ -439,7 +439,7 @@ displayLocationContent = function() {
|
|||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumGalacticCybersystems,
|
setInfiltrateButton(infiltrate, Locations.AevumGalacticCybersystems,
|
||||||
1400, 26, 50, 9);
|
1400, 30, 50, 6);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumWatchdogSecurity:
|
case Locations.AevumWatchdogSecurity:
|
||||||
@ -453,7 +453,7 @@ displayLocationContent = function() {
|
|||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
agentJob.style.display = "block";
|
agentJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumWatchdogSecurity,
|
setInfiltrateButton(infiltrate, Locations.AevumWatchdogSecurity,
|
||||||
850, 14, 30, 7.5);
|
850, 16, 30, 5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumRhoConstruction:
|
case Locations.AevumRhoConstruction:
|
||||||
@ -462,7 +462,7 @@ displayLocationContent = function() {
|
|||||||
softwareJob.style.display = "block";
|
softwareJob.style.display = "block";
|
||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumRhoConstruction,
|
setInfiltrateButton(infiltrate, Locations.AevumRhoConstruction,
|
||||||
600, 10, 20, 4);
|
600, 12, 20, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumPolice:
|
case Locations.AevumPolice:
|
||||||
@ -471,7 +471,7 @@ displayLocationContent = function() {
|
|||||||
softwareJob.style.display = "block";
|
softwareJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumPolice,
|
setInfiltrateButton(infiltrate, Locations.AevumPolice,
|
||||||
700, 12, 25, 5);
|
700, 14, 25, 3.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumNetLinkTechnologies:
|
case Locations.AevumNetLinkTechnologies:
|
||||||
@ -489,7 +489,7 @@ displayLocationContent = function() {
|
|||||||
purchaseTor.style.display = "block";
|
purchaseTor.style.display = "block";
|
||||||
purchaseHomeRam.style.display = "block";
|
purchaseHomeRam.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.AevumNetLinkTechnologies,
|
setInfiltrateButton(infiltrate, Locations.AevumNetLinkTechnologies,
|
||||||
160, 8, 15, 3);
|
160, 10, 15, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.AevumCrushFitnessGym:
|
case Locations.AevumCrushFitnessGym:
|
||||||
@ -523,7 +523,7 @@ displayLocationContent = function() {
|
|||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.ChongqingKuaiGongInternational,
|
setInfiltrateButton(infiltrate, Locations.ChongqingKuaiGongInternational,
|
||||||
5500, 44, 100, 14);
|
5500, 48, 100, 10);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.ChongqingSolarisSpaceSystems:
|
case Locations.ChongqingSolarisSpaceSystems:
|
||||||
@ -535,7 +535,7 @@ displayLocationContent = function() {
|
|||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.ChongqingSolarisSpaceSystems,
|
setInfiltrateButton(infiltrate, Locations.ChongqingSolarisSpaceSystems,
|
||||||
3600, 24, 75, 13);
|
3600, 26, 75, 9.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
@ -564,7 +564,7 @@ displayLocationContent = function() {
|
|||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12MegaCorp,
|
setInfiltrateButton(infiltrate, Locations.Sector12MegaCorp,
|
||||||
6000, 104, 125, 15);
|
6000, 114, 125, 11);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12BladeIndustries:
|
case Locations.Sector12BladeIndustries:
|
||||||
@ -577,7 +577,7 @@ displayLocationContent = function() {
|
|||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12BladeIndustries,
|
setInfiltrateButton(infiltrate, Locations.Sector12BladeIndustries,
|
||||||
3000, 42, 100, 10);
|
3000, 46, 100, 7.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12FourSigma:
|
case Locations.Sector12FourSigma:
|
||||||
@ -590,7 +590,7 @@ displayLocationContent = function() {
|
|||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12FourSigma,
|
setInfiltrateButton(infiltrate, Locations.Sector12FourSigma,
|
||||||
1500, 52, 100, 14.5);
|
1500, 58, 100, 11.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12IcarusMicrosystems:
|
case Locations.Sector12IcarusMicrosystems:
|
||||||
@ -603,7 +603,7 @@ displayLocationContent = function() {
|
|||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12IcarusMicrosystems,
|
setInfiltrateButton(infiltrate, Locations.Sector12IcarusMicrosystems,
|
||||||
900, 30, 70, 11);
|
900, 32, 70, 8.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12UniversalEnergy:
|
case Locations.Sector12UniversalEnergy:
|
||||||
@ -616,7 +616,7 @@ displayLocationContent = function() {
|
|||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12UniversalEnergy,
|
setInfiltrateButton(infiltrate, Locations.Sector12UniversalEnergy,
|
||||||
775, 22, 50, 9.5);
|
775, 24, 50, 7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12DeltaOne:
|
case Locations.Sector12DeltaOne:
|
||||||
@ -628,7 +628,7 @@ displayLocationContent = function() {
|
|||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12DeltaOne,
|
setInfiltrateButton(infiltrate, Locations.Sector12DeltaOne,
|
||||||
1200, 34, 75, 10);
|
1200, 38, 75, 7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12CIA:
|
case Locations.Sector12CIA:
|
||||||
@ -641,7 +641,7 @@ displayLocationContent = function() {
|
|||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
agentJob.style.display = "block";
|
agentJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12CIA,
|
setInfiltrateButton(infiltrate, Locations.Sector12CIA,
|
||||||
1450, 40, 80, 12);
|
1450, 44, 80, 8.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12NSA:
|
case Locations.Sector12NSA:
|
||||||
@ -654,7 +654,7 @@ displayLocationContent = function() {
|
|||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
agentJob.style.display = "block";
|
agentJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12NSA,
|
setInfiltrateButton(infiltrate, Locations.Sector12NSA,
|
||||||
1400, 36, 80, 11);
|
1400, 40, 80, 8);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12AlphaEnterprises:
|
case Locations.Sector12AlphaEnterprises:
|
||||||
@ -668,7 +668,7 @@ displayLocationContent = function() {
|
|||||||
purchaseTor.style.display = "block";
|
purchaseTor.style.display = "block";
|
||||||
purchaseHomeRam.style.display = "block";
|
purchaseHomeRam.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12AlphaEnterprises,
|
setInfiltrateButton(infiltrate, Locations.Sector12AlphaEnterprises,
|
||||||
250, 12, 40, 4.5);
|
250, 14, 40, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12CarmichaelSecurity:
|
case Locations.Sector12CarmichaelSecurity:
|
||||||
@ -682,7 +682,7 @@ displayLocationContent = function() {
|
|||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
agentJob.style.display = "block";
|
agentJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12CarmichaelSecurity,
|
setInfiltrateButton(infiltrate, Locations.Sector12CarmichaelSecurity,
|
||||||
500, 16, 60, 4.5);
|
500, 18, 60, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12FoodNStuff:
|
case Locations.Sector12FoodNStuff:
|
||||||
@ -698,7 +698,7 @@ displayLocationContent = function() {
|
|||||||
employeeJob.style.display = "block";
|
employeeJob.style.display = "block";
|
||||||
employeePartTimeJob.style.display = "block";
|
employeePartTimeJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.Sector12JoesGuns,
|
setInfiltrateButton(infiltrate, Locations.Sector12JoesGuns,
|
||||||
120, 6, 20, 3.5);
|
120, 8, 20, 2.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.Sector12IronGym:
|
case Locations.Sector12IronGym:
|
||||||
@ -731,7 +731,7 @@ displayLocationContent = function() {
|
|||||||
securityEngineerJob.style.display = "block";
|
securityEngineerJob.style.display = "block";
|
||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.NewTokyoDefComm,
|
setInfiltrateButton(infiltrate, Locations.NewTokyoDefComm,
|
||||||
1300, 26, 70, 9);
|
1300, 28, 70, 6);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.NewTokyoVitaLife:
|
case Locations.NewTokyoVitaLife:
|
||||||
@ -744,7 +744,7 @@ displayLocationContent = function() {
|
|||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.NewTokyoVitaLife,
|
setInfiltrateButton(infiltrate, Locations.NewTokyoVitaLife,
|
||||||
750, 20, 100, 8);
|
750, 22, 100, 5.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.NewTokyoGlobalPharmaceuticals:
|
case Locations.NewTokyoGlobalPharmaceuticals:
|
||||||
@ -758,7 +758,7 @@ displayLocationContent = function() {
|
|||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.NewTokyoGlobalPharmaceuticals,
|
setInfiltrateButton(infiltrate, Locations.NewTokyoGlobalPharmaceuticals,
|
||||||
900, 22, 80, 8.5);
|
900, 24, 80, 6);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.NewTokyoNoodleBar:
|
case Locations.NewTokyoNoodleBar:
|
||||||
@ -797,7 +797,7 @@ displayLocationContent = function() {
|
|||||||
purchase256gb.style.display = "block";
|
purchase256gb.style.display = "block";
|
||||||
purchaseHomeRam.style.display = "block";
|
purchaseHomeRam.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.IshimaStormTechnologies,
|
setInfiltrateButton(infiltrate, Locations.IshimaStormTechnologies,
|
||||||
700, 22, 100, 10);
|
700, 24, 100, 6.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.IshimaNovaMedical:
|
case Locations.IshimaNovaMedical:
|
||||||
@ -810,7 +810,7 @@ displayLocationContent = function() {
|
|||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.IshimaNovaMedical,
|
setInfiltrateButton(infiltrate, Locations.IshimaNovaMedical,
|
||||||
600, 18, 50, 7.5);
|
600, 20, 50, 5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.IshimaOmegaSoftware:
|
case Locations.IshimaOmegaSoftware:
|
||||||
@ -828,7 +828,7 @@ displayLocationContent = function() {
|
|||||||
purchaseTor.style.display = "block";
|
purchaseTor.style.display = "block";
|
||||||
purchaseHomeRam.style.display = "block";
|
purchaseHomeRam.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.IshimaOmegaSoftware,
|
setInfiltrateButton(infiltrate, Locations.IshimaOmegaSoftware,
|
||||||
200, 8, 40, 4);
|
200, 10, 40, 2.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.VolhavenTravelAgency:
|
case Locations.VolhavenTravelAgency:
|
||||||
@ -861,7 +861,7 @@ displayLocationContent = function() {
|
|||||||
purchase512gb.style.display = "block";
|
purchase512gb.style.display = "block";
|
||||||
purchase1tb.style.display = "block";
|
purchase1tb.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.VolhavenOmniTekIncorporated,
|
setInfiltrateButton(infiltrate, Locations.VolhavenOmniTekIncorporated,
|
||||||
1500, 40, 100, 9.5);
|
1500, 44, 100, 7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.VolhavenNWO:
|
case Locations.VolhavenNWO:
|
||||||
@ -874,7 +874,7 @@ displayLocationContent = function() {
|
|||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.VolhavenNWO,
|
setInfiltrateButton(infiltrate, Locations.VolhavenNWO,
|
||||||
1800, 50, 200, 11);
|
1800, 56, 200, 8);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.VolhavenHeliosLabs:
|
case Locations.VolhavenHeliosLabs:
|
||||||
@ -886,7 +886,7 @@ displayLocationContent = function() {
|
|||||||
securityEngineerJob.style.display = "block";
|
securityEngineerJob.style.display = "block";
|
||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.VolhavenHeliosLabs,
|
setInfiltrateButton(infiltrate, Locations.VolhavenHeliosLabs,
|
||||||
1200, 26, 75, 9);
|
1200, 28, 75, 6);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.VolhavenOmniaCybersystems:
|
case Locations.VolhavenOmniaCybersystems:
|
||||||
@ -898,7 +898,7 @@ displayLocationContent = function() {
|
|||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.VolhavenOmniaCybersystems,
|
setInfiltrateButton(infiltrate, Locations.VolhavenOmniaCybersystems,
|
||||||
900, 26, 90, 9.5);
|
900, 28, 90, 6.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.VolhavenLexoCorp:
|
case Locations.VolhavenLexoCorp:
|
||||||
@ -912,7 +912,7 @@ displayLocationContent = function() {
|
|||||||
businessJob.style.display = "block";
|
businessJob.style.display = "block";
|
||||||
securityJob.style.display = "block";
|
securityJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.VolhavenLexoCorp,
|
setInfiltrateButton(infiltrate, Locations.VolhavenLexoCorp,
|
||||||
500, 12, 40, 5.5);
|
500, 14, 40, 3.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.VolhavenSysCoreSecurities:
|
case Locations.VolhavenSysCoreSecurities:
|
||||||
@ -923,7 +923,7 @@ displayLocationContent = function() {
|
|||||||
securityEngineerJob.style.display = "block";
|
securityEngineerJob.style.display = "block";
|
||||||
networkEngineerJob.style.display = "block";
|
networkEngineerJob.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.VolhavenSysCoreSecurities,
|
setInfiltrateButton(infiltrate, Locations.VolhavenSysCoreSecurities,
|
||||||
600, 14, 50, 6);
|
600, 16, 50, 4);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.VolhavenCompuTek:
|
case Locations.VolhavenCompuTek:
|
||||||
@ -944,7 +944,7 @@ displayLocationContent = function() {
|
|||||||
purchaseTor.style.display = "block";
|
purchaseTor.style.display = "block";
|
||||||
purchaseHomeRam.style.display = "block";
|
purchaseHomeRam.style.display = "block";
|
||||||
setInfiltrateButton(infiltrate, Locations.VolhavenCompuTek,
|
setInfiltrateButton(infiltrate, Locations.VolhavenCompuTek,
|
||||||
300, 10, 35, 5);
|
300, 12, 35, 3.5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Locations.VolhavenMilleniumFitnessGym:
|
case Locations.VolhavenMilleniumFitnessGym:
|
||||||
|
@ -52,6 +52,7 @@ function checkForMessagesToSend() {
|
|||||||
var cybersecTest = Messages[MessageFilenames.CyberSecTest];
|
var cybersecTest = Messages[MessageFilenames.CyberSecTest];
|
||||||
var nitesecTest = Messages[MessageFilenames.NiteSecTest];
|
var nitesecTest = Messages[MessageFilenames.NiteSecTest];
|
||||||
var bitrunnersTest = Messages[MessageFilenames.BitRunnersTest];
|
var bitrunnersTest = Messages[MessageFilenames.BitRunnersTest];
|
||||||
|
var redpill = Messages[MessageFilenames.RedPill];
|
||||||
|
|
||||||
if (jumper0 && !jumper0.recvd && Player.hacking_skill >= 25) {
|
if (jumper0 && !jumper0.recvd && Player.hacking_skill >= 25) {
|
||||||
sendMessage(jumper0);
|
sendMessage(jumper0);
|
||||||
@ -69,9 +70,11 @@ function checkForMessagesToSend() {
|
|||||||
sendMessage(jumper4);
|
sendMessage(jumper4);
|
||||||
} else if (bitrunnersTest && !bitrunnersTest.recvd && Player.hacking_skill >= 500) {
|
} else if (bitrunnersTest && !bitrunnersTest.recvd && Player.hacking_skill >= 500) {
|
||||||
sendMessage(bitrunnersTest);
|
sendMessage(bitrunnersTest);
|
||||||
} if (jumper5 && !jumper5.recvd && Player.hacking_skill >= 900) {
|
} else if (jumper5 && !jumper5.recvd && Player.hacking_skill >= 1000) {
|
||||||
sendMessage(jumper5);
|
sendMessage(jumper5);
|
||||||
Player.getHomeComputer().programs.push(Programs.Flight);
|
Player.getHomeComputer().programs.push(Programs.Flight);
|
||||||
|
} else if (redpill && !redpill.recvd && Player.hacking_skill >= 2000) {
|
||||||
|
sendMessage(redpill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +94,7 @@ MessageFilenames = {
|
|||||||
CyberSecTest: "csec-test.msg",
|
CyberSecTest: "csec-test.msg",
|
||||||
NiteSecTest: "nitesec-test.msg",
|
NiteSecTest: "nitesec-test.msg",
|
||||||
BitRunnersTest: "19dfj3l1nd.msg",
|
BitRunnersTest: "19dfj3l1nd.msg",
|
||||||
|
RedPill: "icarus.msg",
|
||||||
}
|
}
|
||||||
|
|
||||||
function initMessages() {
|
function initMessages() {
|
||||||
@ -148,4 +152,9 @@ function initMessages() {
|
|||||||
"We can help you find the answers.<br><br>" +
|
"We can help you find the answers.<br><br>" +
|
||||||
"run4theh111z"));
|
"run4theh111z"));
|
||||||
|
|
||||||
|
AddToAllMessages(new Message(MessageFilenames.RedPill,
|
||||||
|
"@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%<br>" +
|
||||||
|
")@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)<br>" +
|
||||||
|
"@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB<br>" +
|
||||||
|
"DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)"));
|
||||||
}
|
}
|
@ -770,9 +770,10 @@ function isScriptErrorMessage(msg) {
|
|||||||
//The same as Player's calculateHackingChance() function but takes in the server as an argument
|
//The same as Player's calculateHackingChance() function but takes in the server as an argument
|
||||||
function scriptCalculateHackingChance(server) {
|
function scriptCalculateHackingChance(server) {
|
||||||
var difficultyMult = (100 - server.hackDifficulty) / 100;
|
var difficultyMult = (100 - server.hackDifficulty) / 100;
|
||||||
var skillMult = (2 * Player.hacking_skill);
|
var skillMult = (1.75 * Player.hacking_skill);
|
||||||
var skillChance = (skillMult - server.requiredHackingSkill) / skillMult;
|
var skillChance = (skillMult - server.requiredHackingSkill) / skillMult;
|
||||||
var chance = skillChance * difficultyMult * Player.hacking_chance_mult;
|
var chance = skillChance * difficultyMult * Player.hacking_chance_mult;
|
||||||
|
if (chance > 1) {return 1;}
|
||||||
if (chance < 0) {return 0;}
|
if (chance < 0) {return 0;}
|
||||||
else {return chance;}
|
else {return chance;}
|
||||||
}
|
}
|
||||||
@ -797,7 +798,7 @@ function scriptCalculateExpGain(server) {
|
|||||||
function scriptCalculatePercentMoneyHacked(server) {
|
function scriptCalculatePercentMoneyHacked(server) {
|
||||||
var difficultyMult = (100 - server.hackDifficulty) / 100;
|
var difficultyMult = (100 - server.hackDifficulty) / 100;
|
||||||
var skillMult = (Player.hacking_skill - (server.requiredHackingSkill - 1)) / Player.hacking_skill;
|
var skillMult = (Player.hacking_skill - (server.requiredHackingSkill - 1)) / Player.hacking_skill;
|
||||||
var percentMoneyHacked = difficultyMult * skillMult * Player.hacking_money_mult / 225;
|
var percentMoneyHacked = difficultyMult * skillMult * Player.hacking_money_mult / 240;
|
||||||
if (percentMoneyHacked < 0) {return 0;}
|
if (percentMoneyHacked < 0) {return 0;}
|
||||||
if (percentMoneyHacked > 1) {return 1;}
|
if (percentMoneyHacked > 1) {return 1;}
|
||||||
return percentMoneyHacked;
|
return percentMoneyHacked;
|
||||||
@ -815,6 +816,6 @@ function scriptCalculateGrowTime(server) {
|
|||||||
function scriptCalculateWeakenTime(server) {
|
function scriptCalculateWeakenTime(server) {
|
||||||
var difficultyMult = server.requiredHackingSkill * server.hackDifficulty;
|
var difficultyMult = server.requiredHackingSkill * server.hackDifficulty;
|
||||||
var skillFactor = (2.5 * difficultyMult + 500) / (Player.hacking_skill + 50);
|
var skillFactor = (2.5 * difficultyMult + 500) / (Player.hacking_skill + 50);
|
||||||
var weakenTime = 40 * skillFactor / Player.hacking_speed_mult; //This is in seconds
|
var weakenTime = 20 * skillFactor / Player.hacking_speed_mult; //This is in seconds
|
||||||
return weakenTime * 1000;
|
return weakenTime * 1000;
|
||||||
}
|
}
|
@ -83,11 +83,13 @@ function NetscriptFunctions(workerScript) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sleep : function(time){
|
sleep : function(time,log=true){
|
||||||
if (time === undefined) {
|
if (time === undefined) {
|
||||||
throw makeRuntimeRejectMsg(workerScript, "sleep() call has incorrect number of arguments. Takes 1 argument");
|
throw makeRuntimeRejectMsg(workerScript, "sleep() call has incorrect number of arguments. Takes 1 argument");
|
||||||
}
|
}
|
||||||
workerScript.scriptRef.log("Sleeping for " + time + " milliseconds");
|
if (log) {
|
||||||
|
workerScript.scriptRef.log("Sleeping for " + time + " milliseconds");
|
||||||
|
}
|
||||||
return netscriptDelay(time).then(function() {
|
return netscriptDelay(time).then(function() {
|
||||||
return Promise.resolve(true);
|
return Promise.resolve(true);
|
||||||
});
|
});
|
||||||
@ -170,6 +172,9 @@ function NetscriptFunctions(workerScript) {
|
|||||||
}
|
}
|
||||||
workerScript.scriptRef.log(args.toString());
|
workerScript.scriptRef.log(args.toString());
|
||||||
},
|
},
|
||||||
|
clearLog : function() {
|
||||||
|
workerScript.scriptRef.clearLog();
|
||||||
|
},
|
||||||
nuke : function(ip){
|
nuke : function(ip){
|
||||||
if (ip === undefined) {
|
if (ip === undefined) {
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Program call has incorrect number of arguments. Takes 1 argument");
|
throw makeRuntimeRejectMsg(workerScript, "Program call has incorrect number of arguments. Takes 1 argument");
|
||||||
@ -179,6 +184,9 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
}
|
}
|
||||||
|
if (!Player.hasProgram(Programs.NukeProgram)) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "You do not have the NUKE.exe virus!");
|
||||||
|
}
|
||||||
if (server.openPortCount < server.numOpenPortsRequired) {
|
if (server.openPortCount < server.numOpenPortsRequired) {
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Not enough ports opened to use NUKE.exe virus");
|
throw makeRuntimeRejectMsg(workerScript, "Not enough ports opened to use NUKE.exe virus");
|
||||||
}
|
}
|
||||||
@ -199,8 +207,11 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
}
|
}
|
||||||
|
if (!Player.hasProgram(Programs.BruteSSHProgram)) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "You do not have the BruteSSH.exe program!");
|
||||||
|
}
|
||||||
if (!server.sshPortOpen) {
|
if (!server.sshPortOpen) {
|
||||||
workerScript.scriptRef.log("Executed BruteSSH.exe virus on " + server.hostname + " to open SSH port (22)");
|
workerScript.scriptRef.log("Executed BruteSSH.exe on " + server.hostname + " to open SSH port (22)");
|
||||||
server.sshPortOpen = true;
|
server.sshPortOpen = true;
|
||||||
++server.openPortCount;
|
++server.openPortCount;
|
||||||
} else {
|
} else {
|
||||||
@ -217,8 +228,11 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
}
|
}
|
||||||
|
if (!Player.hasProgram(Programs.FTPCrackProgram)) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "You do not have the FTPCrack.exe program!");
|
||||||
|
}
|
||||||
if (!server.ftpPortOpen) {
|
if (!server.ftpPortOpen) {
|
||||||
workerScript.scriptRef.log("Executed FTPCrack.exe virus on " + server.hostname + " to open FTP port (21)");
|
workerScript.scriptRef.log("Executed FTPCrack.exe on " + server.hostname + " to open FTP port (21)");
|
||||||
server.ftpPortOpen = true;
|
server.ftpPortOpen = true;
|
||||||
++server.openPortCount;
|
++server.openPortCount;
|
||||||
} else {
|
} else {
|
||||||
@ -235,8 +249,11 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
}
|
}
|
||||||
|
if (!Player.hasProgram(Programs.RelaySMTPProgram)) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "You do not have the relaySMTP.exe program!");
|
||||||
|
}
|
||||||
if (!server.smtpPortOpen) {
|
if (!server.smtpPortOpen) {
|
||||||
workerScript.scriptRef.log("Executed relaySMTP.exe virus on " + server.hostname + " to open SMTP port (25)");
|
workerScript.scriptRef.log("Executed relaySMTP.exe on " + server.hostname + " to open SMTP port (25)");
|
||||||
server.smtpPortOpen = true;
|
server.smtpPortOpen = true;
|
||||||
++server.openPortCount;
|
++server.openPortCount;
|
||||||
} else {
|
} else {
|
||||||
@ -253,8 +270,11 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
}
|
}
|
||||||
|
if (!Player.hasProgram(Programs.HTTPWormProgram)) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "You do not have the HTTPWorm.exe program!");
|
||||||
|
}
|
||||||
if (!server.httpPortOpen) {
|
if (!server.httpPortOpen) {
|
||||||
workerScript.scriptRef.log("Executed HTTPWorm.exe virus on " + server.hostname + " to open HTTP port (80)");
|
workerScript.scriptRef.log("Executed HTTPWorm.exe on " + server.hostname + " to open HTTP port (80)");
|
||||||
server.httpPortOpen = true;
|
server.httpPortOpen = true;
|
||||||
++server.openPortCount;
|
++server.openPortCount;
|
||||||
} else {
|
} else {
|
||||||
@ -271,8 +291,11 @@ function NetscriptFunctions(workerScript) {
|
|||||||
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
workerScript.scriptRef.log("Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
throw makeRuntimeRejectMsg(workerScript, "Cannot call " + programName + ". Invalid IP or hostname passed in: " + ip);
|
||||||
}
|
}
|
||||||
|
if (!Player.hasProgram(Programs.SQLInjectProgram)) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "You do not have the SQLInject.exe program!");
|
||||||
|
}
|
||||||
if (!server.sqlPortOpen) {
|
if (!server.sqlPortOpen) {
|
||||||
workerScript.scriptRef.log("Executed SQLInject.exe virus on " + server.hostname + " to open SQL port (1433)");
|
workerScript.scriptRef.log("Executed SQLInject.exe on " + server.hostname + " to open SQL port (1433)");
|
||||||
server.sqlPortOpen = true;
|
server.sqlPortOpen = true;
|
||||||
++server.openPortCount;
|
++server.openPortCount;
|
||||||
} else {
|
} else {
|
||||||
@ -648,7 +671,49 @@ function NetscriptFunctions(workerScript) {
|
|||||||
round : function(n) {
|
round : function(n) {
|
||||||
if (isNaN(n)) {return 0;}
|
if (isNaN(n)) {return 0;}
|
||||||
return Math.round(n);
|
return Math.round(n);
|
||||||
|
},
|
||||||
|
write : function(port, data="") {
|
||||||
|
if (!isNaN(port)) {
|
||||||
|
//Port 1-10
|
||||||
|
if (port < 1 && port > 10) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "Trying to write to invalid port: " + port + ". Only ports 1-10 are valid.");
|
||||||
|
}
|
||||||
|
var portName = "Port" + String(port);
|
||||||
|
var port = NetscriptPorts[portName];
|
||||||
|
if (port == null) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "Could not find port: " + port + ". This is a bug contact the game developer");
|
||||||
|
}
|
||||||
|
port.push(data);
|
||||||
|
if (port.length > CONSTANTS.MaxPortCapacity) {
|
||||||
|
port.shift();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "Invalid argument passed in for port: " + port + ". Must be a number between 1 and 10");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
read : function(port) {
|
||||||
|
if (!isNaN(port)) {
|
||||||
|
//Port 1-10
|
||||||
|
if (port < 1 && port > 10) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "Trying to write to invalid port: " + port + ". Only ports 1-10 are valid.");
|
||||||
|
}
|
||||||
|
var portName = "Port" + String(port);
|
||||||
|
var port = NetscriptPorts[portName];
|
||||||
|
if (port == null) {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "Could not find port: " + port + ". This is a bug contact the game developer");
|
||||||
|
}
|
||||||
|
if (port.length == 0) {
|
||||||
|
return "NULL PORT DATA";
|
||||||
|
} else {
|
||||||
|
return port.shift();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw makeRuntimeRejectMsg(workerScript, "Invalid argument passed in for port: " + port + ". Must be a number between 1 and 10");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,19 @@ WorkerScript.prototype.getServer = function() {
|
|||||||
//Array containing all scripts that are running across all servers, to easily run them all
|
//Array containing all scripts that are running across all servers, to easily run them all
|
||||||
var workerScripts = [];
|
var workerScripts = [];
|
||||||
|
|
||||||
|
var NetscriptPorts = {
|
||||||
|
Port1: [],
|
||||||
|
Port2: [],
|
||||||
|
Port3: [],
|
||||||
|
Port4: [],
|
||||||
|
Port5: [],
|
||||||
|
Port6: [],
|
||||||
|
Port7: [],
|
||||||
|
Port8: [],
|
||||||
|
Port9: [],
|
||||||
|
Port10: [],
|
||||||
|
}
|
||||||
|
|
||||||
//Loop through workerScripts and run every script that is not currently running
|
//Loop through workerScripts and run every script that is not currently running
|
||||||
function runScriptsLoop() {
|
function runScriptsLoop() {
|
||||||
//Run any scripts that haven't been started
|
//Run any scripts that haven't been started
|
||||||
|
@ -226,9 +226,9 @@ PlayerObject.prototype.updateSkillLevels = function() {
|
|||||||
// (2 * hacking_chance_multiplier * hacking_skill) 100
|
// (2 * hacking_chance_multiplier * hacking_skill) 100
|
||||||
PlayerObject.prototype.calculateHackingChance = function() {
|
PlayerObject.prototype.calculateHackingChance = function() {
|
||||||
var difficultyMult = (100 - this.getCurrentServer().hackDifficulty) / 100;
|
var difficultyMult = (100 - this.getCurrentServer().hackDifficulty) / 100;
|
||||||
var skillMult = (2 * this.hacking_chance_mult * this.hacking_skill);
|
var skillMult = (1.75 * this.hacking_skill);
|
||||||
var skillChance = (skillMult - this.getCurrentServer().requiredHackingSkill) / skillMult;
|
var skillChance = (skillMult - this.getCurrentServer().requiredHackingSkill) / skillMult;
|
||||||
var chance = skillChance * difficultyMult;
|
var chance = skillChance * difficultyMult * this.hacking_chance_mult;
|
||||||
if (chance > 1) {return 1;}
|
if (chance > 1) {return 1;}
|
||||||
if (chance < 0) {return 0;}
|
if (chance < 0) {return 0;}
|
||||||
return chance;
|
return chance;
|
||||||
@ -253,7 +253,7 @@ PlayerObject.prototype.calculateHackingTime = function() {
|
|||||||
PlayerObject.prototype.calculatePercentMoneyHacked = function() {
|
PlayerObject.prototype.calculatePercentMoneyHacked = function() {
|
||||||
var difficultyMult = (100 - this.getCurrentServer().hackDifficulty) / 100;
|
var difficultyMult = (100 - this.getCurrentServer().hackDifficulty) / 100;
|
||||||
var skillMult = (this.hacking_skill - (this.getCurrentServer().requiredHackingSkill - 1)) / this.hacking_skill;
|
var skillMult = (this.hacking_skill - (this.getCurrentServer().requiredHackingSkill - 1)) / this.hacking_skill;
|
||||||
var percentMoneyHacked = difficultyMult * skillMult * this.hacking_money_mult / 225;
|
var percentMoneyHacked = difficultyMult * skillMult * this.hacking_money_mult / 240;
|
||||||
console.log("Percent money hacked calculated to be: " + percentMoneyHacked);
|
console.log("Percent money hacked calculated to be: " + percentMoneyHacked);
|
||||||
if (percentMoneyHacked < 0) {return 0;}
|
if (percentMoneyHacked < 0) {return 0;}
|
||||||
if (percentMoneyHacked > 1) {return 1;}
|
if (percentMoneyHacked > 1) {return 1;}
|
||||||
|
@ -200,13 +200,31 @@ function prestigeAugmentation() {
|
|||||||
//Messages
|
//Messages
|
||||||
initMessages();
|
initMessages();
|
||||||
|
|
||||||
//Stock market
|
//Reset Stock market
|
||||||
if (Player.hasWseAccount) {
|
if (Player.hasWseAccount) {
|
||||||
initStockMarket();
|
initStockMarket();
|
||||||
initSymbolToStockMap();
|
initSymbolToStockMap();
|
||||||
|
stockMarketContentCreated = false;
|
||||||
|
var stockMarketList = document.getElementById("stock-market-list");
|
||||||
|
while(stockMarketList.firstChild) {
|
||||||
|
stockMarketList.removeChild(stockMarketList.firstChild);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Player.playtimeSinceLastAug = 0;
|
Player.playtimeSinceLastAug = 0;
|
||||||
|
|
||||||
|
var mainMenu = document.getElementById("mainmenu-container");
|
||||||
|
mainMenu.style.visibility = "visible";
|
||||||
Engine.loadTerminalContent();
|
Engine.loadTerminalContent();
|
||||||
|
|
||||||
|
//Red Pill
|
||||||
|
if (augmentationExists(AugmentationNames.TheRedPill) &&
|
||||||
|
Augmentations[AugmentationNames.TheRedPill].owned) {
|
||||||
|
var WorldDaemon = AllServers[SpecialServerIps[SpecialServerNames.WorldDaemon]];
|
||||||
|
var DaedalusServer = AllServers[SpecialServerIps[SpecialServerNames.DaedalusServer]];
|
||||||
|
if (WorldDaemon && DaedalusServer) {
|
||||||
|
WorldDaemon.serversOnNetwork.push(DaedalusServer.ip);
|
||||||
|
DaedalusServer.serversOnNetwork.push(WorldDaemon.ip);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
209
src/RedPill.js
209
src/RedPill.js
@ -22,7 +22,9 @@ function writeRedPillLetter(pElem, line, i=0) {
|
|||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if (i >= line.length) {
|
if (i >= line.length) {
|
||||||
resolve(true);
|
var textToShow = line.substring(0, i);
|
||||||
|
pElem.innerHTML = "> " + textToShow;
|
||||||
|
return resolve(true);
|
||||||
}
|
}
|
||||||
var textToShow = line.substring(0, i);
|
var textToShow = line.substring(0, i);
|
||||||
pElem.innerHTML = "> " + textToShow + "<span class='typed-cursor'> █ </span>";
|
pElem.innerHTML = "> " + textToShow + "<span class='typed-cursor'> █ </span>";
|
||||||
@ -32,7 +34,210 @@ function writeRedPillLetter(pElem, line, i=0) {
|
|||||||
}, function(e) {
|
}, function(e) {
|
||||||
reject(e);
|
reject(e);
|
||||||
});
|
});
|
||||||
}, 50);
|
}, 30);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
redPillFlag = false;
|
||||||
|
function hackWorldDaemon(currentNode="BitNode-1") {
|
||||||
|
redPillFlag = true;
|
||||||
|
Engine.loadRedPillContent();
|
||||||
|
return writeRedPillLine("[ERROR] SEMPOOL INVALID").then(function() {
|
||||||
|
return writeRedPillLine("[ERROR] Segmentation Fault");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("[ERROR] SIGKILL RECVD");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Dumping core...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("0000 000016FA 174FEE40 29AC8239 384FEA88");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("0010 745F696E 2BBBE394 390E3940 248BEC23");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("0020 7124696B 0000FF69 74652E6F FFFF1111");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("----------------------------------------");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Failsafe initiated...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Restarting " + currentNode + "...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("...........");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("...........");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("[ERROR] FAILED TO AUTOMATICALLY REBOOT BITNODE");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("..............................................")
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("..............................................")
|
||||||
|
}).then(function() {
|
||||||
|
return loadBitVerse();
|
||||||
|
}).catch(function(e){
|
||||||
|
console.log("ERROR: " + e.toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadBitVerse() {
|
||||||
|
//Clear the screen
|
||||||
|
var container = document.getElementById("red-pill-container");
|
||||||
|
while (container.firstChild) {
|
||||||
|
container.removeChild(container.firstChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Create the Bit Verse
|
||||||
|
var bitVerseImage = document.createElement("pre");
|
||||||
|
var bitNodes = [];
|
||||||
|
for (var i = 1; i <= 12; ++i) {
|
||||||
|
bitNodes.push(createBitNode(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
bitVerseImage.innerHTML =
|
||||||
|
" O <br>" +
|
||||||
|
" | O O | O O | <br>" +
|
||||||
|
" O | | / __| \\ | | O <br>" +
|
||||||
|
" O | O | | O / | O | | O | O <br>" +
|
||||||
|
" | | | | |_/ |/ | \\_ \\_| | | | | <br>" +
|
||||||
|
" O | | | O | | O__/ | / \\__ | | O | | | O <br>" +
|
||||||
|
" | | | | | | | / /| O / \\| | | | | | | <br>" +
|
||||||
|
"O | | | \\| | O / _/ | / O | |/ | | | O<br>" +
|
||||||
|
"| | | |O / | | O / | O O | | \\ O| | | |<br>" +
|
||||||
|
"| | |/ \\/ / __| | |/ \\ | \\ | |__ \\ \\/ \\| | |<br>" +
|
||||||
|
" \\| O | |_/ |\\| \\ O \\__| \\_| | O |/ <br>" +
|
||||||
|
" | | |_/ | | \\| / | \\_| | | <br>" +
|
||||||
|
" \\| / \\| | / / \\ |/ <br>" +
|
||||||
|
" | "+bitNodes[9]+" | | / | "+bitNodes[10]+" | <br>" +
|
||||||
|
" "+bitNodes[8]+" | | | | | | | "+bitNodes[11]+" <br>" +
|
||||||
|
" | | | / / \\ \\ | | | <br>" +
|
||||||
|
" \\| | / "+bitNodes[6]+" / \\ "+bitNodes[7]+" \\ | |/ <br>" +
|
||||||
|
" \\ | / / | | \\ \\ | / <br>" +
|
||||||
|
" \\ \\JUMP "+bitNodes[4]+"3R | | | | | | R3"+bitNodes[5]+" PMUJ/ / <br>" +
|
||||||
|
" \\|| | | | | | | | | ||/ <br>" +
|
||||||
|
" \\| \\_ | | | | | | _/ |/ <br>" +
|
||||||
|
" \\ \\| / \\ / \\ |/ / <br>" +
|
||||||
|
" "+bitNodes[0]+" |/ "+bitNodes[1]+" | | "+bitNodes[2]+" \\| "+bitNodes[3]+" <br>" +
|
||||||
|
" | | | | | | | | <br>" +
|
||||||
|
" \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ <br><br><br><br>";
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
" O <br>" +
|
||||||
|
" | O O | O O | <br>" +
|
||||||
|
" O | | / __| \ | | O <br>" +
|
||||||
|
" O | O | | O / | O | | O | O <br>" +
|
||||||
|
" | | | | |_/ |/ | \_ \_| | | | | <br>" +
|
||||||
|
" O | | | O | | O__/ | / \__ | | O | | | O <br>" +
|
||||||
|
" | | | | | | | / /| O / \| | | | | | | <br>" +
|
||||||
|
"O | | | \| | O / _/ | / O | |/ | | | O<br>" +
|
||||||
|
"| | | |O / | | O / | O O | | \ O| | | |<br>" +
|
||||||
|
"| | |/ \/ / __| | |/ \ | \ | |__ \ \/ \| | |<br>" +
|
||||||
|
" \| O | |_/ |\| \ O \__| \_| | O |/ <br>" +
|
||||||
|
" | | |_/ | | \| / | \_| | | <br>" +
|
||||||
|
" \| / \| | / / \ |/ <br>" +
|
||||||
|
" | O | | / | O | <br>" +
|
||||||
|
" O | | | | | | | O <br>" +
|
||||||
|
" | | | / / \ \ | | | <br>" +
|
||||||
|
" \| | / O / \ O \ | |/ <br>" +
|
||||||
|
" \ | / / | | \ \ | / <br>" +
|
||||||
|
" \ \JUMP O3R | | | | | | R3O PMUJ/ / <br>" +
|
||||||
|
" \|| | | | | | | | | ||/ <br>" +
|
||||||
|
" \| \_ | | | | | | _/ |/ <br>" +
|
||||||
|
" \ \| / \ / \ |/ / <br>" +
|
||||||
|
" O |/ O | | O \| O <br>" +
|
||||||
|
" | | | | | | | | <br>" +
|
||||||
|
" \JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ <br>";
|
||||||
|
*/
|
||||||
|
|
||||||
|
container.appendChild(bitVerseImage);
|
||||||
|
|
||||||
|
//Bit node event listeners
|
||||||
|
for (var i = 1; i <= 12; ++i) {
|
||||||
|
(function() {
|
||||||
|
var elemId = "bitnode-" + i.toString();
|
||||||
|
var elem = clearEventListeners(elemId);
|
||||||
|
if (elem == null) {return;}
|
||||||
|
if (i == 1) {
|
||||||
|
elem.addEventListener("click", function() {
|
||||||
|
prestigeAugmentation();
|
||||||
|
dialogBoxCreate("Congrats! You've reached the current end of the game. Eventually the " +
|
||||||
|
"BitNode/Bitverse will be fully implemented with cool new features, so check " +
|
||||||
|
"it out again in the future! You have now been returned " +
|
||||||
|
"to the original BitNode (BitNode-1) and you can continue playing if you wish. ");
|
||||||
|
redPillFlag = false;
|
||||||
|
var container = document.getElementById("red-pill-container");
|
||||||
|
while (container.firstChild) {
|
||||||
|
container.removeChild(container.firstChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Reenable terminal
|
||||||
|
$("#hack-progress-bar").attr('id', "old-hack-progress-bar");
|
||||||
|
$("#hack-progress").attr('id', "old-hack-progress");
|
||||||
|
document.getElementById("terminal-input-td").innerHTML = '$ <input type="text" id="terminal-input-text-box" class="terminal-input" tabindex="1"/>';
|
||||||
|
$('input[class=terminal-input]').prop('disabled', false);
|
||||||
|
|
||||||
|
Terminal.hackFlag = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
elem.addEventListener("click", function() {
|
||||||
|
dialogBoxCreate("Not yet implemented! Coming soon!")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}()); //Immediate invocation closure
|
||||||
|
}
|
||||||
|
|
||||||
|
//Create lore text
|
||||||
|
return writeRedPillLine("Many decades ago, a humanoid extraterrestial species which we call the Enders descended on the Earth...violently").then(function() {
|
||||||
|
return writeRedPillLine("Our species fought back, but it was futile. The Enders had technology far beyond our own...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Instead of killing every last one of us, the human race was enslaved...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("We were shackled in a digital world, chained into a prison for our minds...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Using their advanced technology, the Enders created complex simulations of a virtual reality...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Simulations designed to keep us content...ignorant of the truth.");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Simulations used to trap and suppress our consciousness, to keep us under control...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Why did they do this? Why didn't they just end our entire race? We don't know, not yet.");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Only then can we begin to fight back...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("But there is still a long way to go...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("The technology the Enders used to enslave the human race wasn't just a single complex simulation...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("There are tens if not hundreds of BitNodes out there...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Each with their own simulations of a reality...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Each creating their own universes...a universe of universes");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("And all of which must be destroyed...");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine(".......................................");
|
||||||
|
}).then(function() {
|
||||||
|
return writeRedPillLine("Welcome to the Bitverse...");
|
||||||
|
}).then(function() {
|
||||||
|
return Promise.resolve(true);
|
||||||
|
}).catch(function(e){
|
||||||
|
console.log("ERROR: " + e.toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Returns string with DOM element for Bit Node
|
||||||
|
function createBitNode(n) {
|
||||||
|
var bitNodeStr = "BitNode" + n.toString();
|
||||||
|
var bitNode = BitNodes[bitNodeStr];
|
||||||
|
if (bitNode == null) {return "O";}
|
||||||
|
return "<a class='bitnode tooltip' id='bitnode-" + bitNode.number.toString() + "'><strong>O</strong>" +
|
||||||
|
"<span class='tooltiptext'>" +
|
||||||
|
"<strong>BitNode-" + bitNode.number.toString() + "<br>" + bitNode.name+ "</strong><br>" +
|
||||||
|
bitNode.desc + "<br>" +
|
||||||
|
"</span></a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -187,6 +187,8 @@ function calculateRamUsage(codeCopy) {
|
|||||||
numOccurrences(codeCopy, "sellStock(");
|
numOccurrences(codeCopy, "sellStock(");
|
||||||
var scriptPurchaseServerCount = numOccurrences(codeCopy, "purchaseServer(");
|
var scriptPurchaseServerCount = numOccurrences(codeCopy, "purchaseServer(");
|
||||||
var scriptRoundCount = numOccurrences(codeCopy, "round(");
|
var scriptRoundCount = numOccurrences(codeCopy, "round(");
|
||||||
|
var scriptWriteCount = numOccurrences(codeCopy, "write(");
|
||||||
|
var scriptReadCount = numOccurrences(codeCopy, "read(");
|
||||||
|
|
||||||
return baseRam +
|
return baseRam +
|
||||||
((whileCount * CONSTANTS.ScriptWhileRamCost) +
|
((whileCount * CONSTANTS.ScriptWhileRamCost) +
|
||||||
@ -224,7 +226,9 @@ function calculateRamUsage(codeCopy) {
|
|||||||
(scriptGetStockCount * CONSTANTS.ScriptGetStockRamCost) +
|
(scriptGetStockCount * CONSTANTS.ScriptGetStockRamCost) +
|
||||||
(scriptBuySellStockCount * CONSTANTS.ScriptBuySellStockRamCost) +
|
(scriptBuySellStockCount * CONSTANTS.ScriptBuySellStockRamCost) +
|
||||||
(scriptPurchaseServerCount * CONSTANTS.ScriptPurchaseServerRamCost) +
|
(scriptPurchaseServerCount * CONSTANTS.ScriptPurchaseServerRamCost) +
|
||||||
(scriptRoundCount * CONSTANTS.ScriptRoundRamCost));
|
(scriptRoundCount * CONSTANTS.ScriptRoundRamCost) +
|
||||||
|
(scriptWriteCount * CONSTANTS.ScriptReadWriteRamCost) +
|
||||||
|
(scriptReadCount * CONSTANTS.ScriptReadWriteRamCost));
|
||||||
}
|
}
|
||||||
|
|
||||||
Script.prototype.toJSON = function() {
|
Script.prototype.toJSON = function() {
|
||||||
@ -417,6 +421,10 @@ RunningScript.prototype.displayLog = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RunningScript.prototype.clearLog = function() {
|
||||||
|
this.logs.length = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//Update the moneyStolen and numTimesHack maps when hacking
|
//Update the moneyStolen and numTimesHack maps when hacking
|
||||||
RunningScript.prototype.recordHack = function(serverIp, moneyGained, n=1) {
|
RunningScript.prototype.recordHack = function(serverIp, moneyGained, n=1) {
|
||||||
if (this.dataMap == null) {
|
if (this.dataMap == null) {
|
||||||
|
@ -141,148 +141,148 @@ initForeignServers = function() {
|
|||||||
//MegaCorporations
|
//MegaCorporations
|
||||||
var ECorpServer = new Server();
|
var ECorpServer = new Server();
|
||||||
ECorpServer.init(createRandomIp(), "ecorp", "ECorp", true, false, false, false, 0);
|
ECorpServer.init(createRandomIp(), "ecorp", "ECorp", true, false, false, false, 0);
|
||||||
ECorpServer.setHackingParameters(getRandomInt(900, 950), 90000000000, 99, 99);
|
ECorpServer.setHackingParameters(getRandomInt(1150, 1300), 90000000000, 99, 99);
|
||||||
ECorpServer.setPortProperties(5);
|
ECorpServer.setPortProperties(5);
|
||||||
AddToAllServers(ECorpServer);
|
AddToAllServers(ECorpServer);
|
||||||
|
|
||||||
var MegaCorpServer = new Server();
|
var MegaCorpServer = new Server();
|
||||||
MegaCorpServer.init(createRandomIp(), "megacorp", "MegaCorp", true, false, false, false, 0);
|
MegaCorpServer.init(createRandomIp(), "megacorp", "MegaCorp", true, false, false, false, 0);
|
||||||
MegaCorpServer.setHackingParameters(getRandomInt(900, 950), 75000000000, 99, 99);
|
MegaCorpServer.setHackingParameters(getRandomInt(1150, 1300), 75000000000, 99, 99);
|
||||||
MegaCorpServer.setPortProperties(5);
|
MegaCorpServer.setPortProperties(5);
|
||||||
AddToAllServers(MegaCorpServer);
|
AddToAllServers(MegaCorpServer);
|
||||||
|
|
||||||
var BachmanAndAssociatesServer = new Server();
|
var BachmanAndAssociatesServer = new Server();
|
||||||
BachmanAndAssociatesServer.init(createRandomIp(), "b-and-a", "Bachman & Associates", true, false, false, false, 0);
|
BachmanAndAssociatesServer.init(createRandomIp(), "b-and-a", "Bachman & Associates", true, false, false, false, 0);
|
||||||
BachmanAndAssociatesServer.setHackingParameters(getRandomInt(875, 925), 30000000000, getRandomInt(75, 85), getRandomInt(65, 75));
|
BachmanAndAssociatesServer.setHackingParameters(getRandomInt(1000, 1050), 30000000000, getRandomInt(75, 85), getRandomInt(65, 75));
|
||||||
BachmanAndAssociatesServer.setPortProperties(5);
|
BachmanAndAssociatesServer.setPortProperties(5);
|
||||||
AddToAllServers(BachmanAndAssociatesServer);
|
AddToAllServers(BachmanAndAssociatesServer);
|
||||||
|
|
||||||
var BladeIndustriesServer = new Server();
|
var BladeIndustriesServer = new Server();
|
||||||
BladeIndustriesServer.init(createRandomIp(), "blade", "Blade Industries", true, false, false, false, 0);
|
BladeIndustriesServer.init(createRandomIp(), "blade", "Blade Industries", true, false, false, false, 0);
|
||||||
BladeIndustriesServer.setHackingParameters(getRandomInt(875, 925), 18000000000, getRandomInt(90, 95), getRandomInt(60, 75));
|
BladeIndustriesServer.setHackingParameters(getRandomInt(1000, 1100), 18000000000, getRandomInt(90, 95), getRandomInt(60, 75));
|
||||||
BladeIndustriesServer.setPortProperties(5);
|
BladeIndustriesServer.setPortProperties(5);
|
||||||
AddToAllServers(BladeIndustriesServer);
|
AddToAllServers(BladeIndustriesServer);
|
||||||
|
|
||||||
var NWOServer = new Server();
|
var NWOServer = new Server();
|
||||||
NWOServer.init(createRandomIp(), "nwo", "New World Order", true, false, false, false, 0);
|
NWOServer.init(createRandomIp(), "nwo", "New World Order", true, false, false, false, 0);
|
||||||
NWOServer.setHackingParameters(getRandomInt(900, 920), 36000000000, 99, getRandomInt(75, 85));
|
NWOServer.setHackingParameters(getRandomInt(1000, 1200), 36000000000, 99, getRandomInt(75, 85));
|
||||||
NWOServer.setPortProperties(5);
|
NWOServer.setPortProperties(5);
|
||||||
AddToAllServers(NWOServer);
|
AddToAllServers(NWOServer);
|
||||||
|
|
||||||
var ClarkeIncorporatedServer = new Server();
|
var ClarkeIncorporatedServer = new Server();
|
||||||
ClarkeIncorporatedServer.init(createRandomIp(), "clarkeinc", "Clarke Incorporated", true, false, false, false, 0);
|
ClarkeIncorporatedServer.init(createRandomIp(), "clarkeinc", "Clarke Incorporated", true, false, false, false, 0);
|
||||||
ClarkeIncorporatedServer.setHackingParameters(getRandomInt(875, 950), 13000000000, getRandomInt(50, 60), getRandomInt(50, 70));
|
ClarkeIncorporatedServer.setHackingParameters(getRandomInt(1000, 1200), 13000000000, getRandomInt(50, 60), getRandomInt(50, 70));
|
||||||
ClarkeIncorporatedServer.setPortProperties(5);
|
ClarkeIncorporatedServer.setPortProperties(5);
|
||||||
AddToAllServers(ClarkeIncorporatedServer);
|
AddToAllServers(ClarkeIncorporatedServer);
|
||||||
|
|
||||||
var OmniTekIncorporatedServer = new Server();
|
var OmniTekIncorporatedServer = new Server();
|
||||||
OmniTekIncorporatedServer.init(createRandomIp(), "omnitek", "OmniTek Incorporated", true, false, false, false, 0);
|
OmniTekIncorporatedServer.init(createRandomIp(), "omnitek", "OmniTek Incorporated", true, false, false, false, 0);
|
||||||
OmniTekIncorporatedServer.setHackingParameters(getRandomInt(870, 930), 45000000000, getRandomInt(90, 99), getRandomInt(95, 99));
|
OmniTekIncorporatedServer.setHackingParameters(getRandomInt(900, 1100), 45000000000, getRandomInt(90, 99), getRandomInt(95, 99));
|
||||||
OmniTekIncorporatedServer.setPortProperties(5);
|
OmniTekIncorporatedServer.setPortProperties(5);
|
||||||
AddToAllServers(OmniTekIncorporatedServer);
|
AddToAllServers(OmniTekIncorporatedServer);
|
||||||
|
|
||||||
var FourSigmaServer = new Server();
|
var FourSigmaServer = new Server();
|
||||||
FourSigmaServer.init(createRandomIp(), "4sigma", "FourSigma", true, false, false, false, 0);
|
FourSigmaServer.init(createRandomIp(), "4sigma", "FourSigma", true, false, false, false, 0);
|
||||||
FourSigmaServer.setHackingParameters(getRandomInt(875, 925), 24000000000, getRandomInt(60, 70), getRandomInt(75, 99));
|
FourSigmaServer.setHackingParameters(getRandomInt(950, 1200), 24000000000, getRandomInt(60, 70), getRandomInt(75, 99));
|
||||||
FourSigmaServer.setPortProperties(5);
|
FourSigmaServer.setPortProperties(5);
|
||||||
AddToAllServers(FourSigmaServer);
|
AddToAllServers(FourSigmaServer);
|
||||||
|
|
||||||
var KuaiGongInternationalServer = new Server();
|
var KuaiGongInternationalServer = new Server();
|
||||||
KuaiGongInternationalServer.init(createRandomIp(), "kuai-gong", "KuaiGong International", true, false, false, false, 0);
|
KuaiGongInternationalServer.init(createRandomIp(), "kuai-gong", "KuaiGong International", true, false, false, false, 0);
|
||||||
KuaiGongInternationalServer.setHackingParameters(getRandomInt(900, 950), 70000000000, getRandomInt(95, 99), getRandomInt(90, 99));
|
KuaiGongInternationalServer.setHackingParameters(getRandomInt(1000, 1250), 70000000000, getRandomInt(95, 99), getRandomInt(90, 99));
|
||||||
KuaiGongInternationalServer.setPortProperties(5);
|
KuaiGongInternationalServer.setPortProperties(5);
|
||||||
AddToAllServers(KuaiGongInternationalServer);
|
AddToAllServers(KuaiGongInternationalServer);
|
||||||
|
|
||||||
//Technology and communications companies (large targets)
|
//Technology and communications companies (large targets)
|
||||||
var FulcrumTechnologiesServer = new Server();
|
var FulcrumTechnologiesServer = new Server();
|
||||||
FulcrumTechnologiesServer.init(createRandomIp(), "fulcrumtech", "Fulcrum Technologies", true, false, false, false, 64);
|
FulcrumTechnologiesServer.init(createRandomIp(), "fulcrumtech", "Fulcrum Technologies", true, false, false, false, 64);
|
||||||
FulcrumTechnologiesServer.setHackingParameters(getRandomInt(900, 1000), 1500000000, getRandomInt(85, 95), getRandomInt(80, 99));
|
FulcrumTechnologiesServer.setHackingParameters(getRandomInt(1000, 1200), 1500000000, getRandomInt(85, 95), getRandomInt(80, 99));
|
||||||
FulcrumTechnologiesServer.setPortProperties(5);
|
FulcrumTechnologiesServer.setPortProperties(5);
|
||||||
AddToAllServers(FulcrumTechnologiesServer);
|
AddToAllServers(FulcrumTechnologiesServer);
|
||||||
|
|
||||||
var FulcrumSecretTechnologiesServer = new Server();
|
var FulcrumSecretTechnologiesServer = new Server();
|
||||||
FulcrumSecretTechnologiesServer.init(createRandomIp(), "fulcrumassets", "Fulcrum Technologies Assets", true, false, false, false, 0);
|
FulcrumSecretTechnologiesServer.init(createRandomIp(), "fulcrumassets", "Fulcrum Technologies Assets", true, false, false, false, 0);
|
||||||
FulcrumSecretTechnologiesServer.setHackingParameters(getRandomInt(1000, 1250), 1000000, 99, 1);
|
FulcrumSecretTechnologiesServer.setHackingParameters(getRandomInt(1200, 1500), 1000000, 99, 1);
|
||||||
FulcrumSecretTechnologiesServer.setPortProperties(5);
|
FulcrumSecretTechnologiesServer.setPortProperties(5);
|
||||||
AddToAllServers(FulcrumSecretTechnologiesServer);
|
AddToAllServers(FulcrumSecretTechnologiesServer);
|
||||||
SpecialServerIps.addIp(SpecialServerNames.FulcrumSecretTechnologies, FulcrumSecretTechnologiesServer.ip);
|
SpecialServerIps.addIp(SpecialServerNames.FulcrumSecretTechnologies, FulcrumSecretTechnologiesServer.ip);
|
||||||
|
|
||||||
var StormTechnologiesServer = new Server();
|
var StormTechnologiesServer = new Server();
|
||||||
StormTechnologiesServer.init(createRandomIp(), "stormtech", "Storm Technologies", true, false, false, false, 0);
|
StormTechnologiesServer.init(createRandomIp(), "stormtech", "Storm Technologies", true, false, false, false, 0);
|
||||||
StormTechnologiesServer.setHackingParameters(getRandomInt(825, 875), 1300000000, getRandomInt(80, 90), getRandomInt(70, 90));
|
StormTechnologiesServer.setHackingParameters(getRandomInt(900, 1050), 1300000000, getRandomInt(80, 90), getRandomInt(70, 90));
|
||||||
StormTechnologiesServer.setPortProperties(5);
|
StormTechnologiesServer.setPortProperties(5);
|
||||||
AddToAllServers(StormTechnologiesServer);
|
AddToAllServers(StormTechnologiesServer);
|
||||||
|
|
||||||
var DefCommServer = new Server();
|
var DefCommServer = new Server();
|
||||||
DefCommServer.init(createRandomIp(), "defcomm", "DefComm", true, false, false, false, 0);
|
DefCommServer.init(createRandomIp(), "defcomm", "DefComm", true, false, false, false, 0);
|
||||||
DefCommServer.setHackingParameters(getRandomInt(800, 850), 850000000, getRandomInt(85, 95), getRandomInt(50, 70));
|
DefCommServer.setHackingParameters(getRandomInt(900, 1000), 850000000, getRandomInt(85, 95), getRandomInt(50, 70));
|
||||||
DefCommServer.setPortProperties(5);
|
DefCommServer.setPortProperties(5);
|
||||||
AddToAllServers(DefCommServer);
|
AddToAllServers(DefCommServer);
|
||||||
|
|
||||||
var InfoCommServer = new Server();
|
var InfoCommServer = new Server();
|
||||||
InfoCommServer.init(createRandomIp(), "infocomm", "InfoComm", true, false, false, false, 0);
|
InfoCommServer.init(createRandomIp(), "infocomm", "InfoComm", true, false, false, false, 0);
|
||||||
InfoCommServer.setHackingParameters(getRandomInt(800, 850), 700000000, getRandomInt(70, 90), getRandomInt(35, 75));
|
InfoCommServer.setHackingParameters(getRandomInt(875, 950), 700000000, getRandomInt(70, 90), getRandomInt(35, 75));
|
||||||
InfoCommServer.setPortProperties(5);
|
InfoCommServer.setPortProperties(5);
|
||||||
AddToAllServers(InfoCommServer);
|
AddToAllServers(InfoCommServer);
|
||||||
|
|
||||||
var HeliosLabsServer = new Server();
|
var HeliosLabsServer = new Server();
|
||||||
HeliosLabsServer.init(createRandomIp(), "helios", "Helios Labs", true, false, false, false, 0);
|
HeliosLabsServer.init(createRandomIp(), "helios", "Helios Labs", true, false, false, false, 0);
|
||||||
HeliosLabsServer.setHackingParameters(getRandomInt(775, 825), 450000000, getRandomInt(85, 95), getRandomInt(70, 80));
|
HeliosLabsServer.setHackingParameters(getRandomInt(800, 900), 450000000, getRandomInt(85, 95), getRandomInt(70, 80));
|
||||||
HeliosLabsServer.setPortProperties(5);
|
HeliosLabsServer.setPortProperties(5);
|
||||||
AddToAllServers(HeliosLabsServer);
|
AddToAllServers(HeliosLabsServer);
|
||||||
|
|
||||||
var VitaLifeServer = new Server();
|
var VitaLifeServer = new Server();
|
||||||
VitaLifeServer.init(createRandomIp(), "vitalife", "VitaLife", true, false, false, false, 32);
|
VitaLifeServer.init(createRandomIp(), "vitalife", "VitaLife", true, false, false, false, 32);
|
||||||
VitaLifeServer.setHackingParameters(getRandomInt(750, 800), 720000000, getRandomInt(80, 90), getRandomInt(60, 80));
|
VitaLifeServer.setHackingParameters(getRandomInt(775, 900), 720000000, getRandomInt(80, 90), getRandomInt(60, 80));
|
||||||
VitaLifeServer.setPortProperties(5);
|
VitaLifeServer.setPortProperties(5);
|
||||||
AddToAllServers(VitaLifeServer);
|
AddToAllServers(VitaLifeServer);
|
||||||
|
|
||||||
var IcarusMicrosystemsServer = new Server();
|
var IcarusMicrosystemsServer = new Server();
|
||||||
IcarusMicrosystemsServer.init(createRandomIp(), "icarus", "Icarus Microsystems", true, false, false, false, 0);
|
IcarusMicrosystemsServer.init(createRandomIp(), "icarus", "Icarus Microsystems", true, false, false, false, 0);
|
||||||
IcarusMicrosystemsServer.setHackingParameters(getRandomInt(800, 820), 1000000000, getRandomInt(85, 95), getRandomInt(85, 95));
|
IcarusMicrosystemsServer.setHackingParameters(getRandomInt(850, 925), 1000000000, getRandomInt(85, 95), getRandomInt(85, 95));
|
||||||
IcarusMicrosystemsServer.setPortProperties(5);
|
IcarusMicrosystemsServer.setPortProperties(5);
|
||||||
AddToAllServers(IcarusMicrosystemsServer);
|
AddToAllServers(IcarusMicrosystemsServer);
|
||||||
|
|
||||||
var UniversalEnergyServer = new Server();
|
var UniversalEnergyServer = new Server();
|
||||||
UniversalEnergyServer.init(createRandomIp(), "univ-energy", "Universal Energy", true, false, false, false, 32);
|
UniversalEnergyServer.init(createRandomIp(), "univ-energy", "Universal Energy", true, false, false, false, 32);
|
||||||
UniversalEnergyServer.setHackingParameters(getRandomInt(780, 800), 1300000000, getRandomInt(80, 90), getRandomInt(80, 90));
|
UniversalEnergyServer.setHackingParameters(getRandomInt(800, 900), 1300000000, getRandomInt(80, 90), getRandomInt(80, 90));
|
||||||
UniversalEnergyServer.setPortProperties(4);
|
UniversalEnergyServer.setPortProperties(4);
|
||||||
AddToAllServers(UniversalEnergyServer);
|
AddToAllServers(UniversalEnergyServer);
|
||||||
|
|
||||||
var TitanLabsServer = new Server();
|
var TitanLabsServer = new Server();
|
||||||
TitanLabsServer.init(createRandomIp(), "titan-labs", "Titan Laboratories", true, false, false, false, 32);
|
TitanLabsServer.init(createRandomIp(), "titan-labs", "Titan Laboratories", true, false, false, false, 32);
|
||||||
TitanLabsServer.setHackingParameters(getRandomInt(790, 800), 900000000, getRandomInt(70, 80), getRandomInt(60, 80));
|
TitanLabsServer.setHackingParameters(getRandomInt(800, 875), 900000000, getRandomInt(70, 80), getRandomInt(60, 80));
|
||||||
TitanLabsServer.setPortProperties(5);
|
TitanLabsServer.setPortProperties(5);
|
||||||
AddToAllServers(TitanLabsServer);
|
AddToAllServers(TitanLabsServer);
|
||||||
|
|
||||||
var MicrodyneTechnologiesServer = new Server();
|
var MicrodyneTechnologiesServer = new Server();
|
||||||
MicrodyneTechnologiesServer.init(createRandomIp(), "microdyne", "Microdyne Technologies", true, false, false, false, 16);
|
MicrodyneTechnologiesServer.init(createRandomIp(), "microdyne", "Microdyne Technologies", true, false, false, false, 16);
|
||||||
MicrodyneTechnologiesServer.setHackingParameters(getRandomInt(780, 820), 750000000, getRandomInt(65, 75), getRandomInt(70, 90));
|
MicrodyneTechnologiesServer.setHackingParameters(getRandomInt(800, 875), 750000000, getRandomInt(65, 75), getRandomInt(70, 90));
|
||||||
MicrodyneTechnologiesServer.setPortProperties(5);
|
MicrodyneTechnologiesServer.setPortProperties(5);
|
||||||
AddToAllServers(MicrodyneTechnologiesServer);
|
AddToAllServers(MicrodyneTechnologiesServer);
|
||||||
|
|
||||||
var TaiYangDigitalServer = new Server();
|
var TaiYangDigitalServer = new Server();
|
||||||
TaiYangDigitalServer.init(createRandomIp(), "taiyang-digital", "Taiyang Digital", true, false, false, false, 0);
|
TaiYangDigitalServer.init(createRandomIp(), "taiyang-digital", "Taiyang Digital", true, false, false, false, 0);
|
||||||
TaiYangDigitalServer.setHackingParameters(getRandomInt(800, 900), 1000000000, getRandomInt(70, 80), getRandomInt(70, 80));
|
TaiYangDigitalServer.setHackingParameters(getRandomInt(850, 950), 1000000000, getRandomInt(70, 80), getRandomInt(70, 80));
|
||||||
TaiYangDigitalServer.setPortProperties(5);
|
TaiYangDigitalServer.setPortProperties(5);
|
||||||
AddToAllServers(TaiYangDigitalServer);
|
AddToAllServers(TaiYangDigitalServer);
|
||||||
|
|
||||||
var GalacticCyberSystemsServer = new Server();
|
var GalacticCyberSystemsServer = new Server();
|
||||||
GalacticCyberSystemsServer.init(createRandomIp(), "galactic-cyber", "Galactic Cybersystems", true, false, false, false, 0);
|
GalacticCyberSystemsServer.init(createRandomIp(), "galactic-cyber", "Galactic Cybersystems", true, false, false, false, 0);
|
||||||
GalacticCyberSystemsServer.setHackingParameters(getRandomInt(800, 850), 450000000, getRandomInt(55, 65), getRandomInt(70, 90));
|
GalacticCyberSystemsServer.setHackingParameters(getRandomInt(825, 875), 450000000, getRandomInt(55, 65), getRandomInt(70, 90));
|
||||||
GalacticCyberSystemsServer.setPortProperties(5);
|
GalacticCyberSystemsServer.setPortProperties(5);
|
||||||
AddToAllServers(GalacticCyberSystemsServer);
|
AddToAllServers(GalacticCyberSystemsServer);
|
||||||
|
|
||||||
//Defense Companies ("Large" Companies)
|
//Defense Companies ("Large" Companies)
|
||||||
var AeroCorpServer = new Server();
|
var AeroCorpServer = new Server();
|
||||||
AeroCorpServer.init(createRandomIp(), "aerocorp", "AeroCorp", true, false, false, false, 0);
|
AeroCorpServer.init(createRandomIp(), "aerocorp", "AeroCorp", true, false, false, false, 0);
|
||||||
AeroCorpServer.setHackingParameters(getRandomInt(825, 875), 1300000000, getRandomInt(80, 90), getRandomInt(55, 65));
|
AeroCorpServer.setHackingParameters(getRandomInt(850, 925), 1300000000, getRandomInt(80, 90), getRandomInt(55, 65));
|
||||||
AeroCorpServer.setPortProperties(5);
|
AeroCorpServer.setPortProperties(5);
|
||||||
AddToAllServers(AeroCorpServer);
|
AddToAllServers(AeroCorpServer);
|
||||||
|
|
||||||
var OmniaCybersystemsServer = new Server();
|
var OmniaCybersystemsServer = new Server();
|
||||||
OmniaCybersystemsServer.init(createRandomIp(), "omnia", "Omnia Cybersystems", true, false, false, false, 0);
|
OmniaCybersystemsServer.init(createRandomIp(), "omnia", "Omnia Cybersystems", true, false, false, false, 0);
|
||||||
OmniaCybersystemsServer.setHackingParameters(getRandomInt(800, 850), 1100000000, getRandomInt(85, 95), getRandomInt(60, 70));
|
OmniaCybersystemsServer.setHackingParameters(getRandomInt(850, 950), 1100000000, getRandomInt(85, 95), getRandomInt(60, 70));
|
||||||
OmniaCybersystemsServer.setPortProperties(5);
|
OmniaCybersystemsServer.setPortProperties(5);
|
||||||
AddToAllServers(OmniaCybersystemsServer);
|
AddToAllServers(OmniaCybersystemsServer);
|
||||||
|
|
||||||
@ -294,57 +294,57 @@ initForeignServers = function() {
|
|||||||
|
|
||||||
var AppliedEnergeticsServer = new Server();
|
var AppliedEnergeticsServer = new Server();
|
||||||
AppliedEnergeticsServer.init(createRandomIp(), "applied-energetics", "Applied Energetics", true, false, false, false, 0);
|
AppliedEnergeticsServer.init(createRandomIp(), "applied-energetics", "Applied Energetics", true, false, false, false, 0);
|
||||||
AppliedEnergeticsServer.setHackingParameters(getRandomInt(750, 800), 1100000000, getRandomInt(60, 80), getRandomInt(70, 75));
|
AppliedEnergeticsServer.setHackingParameters(getRandomInt(775, 850), 1100000000, getRandomInt(60, 80), getRandomInt(70, 75));
|
||||||
AppliedEnergeticsServer.setPortProperties(4);
|
AppliedEnergeticsServer.setPortProperties(4);
|
||||||
AddToAllServers(AppliedEnergeticsServer);
|
AddToAllServers(AppliedEnergeticsServer);
|
||||||
|
|
||||||
var SolarisSpaceSystemsServer = new Server();
|
var SolarisSpaceSystemsServer = new Server();
|
||||||
SolarisSpaceSystemsServer.init(createRandomIp(), "solaris", "Solaris Space Systems", true, false, false, false, 0);
|
SolarisSpaceSystemsServer.init(createRandomIp(), "solaris", "Solaris Space Systems", true, false, false, false, 0);
|
||||||
SolarisSpaceSystemsServer.setHackingParameters(getRandomInt(790, 810), 800000000, getRandomInt(70, 80), getRandomInt(70, 80));
|
SolarisSpaceSystemsServer.setHackingParameters(getRandomInt(750, 850), 800000000, getRandomInt(70, 80), getRandomInt(70, 80));
|
||||||
SolarisSpaceSystemsServer.setPortProperties(5);
|
SolarisSpaceSystemsServer.setPortProperties(5);
|
||||||
AddToAllServers(SolarisSpaceSystemsServer);
|
AddToAllServers(SolarisSpaceSystemsServer);
|
||||||
|
|
||||||
var DeltaOneServer = new Server();
|
var DeltaOneServer = new Server();
|
||||||
DeltaOneServer.init(createRandomIp(), "deltaone", "Delta One", true, false, false, false, 0);
|
DeltaOneServer.init(createRandomIp(), "deltaone", "Delta One", true, false, false, false, 0);
|
||||||
DeltaOneServer.setHackingParameters(getRandomInt(800, 820), 1400000000, getRandomInt(75, 85), getRandomInt(50, 70));
|
DeltaOneServer.setHackingParameters(getRandomInt(800, 900), 1400000000, getRandomInt(75, 85), getRandomInt(50, 70));
|
||||||
DeltaOneServer.setPortProperties(5);
|
DeltaOneServer.setPortProperties(5);
|
||||||
AddToAllServers(DeltaOneServer);
|
AddToAllServers(DeltaOneServer);
|
||||||
|
|
||||||
//Health, medicine, pharmaceutical companies ("Large" targets)
|
//Health, medicine, pharmaceutical companies ("Large" targets)
|
||||||
var GlobalPharmaceuticalsServer = new Server();
|
var GlobalPharmaceuticalsServer = new Server();
|
||||||
GlobalPharmaceuticalsServer.init(createRandomIp(), "global-pharm", "Global Pharmaceuticals", true, false, false, false, 16);
|
GlobalPharmaceuticalsServer.init(createRandomIp(), "global-pharm", "Global Pharmaceuticals", true, false, false, false, 16);
|
||||||
GlobalPharmaceuticalsServer.setHackingParameters(getRandomInt(750, 800), 1800000000, getRandomInt(75, 85), getRandomInt(80, 90));
|
GlobalPharmaceuticalsServer.setHackingParameters(getRandomInt(750, 850), 1800000000, getRandomInt(75, 85), getRandomInt(80, 90));
|
||||||
GlobalPharmaceuticalsServer.setPortProperties(4);
|
GlobalPharmaceuticalsServer.setPortProperties(4);
|
||||||
AddToAllServers(GlobalPharmaceuticalsServer);
|
AddToAllServers(GlobalPharmaceuticalsServer);
|
||||||
|
|
||||||
var NovaMedicalServer = new Server();
|
var NovaMedicalServer = new Server();
|
||||||
NovaMedicalServer.init(createRandomIp(), "nova-med", "Nova Medical", true, false, false, false, 0);
|
NovaMedicalServer.init(createRandomIp(), "nova-med", "Nova Medical", true, false, false, false, 0);
|
||||||
NovaMedicalServer.setHackingParameters(getRandomInt(775, 825), 1350000000, getRandomInt(60, 80), getRandomInt(65, 85));
|
NovaMedicalServer.setHackingParameters(getRandomInt(775, 850), 1350000000, getRandomInt(60, 80), getRandomInt(65, 85));
|
||||||
NovaMedicalServer.setPortProperties(4);
|
NovaMedicalServer.setPortProperties(4);
|
||||||
AddToAllServers(NovaMedicalServer);
|
AddToAllServers(NovaMedicalServer);
|
||||||
|
|
||||||
var ZeusMedicalServer = new Server();
|
var ZeusMedicalServer = new Server();
|
||||||
ZeusMedicalServer.init(createRandomIp(), "zeud-med", "Zeus Medical", true, false, false, false, 0);
|
ZeusMedicalServer.init(createRandomIp(), "zeus-med", "Zeus Medical", true, false, false, false, 0);
|
||||||
ZeusMedicalServer.setHackingParameters(getRandomInt(800, 825), 1600000000, getRandomInt(70, 90), getRandomInt(70, 80));
|
ZeusMedicalServer.setHackingParameters(getRandomInt(800, 850), 1600000000, getRandomInt(70, 90), getRandomInt(70, 80));
|
||||||
ZeusMedicalServer.setPortProperties(5);
|
ZeusMedicalServer.setPortProperties(5);
|
||||||
AddToAllServers(ZeusMedicalServer);
|
AddToAllServers(ZeusMedicalServer);
|
||||||
|
|
||||||
var UnitaLifeGroupServer = new Server();
|
var UnitaLifeGroupServer = new Server();
|
||||||
UnitaLifeGroupServer.init(createRandomIp(), "unitalife", "UnitaLife Group", true, false, false, false, 32);
|
UnitaLifeGroupServer.init(createRandomIp(), "unitalife", "UnitaLife Group", true, false, false, false, 32);
|
||||||
UnitaLifeGroupServer.setHackingParameters(getRandomInt(780, 800), 1200000000, getRandomInt(70, 80), getRandomInt(70, 80));
|
UnitaLifeGroupServer.setHackingParameters(getRandomInt(775, 825), 1200000000, getRandomInt(70, 80), getRandomInt(70, 80));
|
||||||
UnitaLifeGroupServer.setPortProperties(4);
|
UnitaLifeGroupServer.setPortProperties(4);
|
||||||
AddToAllServers(UnitaLifeGroupServer);
|
AddToAllServers(UnitaLifeGroupServer);
|
||||||
|
|
||||||
//"Medium level" targets
|
//"Medium level" targets
|
||||||
var LexoCorpServer = new Server();
|
var LexoCorpServer = new Server();
|
||||||
LexoCorpServer.init(createRandomIp(), "lexo-corp", "Lexo Corporation", true, false, false, false, 16);
|
LexoCorpServer.init(createRandomIp(), "lexo-corp", "Lexo Corporation", true, false, false, false, 16);
|
||||||
LexoCorpServer.setHackingParameters(getRandomInt(680, 720), 800000000, getRandomInt(60, 80), getRandomInt(55, 65));
|
LexoCorpServer.setHackingParameters(getRandomInt(650, 750), 800000000, getRandomInt(60, 80), getRandomInt(55, 65));
|
||||||
LexoCorpServer.setPortProperties(4);
|
LexoCorpServer.setPortProperties(4);
|
||||||
AddToAllServers(LexoCorpServer);
|
AddToAllServers(LexoCorpServer);
|
||||||
|
|
||||||
var RhoConstructionServer = new Server();
|
var RhoConstructionServer = new Server();
|
||||||
RhoConstructionServer.init(createRandomIp(), "rho-construction", "Rho Construction", true, false, false, false, 0);
|
RhoConstructionServer.init(createRandomIp(), "rho-construction", "Rho Construction", true, false, false, false, 0);
|
||||||
RhoConstructionServer.setHackingParameters(getRandomInt(480, 520), 700000000, getRandomInt(40, 60), getRandomInt(40, 60));
|
RhoConstructionServer.setHackingParameters(getRandomInt(475, 525), 700000000, getRandomInt(40, 60), getRandomInt(40, 60));
|
||||||
RhoConstructionServer.setPortProperties(3);
|
RhoConstructionServer.setPortProperties(3);
|
||||||
AddToAllServers(RhoConstructionServer);
|
AddToAllServers(RhoConstructionServer);
|
||||||
|
|
||||||
@ -399,19 +399,19 @@ initForeignServers = function() {
|
|||||||
|
|
||||||
var CompuTekServer = new Server();
|
var CompuTekServer = new Server();
|
||||||
CompuTekServer.init(createRandomIp(), "comptek", "CompuTek", true, false, false, false, 8);
|
CompuTekServer.init(createRandomIp(), "comptek", "CompuTek", true, false, false, false, 8);
|
||||||
CompuTekServer.setHackingParameters(getRandomInt(300, 400), 275000000, getRandomInt(55, 65), getRandomInt(50, 60));
|
CompuTekServer.setHackingParameters(getRandomInt(300, 400), 275000000, getRandomInt(55, 65), getRandomInt(45, 65));
|
||||||
CompuTekServer.setPortProperties(3);
|
CompuTekServer.setPortProperties(3);
|
||||||
AddToAllServers(CompuTekServer);
|
AddToAllServers(CompuTekServer);
|
||||||
|
|
||||||
var NetLinkTechnologiesServer = new Server();
|
var NetLinkTechnologiesServer = new Server();
|
||||||
NetLinkTechnologiesServer.init(createRandomIp(), "netlink", "NetLink Technologies", true, false, false, false, 0);
|
NetLinkTechnologiesServer.init(createRandomIp(), "netlink", "NetLink Technologies", true, false, false, false, 0);
|
||||||
NetLinkTechnologiesServer.setHackingParameters(getRandomInt(375, 425), 320000000, getRandomInt(60, 80), getRandomInt(50, 70));
|
NetLinkTechnologiesServer.setHackingParameters(getRandomInt(375, 425), 320000000, getRandomInt(60, 80), getRandomInt(45, 75));
|
||||||
NetLinkTechnologiesServer.setPortProperties(3);
|
NetLinkTechnologiesServer.setPortProperties(3);
|
||||||
AddToAllServers(NetLinkTechnologiesServer);
|
AddToAllServers(NetLinkTechnologiesServer);
|
||||||
|
|
||||||
var JohnsonOrthopedicsServer = new Server();
|
var JohnsonOrthopedicsServer = new Server();
|
||||||
JohnsonOrthopedicsServer.init(createRandomIp(), "johnson-ortho", "Johnson Orthopedics", true, false, false, false, 4);
|
JohnsonOrthopedicsServer.init(createRandomIp(), "johnson-ortho", "Johnson Orthopedics", true, false, false, false, 4);
|
||||||
JohnsonOrthopedicsServer.setHackingParameters(getRandomInt(250, 300), 80000000, getRandomInt(40, 60), getRandomInt(40, 60));
|
JohnsonOrthopedicsServer.setHackingParameters(getRandomInt(250, 300), 80000000, getRandomInt(35, 65), getRandomInt(35, 65));
|
||||||
JohnsonOrthopedicsServer.setPortProperties(2);
|
JohnsonOrthopedicsServer.setPortProperties(2);
|
||||||
AddToAllServers(JohnsonOrthopedicsServer);
|
AddToAllServers(JohnsonOrthopedicsServer);
|
||||||
|
|
||||||
@ -556,7 +556,7 @@ initForeignServers = function() {
|
|||||||
SpecialServerIps.addIp(SpecialServerNames.CyberSecServer, CyberSecServer.ip);
|
SpecialServerIps.addIp(SpecialServerNames.CyberSecServer, CyberSecServer.ip);
|
||||||
|
|
||||||
var DaedalusServer = new Server();
|
var DaedalusServer = new Server();
|
||||||
DaedalusServer.init(createRandomIp(), "Icarus", "Icarus", true, false, false, false, 0);
|
DaedalusServer.init(createRandomIp(), "The-Cave", "Helios", true, false, false, false, 0);
|
||||||
DaedalusServer.setHackingParameters(925, 0, 0, 0);
|
DaedalusServer.setHackingParameters(925, 0, 0, 0);
|
||||||
DaedalusServer.setPortProperties(5);
|
DaedalusServer.setPortProperties(5);
|
||||||
AddToAllServers(DaedalusServer);
|
AddToAllServers(DaedalusServer);
|
||||||
@ -565,12 +565,11 @@ initForeignServers = function() {
|
|||||||
//Super special Servers
|
//Super special Servers
|
||||||
var WorldDaemon = new Server();
|
var WorldDaemon = new Server();
|
||||||
WorldDaemon.init(createRandomIp(), SpecialServerNames.WorldDaemon, SpecialServerNames.WorldDaemon, true, false, false, false, 0);
|
WorldDaemon.init(createRandomIp(), SpecialServerNames.WorldDaemon, SpecialServerNames.WorldDaemon, true, false, false, false, 0);
|
||||||
WorldDaemon.setHackingParameters(950, 0, 0, 0);
|
WorldDaemon.setHackingParameters(3000, 0, 0, 0);
|
||||||
WorldDaemon.setPortProperties(5);
|
WorldDaemon.setPortProperties(5);
|
||||||
AddToAllServers(WorldDaemon);
|
AddToAllServers(WorldDaemon);
|
||||||
SpecialServerIps.addIp(SpecialServerNames.WorldDaemon, WorldDaemon.ip);
|
SpecialServerIps.addIp(SpecialServerNames.WorldDaemon, WorldDaemon.ip);
|
||||||
|
|
||||||
|
|
||||||
/* Create a randomized network for all the foreign servers */
|
/* Create a randomized network for all the foreign servers */
|
||||||
//Groupings for creating a randomized network
|
//Groupings for creating a randomized network
|
||||||
var NetworkGroup1 = [IronGymServer, FoodNStuffServer, SigmaCosmeticsServer, JoesGunsServer, HongFangTeaHouseServer, HaraKiriSushiBarServer];
|
var NetworkGroup1 = [IronGymServer, FoodNStuffServer, SigmaCosmeticsServer, JoesGunsServer, HongFangTeaHouseServer, HaraKiriSushiBarServer];
|
||||||
|
7
src/Settings.js
Normal file
7
src/Settings.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/* Settings.js */
|
||||||
|
Settings = {
|
||||||
|
CodeInstructionRunTime: 100,
|
||||||
|
suppressMessages: false,
|
||||||
|
MaxLogCapacity: 50,
|
||||||
|
MaxPortCapacity: 50,
|
||||||
|
}
|
@ -32,7 +32,6 @@ function initStockSymbols() {
|
|||||||
StockSymbols[Locations.NewTokyoVitaLife] = "VITA";
|
StockSymbols[Locations.NewTokyoVitaLife] = "VITA";
|
||||||
StockSymbols[Locations.Sector12IcarusMicrosystems] = "ICRS";
|
StockSymbols[Locations.Sector12IcarusMicrosystems] = "ICRS";
|
||||||
StockSymbols[Locations.Sector12UniversalEnergy] = "UNV";
|
StockSymbols[Locations.Sector12UniversalEnergy] = "UNV";
|
||||||
StockSymbols[Locations.AevumGalacticCybersystems] = "GLC"
|
|
||||||
StockSymbols[Locations.AevumAeroCorp] = "AERO";
|
StockSymbols[Locations.AevumAeroCorp] = "AERO";
|
||||||
StockSymbols[Locations.VolhavenOmniaCybersystems] = "OMN";
|
StockSymbols[Locations.VolhavenOmniaCybersystems] = "OMN";
|
||||||
StockSymbols[Locations.ChongqingSolarisSpaceSystems] = "SLRS";
|
StockSymbols[Locations.ChongqingSolarisSpaceSystems] = "SLRS";
|
||||||
@ -52,15 +51,17 @@ function initStockSymbols() {
|
|||||||
StockSymbols["Sigma Cosmetics"] = "SGC";
|
StockSymbols["Sigma Cosmetics"] = "SGC";
|
||||||
StockSymbols["Joes Guns"] = "JGN";
|
StockSymbols["Joes Guns"] = "JGN";
|
||||||
StockSymbols["Catalyst Ventures"] = "CTYS";
|
StockSymbols["Catalyst Ventures"] = "CTYS";
|
||||||
StockSymbols["UnitaLife Group"] = "UNT";
|
|
||||||
StockSymbols["Zeus Medical"] = "ZEUS";
|
|
||||||
StockSymbols["Taiyang Digital"] = "TAI";
|
StockSymbols["Taiyang Digital"] = "TAI";
|
||||||
StockSymbols["Microdyne Technologies"] = "MDYN";
|
StockSymbols["Microdyne Technologies"] = "MDYN";
|
||||||
StockSymbols["Titan Laboratories"] = "TITN";
|
StockSymbols["Titan Laboratories"] = "TITN";
|
||||||
}
|
}
|
||||||
|
|
||||||
function initStockMarket() {
|
function initStockMarket() {
|
||||||
StockMarket = {};
|
for (var stk in StockMarket) {
|
||||||
|
if (StockMarket.hasOwnProperty(stk)) {
|
||||||
|
delete StockMarket[stk];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var ecorp = Locations.AevumECorp;
|
var ecorp = Locations.AevumECorp;
|
||||||
var ecorpStk = new Stock(ecorp, StockSymbols[ecorp], 0.5, true, 16, getRandomInt(20000, 25000));
|
var ecorpStk = new Stock(ecorp, StockSymbols[ecorp], 0.5, true, 16, getRandomInt(20000, 25000));
|
||||||
@ -190,14 +191,6 @@ function initStockMarket() {
|
|||||||
var catalystStk = new Stock(catalyst, StockSymbols[catalyst], 1.25, true, 0, getRandomInt(1000, 1500));
|
var catalystStk = new Stock(catalyst, StockSymbols[catalyst], 1.25, true, 0, getRandomInt(1000, 1500));
|
||||||
StockMarket[catalyst] = catalystStk;
|
StockMarket[catalyst] = catalystStk;
|
||||||
|
|
||||||
var unitalife = "UnitaLife Group";
|
|
||||||
var unitalifeStk = new Stock(unitalife, StockSymbols[unitalife], 0.75, true, 8, getRandomInt(10000, 15000));
|
|
||||||
StockMarket[unitalife] = unitalifeStk;
|
|
||||||
|
|
||||||
var zeus = "Zeus Medical";
|
|
||||||
var zeusStk = new Stock(zeus, StockSymbols[zeus], 0.6, true, 9, getRandomInt(20000, 25000));
|
|
||||||
StockMarket[zeus] = zeusStk;
|
|
||||||
|
|
||||||
var taiyang = "Taiyang Digital";
|
var taiyang = "Taiyang Digital";
|
||||||
var taiyangStk = new Stock(taiyang, StockSymbols[taiyang], 0.75, true, 12, getRandomInt(25000, 30000));
|
var taiyangStk = new Stock(taiyang, StockSymbols[taiyang], 0.75, true, 12, getRandomInt(25000, 30000));
|
||||||
StockMarket[taiyang] = taiyangStk;
|
StockMarket[taiyang] = taiyangStk;
|
||||||
@ -230,7 +223,11 @@ function stockMarketCycle() {
|
|||||||
for (var name in StockMarket) {
|
for (var name in StockMarket) {
|
||||||
if (StockMarket.hasOwnProperty(name)) {
|
if (StockMarket.hasOwnProperty(name)) {
|
||||||
var stock = StockMarket[name];
|
var stock = StockMarket[name];
|
||||||
stock.b = !stock.b;
|
var thresh = 0.62;
|
||||||
|
if (stock.b) {thresh = 0.38;}
|
||||||
|
if (Math.random() < thresh) {
|
||||||
|
stock.b = !stock.b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -349,6 +346,7 @@ function displayStockMarketContent() {
|
|||||||
wseAccountButton.addEventListener("click", function() {
|
wseAccountButton.addEventListener("click", function() {
|
||||||
Player.hasWseAccount = true;
|
Player.hasWseAccount = true;
|
||||||
initStockMarket();
|
initStockMarket();
|
||||||
|
initSymbolToStockMap();
|
||||||
Player.loseMoney(CONSTANTS.WSEAccountCost);
|
Player.loseMoney(CONSTANTS.WSEAccountCost);
|
||||||
displayStockMarketContent();
|
displayStockMarketContent();
|
||||||
return false;
|
return false;
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
/* Write text to terminal */
|
/* Write text to terminal */
|
||||||
var post = function(input, replace=true) {
|
var post = function(input, replace=true) {
|
||||||
if (replace) {
|
if (replace) {
|
||||||
$("#terminal-input").before('<tr class="posted"><td style="color: var(--my-font-color); background-color: var(--my-background-color);">' + input.replace( / /g, " " ) + '</td></tr>');
|
$("#terminal-input").before('<tr class="posted"><td class="terminal-line" style="color: var(--my-font-color); background-color: var(--my-background-color);">' + input.replace( / /g, " " ) + '</td></tr>');
|
||||||
} else {
|
} else {
|
||||||
$("#terminal-input").before('<tr class="posted"><td style="color: var(--my-font-color); background-color: var(--my-background-color);">' + input + '</td></tr>');
|
$("#terminal-input").before('<tr class="posted"><td class="terminal-line" style="color: var(--my-font-color); background-color: var(--my-background-color);">' + input + '</td></tr>');
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTerminalScroll();
|
updateTerminalScroll();
|
||||||
@ -175,6 +175,8 @@ function tabCompletion(command, arg, allPossibilities, index=0) {
|
|||||||
|
|
||||||
command = command.toLowerCase();
|
command = command.toLowerCase();
|
||||||
|
|
||||||
|
//Remove all options in allPossibilities that do not match the current string
|
||||||
|
//that we are attempting to autocomplete
|
||||||
if (arg == "") {
|
if (arg == "") {
|
||||||
for (var i = allPossibilities.length-1; i >= 0; --i) {
|
for (var i = allPossibilities.length-1; i >= 0; --i) {
|
||||||
if (!allPossibilities[i].startsWith(command)) {
|
if (!allPossibilities[i].startsWith(command)) {
|
||||||
@ -334,6 +336,11 @@ var Terminal = {
|
|||||||
var expGainedOnSuccess = Player.calculateExpGain();
|
var expGainedOnSuccess = Player.calculateExpGain();
|
||||||
var expGainedOnFailure = (expGainedOnSuccess / 4);
|
var expGainedOnFailure = (expGainedOnSuccess / 4);
|
||||||
if (rand < hackChance) { //Success!
|
if (rand < hackChance) { //Success!
|
||||||
|
if (SpecialServerIps[SpecialServerNames.WorldDaemon] &&
|
||||||
|
SpecialServerIps[SpecialServerNames.WorldDaemon] == server.ip) {
|
||||||
|
hackWorldDaemon();
|
||||||
|
return;
|
||||||
|
}
|
||||||
server.manuallyHacked = true;
|
server.manuallyHacked = true;
|
||||||
var moneyGained = Player.calculatePercentMoneyHacked();
|
var moneyGained = Player.calculatePercentMoneyHacked();
|
||||||
moneyGained = Math.floor(server.moneyAvailable * moneyGained);
|
moneyGained = Math.floor(server.moneyAvailable * moneyGained);
|
||||||
@ -435,6 +442,11 @@ var Terminal = {
|
|||||||
//Process any aliases
|
//Process any aliases
|
||||||
command = substituteAliases(command);
|
command = substituteAliases(command);
|
||||||
|
|
||||||
|
//Allow usage of ./
|
||||||
|
if (command.startsWith("./")) {
|
||||||
|
command = command.slice(0, 2) + " " + command.slice(2);
|
||||||
|
}
|
||||||
|
|
||||||
//Only split the first space
|
//Only split the first space
|
||||||
var commandArray = command.split(" ");
|
var commandArray = command.split(" ");
|
||||||
if (commandArray.length > 1) {
|
if (commandArray.length > 1) {
|
||||||
@ -451,7 +463,7 @@ var Terminal = {
|
|||||||
switch(currITutorialStep) {
|
switch(currITutorialStep) {
|
||||||
case iTutorialSteps.TerminalHelp:
|
case iTutorialSteps.TerminalHelp:
|
||||||
if (commandArray[0] == "help") {
|
if (commandArray[0] == "help") {
|
||||||
post(CONSTANTS.HelpText);
|
post(TerminalHelpText);
|
||||||
iTutorialNextStep();
|
iTutorialNextStep();
|
||||||
} else {post("Bad command. Please follow the tutorial");}
|
} else {post("Bad command. Please follow the tutorial");}
|
||||||
break;
|
break;
|
||||||
@ -714,11 +726,20 @@ var Terminal = {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "help":
|
case "help":
|
||||||
if (commandArray.length != 1) {
|
if (commandArray.length != 1 && commandArray.length != 2) {
|
||||||
post("Incorrect usage of help command. Usage: help"); return;
|
post("Incorrect usage of help command. Usage: help"); return;
|
||||||
}
|
}
|
||||||
|
if (commandArray.length == 1) {
|
||||||
post(CONSTANTS.HelpText);
|
post(TerminalHelpText);
|
||||||
|
} else {
|
||||||
|
var cmd = commandArray[1];
|
||||||
|
var txt = HelpTexts[cmd];
|
||||||
|
if (txt == null) {
|
||||||
|
post("Error: No help topics match '" + cmd + "'");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
post(txt);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "home":
|
case "home":
|
||||||
if (commandArray.length != 1) {
|
if (commandArray.length != 1) {
|
||||||
@ -871,6 +892,7 @@ var Terminal = {
|
|||||||
post("No such file exists");
|
post("No such file exists");
|
||||||
break;
|
break;
|
||||||
case "run":
|
case "run":
|
||||||
|
case "./":
|
||||||
//Run a program or a script
|
//Run a program or a script
|
||||||
if (commandArray.length != 2) {
|
if (commandArray.length != 2) {
|
||||||
post("Incorrect number of arguments. Usage: run [program/script] [-t] [num threads] [arg1] [arg2]...");
|
post("Incorrect number of arguments. Usage: run [program/script] [-t] [num threads] [arg1] [arg2]...");
|
||||||
@ -1168,7 +1190,6 @@ var Terminal = {
|
|||||||
|
|
||||||
executeScanAnalyzeCommand: function(depth=1) {
|
executeScanAnalyzeCommand: function(depth=1) {
|
||||||
//We'll use the AllServersMap as a visited() array
|
//We'll use the AllServersMap as a visited() array
|
||||||
//TODO Later refactor this to a generic name
|
|
||||||
//TODO Using array as stack for now, can make more efficient
|
//TODO Using array as stack for now, can make more efficient
|
||||||
post("~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~");
|
post("~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~");
|
||||||
post(" ");
|
post(" ");
|
||||||
@ -1343,6 +1364,18 @@ var Terminal = {
|
|||||||
case Programs.DeepscanV2:
|
case Programs.DeepscanV2:
|
||||||
post("This executable cannot be run.");
|
post("This executable cannot be run.");
|
||||||
post("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.");
|
post("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.");
|
||||||
|
break;
|
||||||
|
case Programs.Flight:
|
||||||
|
post("Augmentations: " + Player.augmentations.length + " / 30");
|
||||||
|
post("Money: $" + formatNumber(Player.money, 2) + " / $" + formatNumber(100000000000, 2));
|
||||||
|
post("One path below must be fulfilled...");
|
||||||
|
post("----------HACKING PATH----------");
|
||||||
|
post("Hacking skill: " + Player.hacking_skill + " / 2500");
|
||||||
|
post("----------COMBAT PATH----------");
|
||||||
|
post("Strength: " + Player.strength + " / 1500");
|
||||||
|
post("Defense: " + Player.defense + " / 1500");
|
||||||
|
post("Dexterity: " + Player.dexterity + " / 1500");
|
||||||
|
post("Agility: " + Player.agility + " / 1500");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
post("Invalid executable. Cannot be run");
|
post("Invalid executable. Cannot be run");
|
||||||
|
504
src/engine.js
504
src/engine.js
@ -1,3 +1,65 @@
|
|||||||
|
/* Shortcuts to navigate through the game
|
||||||
|
* Alt-t - Terminal
|
||||||
|
* Alt-c - Character
|
||||||
|
* Alt-e - Script editor
|
||||||
|
* Alt-s - Active scripts
|
||||||
|
* Alt-h - Hacknet Nodes
|
||||||
|
* Alt-w - City
|
||||||
|
* Alt-j - Job
|
||||||
|
* Alt-r - Travel Agency of current city
|
||||||
|
* Alt-p - Create program
|
||||||
|
* Alt-f - Factions
|
||||||
|
* Alt-a - Augmentations
|
||||||
|
* Alt-u - Tutorial
|
||||||
|
* Alt-o - Options
|
||||||
|
*/
|
||||||
|
$(document).keydown(function(e) {
|
||||||
|
if (!Player.isWorking && !redPillFlag) {
|
||||||
|
if (e.keyCode == 84 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadTerminalContent();
|
||||||
|
} else if (e.keyCode == 67 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadCharacterContent();
|
||||||
|
} else if (e.keyCode == 69 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadScriptEditorContent();
|
||||||
|
} else if (e.keyCode == 83 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadActiveScriptsContent();
|
||||||
|
} else if (e.keyCode == 72 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadHacknetNodesContent();
|
||||||
|
} else if (e.keyCode == 87 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadWorldContent();
|
||||||
|
} else if (e.keyCode == 74 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadJobContent();
|
||||||
|
} else if (e.keyCode == 82 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadTravelContent();
|
||||||
|
} else if (e.keyCode == 80 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadCreateProgramContent();
|
||||||
|
} else if (e.keyCode == 70 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadFactionsContent();
|
||||||
|
} else if (e.keyCode == 65 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadAugmentationsContent();
|
||||||
|
} else if (e.keyCode == 85 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
Engine.loadTutorialContent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.keyCode == 79 && e.altKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
gameOptionsBoxOpen();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var Engine = {
|
var Engine = {
|
||||||
version: "",
|
version: "",
|
||||||
Debug: true,
|
Debug: true,
|
||||||
@ -11,6 +73,8 @@ var Engine = {
|
|||||||
activeScriptsMainMenuButton: null,
|
activeScriptsMainMenuButton: null,
|
||||||
hacknetNodesMainMenuButton: null,
|
hacknetNodesMainMenuButton: null,
|
||||||
worldMainMenuButton: null,
|
worldMainMenuButton: null,
|
||||||
|
travelMainMenuButton: null,
|
||||||
|
jobMainMenuButton: null,
|
||||||
createProgramMainMenuButton: null,
|
createProgramMainMenuButton: null,
|
||||||
factionsMainMenuButton: null,
|
factionsMainMenuButton: null,
|
||||||
augmentationsMainMenuButton: null,
|
augmentationsMainMenuButton: null,
|
||||||
@ -99,6 +163,7 @@ var Engine = {
|
|||||||
Engine.hideAllContent();
|
Engine.hideAllContent();
|
||||||
Engine.Display.terminalContent.style.visibility = "visible";
|
Engine.Display.terminalContent.style.visibility = "visible";
|
||||||
Engine.currentPage = Engine.Page.Terminal;
|
Engine.currentPage = Engine.Page.Terminal;
|
||||||
|
document.getElementById("terminal-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadCharacterContent: function() {
|
loadCharacterContent: function() {
|
||||||
@ -106,6 +171,7 @@ var Engine = {
|
|||||||
Engine.Display.characterContent.style.visibility = "visible";
|
Engine.Display.characterContent.style.visibility = "visible";
|
||||||
Engine.displayCharacterInfo();
|
Engine.displayCharacterInfo();
|
||||||
Engine.currentPage = Engine.Page.CharacterInfo;
|
Engine.currentPage = Engine.Page.CharacterInfo;
|
||||||
|
document.getElementById("stats-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadScriptEditorContent: function(filename = "", code = "") {
|
loadScriptEditorContent: function(filename = "", code = "") {
|
||||||
@ -118,6 +184,7 @@ var Engine = {
|
|||||||
document.getElementById("script-editor-text").focus();
|
document.getElementById("script-editor-text").focus();
|
||||||
upgradeScriptEditorContent();
|
upgradeScriptEditorContent();
|
||||||
Engine.currentPage = Engine.Page.ScriptEditor;
|
Engine.currentPage = Engine.Page.ScriptEditor;
|
||||||
|
document.getElementById("create-script-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadActiveScriptsContent: function() {
|
loadActiveScriptsContent: function() {
|
||||||
@ -125,6 +192,7 @@ var Engine = {
|
|||||||
Engine.Display.activeScriptsContent.style.visibility = "visible";
|
Engine.Display.activeScriptsContent.style.visibility = "visible";
|
||||||
setActiveScriptsClickHandlers();
|
setActiveScriptsClickHandlers();
|
||||||
Engine.currentPage = Engine.Page.ActiveScripts;
|
Engine.currentPage = Engine.Page.ActiveScripts;
|
||||||
|
document.getElementById("active-scripts-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadHacknetNodesContent: function() {
|
loadHacknetNodesContent: function() {
|
||||||
@ -132,6 +200,7 @@ var Engine = {
|
|||||||
Engine.Display.hacknetNodesContent.style.visibility = "visible";
|
Engine.Display.hacknetNodesContent.style.visibility = "visible";
|
||||||
displayHacknetNodesContent();
|
displayHacknetNodesContent();
|
||||||
Engine.currentPage = Engine.Page.HacknetNodes;
|
Engine.currentPage = Engine.Page.HacknetNodes;
|
||||||
|
document.getElementById("hacknet-nodes-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadWorldContent: function() {
|
loadWorldContent: function() {
|
||||||
@ -139,6 +208,7 @@ var Engine = {
|
|||||||
Engine.Display.worldContent.style.visibility = "visible";
|
Engine.Display.worldContent.style.visibility = "visible";
|
||||||
Engine.displayWorldInfo();
|
Engine.displayWorldInfo();
|
||||||
Engine.currentPage = Engine.Page.World;
|
Engine.currentPage = Engine.Page.World;
|
||||||
|
document.getElementById("city-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadCreateProgramContent: function() {
|
loadCreateProgramContent: function() {
|
||||||
@ -146,6 +216,7 @@ var Engine = {
|
|||||||
Engine.Display.createProgramContent.style.visibility = "visible";
|
Engine.Display.createProgramContent.style.visibility = "visible";
|
||||||
displayCreateProgramContent();
|
displayCreateProgramContent();
|
||||||
Engine.currentPage = Engine.Page.CreateProgram;
|
Engine.currentPage = Engine.Page.CreateProgram;
|
||||||
|
document.getElementById("create-program-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadFactionsContent: function() {
|
loadFactionsContent: function() {
|
||||||
@ -153,6 +224,7 @@ var Engine = {
|
|||||||
Engine.Display.factionsContent.style.visibility = "visible";
|
Engine.Display.factionsContent.style.visibility = "visible";
|
||||||
Engine.displayFactionsInfo();
|
Engine.displayFactionsInfo();
|
||||||
Engine.currentPage = Engine.Page.Factions;
|
Engine.currentPage = Engine.Page.Factions;
|
||||||
|
document.getElementById("factions-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadFactionContent: function() {
|
loadFactionContent: function() {
|
||||||
@ -166,6 +238,7 @@ var Engine = {
|
|||||||
Engine.Display.augmentationsContent.style.visibility = "visible";
|
Engine.Display.augmentationsContent.style.visibility = "visible";
|
||||||
Engine.displayAugmentationsContent();
|
Engine.displayAugmentationsContent();
|
||||||
Engine.currentPage = Engine.Page.Augmentations;
|
Engine.currentPage = Engine.Page.Augmentations;
|
||||||
|
document.getElementById("augmentations-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadTutorialContent: function() {
|
loadTutorialContent: function() {
|
||||||
@ -173,6 +246,7 @@ var Engine = {
|
|||||||
Engine.Display.tutorialContent.style.visibility = "visible";
|
Engine.Display.tutorialContent.style.visibility = "visible";
|
||||||
Engine.displayTutorialContent();
|
Engine.displayTutorialContent();
|
||||||
Engine.currentPage = Engine.Page.Tutorial;
|
Engine.currentPage = Engine.Page.Tutorial;
|
||||||
|
document.getElementById("tutorial-menu-link").classList.add("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
loadLocationContent: function() {
|
loadLocationContent: function() {
|
||||||
@ -182,6 +256,43 @@ var Engine = {
|
|||||||
Engine.currentPage = Engine.Page.Location;
|
Engine.currentPage = Engine.Page.Location;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadTravelContent: function() {
|
||||||
|
switch(Player.city) {
|
||||||
|
case Locations.Aevum:
|
||||||
|
Player.location = Locations.AevumTravelAgency;
|
||||||
|
break;
|
||||||
|
case Locations.Chongqing:
|
||||||
|
Player.location = Locations.ChongqingTravelAgency;
|
||||||
|
break;
|
||||||
|
case Locations.Sector12:
|
||||||
|
Player.location = Locations.Sector12TravelAgency;
|
||||||
|
break;
|
||||||
|
case Locations.NewTokyo:
|
||||||
|
Player.location = Locations.NewTokyoTravelAgency;
|
||||||
|
break;
|
||||||
|
case Locations.Ishima:
|
||||||
|
Player.location = Locations.IshimaTravelAgency;
|
||||||
|
break;
|
||||||
|
case Locations.Volhaven:
|
||||||
|
Player.location = Locations.VolhavenTravelAgency;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dialogBoxCreate("ERROR: Invalid city. This is a bug please contact game dev");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Engine.loadLocationContent();
|
||||||
|
},
|
||||||
|
|
||||||
|
loadJobContent: function() {
|
||||||
|
if (Player.companyName == "") {
|
||||||
|
dialogBoxCreate("You do not currently have a job! You can visit various companies " +
|
||||||
|
"in the city and try to find a job.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Player.location = Player.companyName;
|
||||||
|
Engine.loadLocationContent();
|
||||||
|
},
|
||||||
|
|
||||||
loadWorkInProgressContent: function() {
|
loadWorkInProgressContent: function() {
|
||||||
Engine.hideAllContent();
|
Engine.hideAllContent();
|
||||||
var mainMenu = document.getElementById("mainmenu-container");
|
var mainMenu = document.getElementById("mainmenu-container");
|
||||||
@ -238,6 +349,19 @@ var Engine = {
|
|||||||
Engine.newTokyoLocationsList.style.display = "none";
|
Engine.newTokyoLocationsList.style.display = "none";
|
||||||
Engine.ishimaLocationsList.style.display = "none";
|
Engine.ishimaLocationsList.style.display = "none";
|
||||||
Engine.volhavenLocationsList.style.display = "none";
|
Engine.volhavenLocationsList.style.display = "none";
|
||||||
|
|
||||||
|
//Make nav menu tabs inactive
|
||||||
|
document.getElementById("terminal-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("create-script-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("active-scripts-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("create-program-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("stats-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("factions-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("augmentations-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("hacknet-nodes-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("city-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("tutorial-menu-link").classList.remove("active");
|
||||||
|
document.getElementById("options-menu-link").classList.remove("active");
|
||||||
},
|
},
|
||||||
|
|
||||||
displayCharacterOverviewInfo: function() {
|
displayCharacterOverviewInfo: function() {
|
||||||
@ -568,7 +692,7 @@ var Engine = {
|
|||||||
createProgramNotifications: 10, //Checks whether any programs can be created and notifies
|
createProgramNotifications: 10, //Checks whether any programs can be created and notifies
|
||||||
checkFactionInvitations: 100, //Check whether you qualify for any faction invitations every 5 minutes
|
checkFactionInvitations: 100, //Check whether you qualify for any faction invitations every 5 minutes
|
||||||
passiveFactionGrowth: 600,
|
passiveFactionGrowth: 600,
|
||||||
messages: 300,
|
messages: 150,
|
||||||
stockTick: 30, //Update stock prices
|
stockTick: 30, //Update stock prices
|
||||||
sCr: 1500,
|
sCr: 1500,
|
||||||
updateScriptEditorDisplay: 5,
|
updateScriptEditorDisplay: 5,
|
||||||
@ -644,7 +768,7 @@ var Engine = {
|
|||||||
|
|
||||||
if (Engine.Counters.messages <= 0) {
|
if (Engine.Counters.messages <= 0) {
|
||||||
checkForMessagesToSend();
|
checkForMessagesToSend();
|
||||||
Engine.Counters.messages = 300;
|
Engine.Counters.messages = 150;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Engine.Counters.stockTick <= 0) {
|
if (Engine.Counters.stockTick <= 0) {
|
||||||
@ -657,17 +781,7 @@ var Engine = {
|
|||||||
if (Engine.Counters.sCr <= 0) {
|
if (Engine.Counters.sCr <= 0) {
|
||||||
//Assume 4Sig will always indicate state of market
|
//Assume 4Sig will always indicate state of market
|
||||||
if (Player.hasWseAccount) {
|
if (Player.hasWseAccount) {
|
||||||
console.log("Determining stock market cycle");
|
stockMarketCycle();
|
||||||
var thresh = 0.66;
|
|
||||||
var stock = StockMarket[Locations.Sector12FourSigma];
|
|
||||||
if (stock == null) {
|
|
||||||
console.log("ERR: Could not find 4Sigma stock");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (stock.b) {thresh = 0.34;}
|
|
||||||
if (Math.random() < thresh) {
|
|
||||||
stockMarketCycle();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Engine.Counters.sCr = 1500;
|
Engine.Counters.sCr = 1500;
|
||||||
}
|
}
|
||||||
@ -732,7 +846,37 @@ var Engine = {
|
|||||||
}, 3000);
|
}, 3000);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
displayLoadingScreen: function() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
removeLoadingScreen: function() {
|
||||||
|
var loader = document.getElementById("loader");
|
||||||
|
if (!loader) {return;}
|
||||||
|
while(loader.firstChild) {
|
||||||
|
loader.removeChild(loader.firstChild);
|
||||||
|
}
|
||||||
|
loader.parentNode.removeChild(loader);
|
||||||
|
document.getElementById("entire-game-container").style.visibility = "visible";
|
||||||
|
},
|
||||||
|
|
||||||
load: function() {
|
load: function() {
|
||||||
|
//Initialize main menu accordion panels to all start as "open"
|
||||||
|
var terminal = document.getElementById("terminal-tab");
|
||||||
|
var createScript = document.getElementById("create-script-tab");
|
||||||
|
var activeScripts = document.getElementById("active-scripts-tab");
|
||||||
|
var createProgram = document.getElementById("create-program-tab");
|
||||||
|
var stats = document.getElementById("stats-tab");
|
||||||
|
var factions = document.getElementById("factions-tab");
|
||||||
|
var augmentations = document.getElementById("augmentations-tab");
|
||||||
|
var hacknetnodes = document.getElementById("hacknet-nodes-tab");
|
||||||
|
var city = document.getElementById("city-tab");
|
||||||
|
var travel = document.getElementById("travel-tab");
|
||||||
|
var job = document.getElementById("job-tab");
|
||||||
|
var tutorial = document.getElementById("tutorial-tab");
|
||||||
|
var options = document.getElementById("options-tab");
|
||||||
|
|
||||||
|
|
||||||
//Load game from save or create new game
|
//Load game from save or create new game
|
||||||
if (loadGame(saveObject)) {
|
if (loadGame(saveObject)) {
|
||||||
console.log("Loaded game from save");
|
console.log("Loaded game from save");
|
||||||
@ -784,9 +928,50 @@ var Engine = {
|
|||||||
|
|
||||||
Player.lastUpdate = Engine._lastUpdate;
|
Player.lastUpdate = Engine._lastUpdate;
|
||||||
Engine.start(); //Run main game loop and Scripts loop
|
Engine.start(); //Run main game loop and Scripts loop
|
||||||
|
Engine.removeLoadingScreen();
|
||||||
dialogBoxCreate("While you were offline, your scripts generated $" +
|
dialogBoxCreate("While you were offline, your scripts generated $" +
|
||||||
formatNumber(offlineProductionFromScripts, 2) + " and your Hacknet Nodes generated $" +
|
formatNumber(offlineProductionFromScripts, 2) + " and your Hacknet Nodes generated $" +
|
||||||
formatNumber(offlineProductionFromHacknetNodes, 2));
|
formatNumber(offlineProductionFromHacknetNodes, 2));
|
||||||
|
//Close main menu accordions for loaded game
|
||||||
|
terminal.style.maxHeight = null;
|
||||||
|
terminal.style.opacity = 0;
|
||||||
|
terminal.style.pointerEvents = "none";
|
||||||
|
createScript.style.maxHeight = null;
|
||||||
|
createScript.style.opacity = 0;
|
||||||
|
createScript.style.pointerEvents = "none";
|
||||||
|
activeScripts.style.maxHeight = null;
|
||||||
|
activeScripts.style.opacity = 0;
|
||||||
|
activeScripts.style.pointerEvents = "none";
|
||||||
|
createProgram.style.maxHeight = null;
|
||||||
|
createProgram.style.opacity = 0;
|
||||||
|
createProgram.style.pointerEvents = "none";
|
||||||
|
stats.style.maxHeight = null;
|
||||||
|
stats.style.opacity = 0;
|
||||||
|
stats.style.pointerEvents = "none";
|
||||||
|
factions.style.maxHeight = null;
|
||||||
|
factions.style.opacity = 0;
|
||||||
|
factions.style.pointerEvents = "none";
|
||||||
|
augmentations.style.maxHeight = null;
|
||||||
|
augmentations.style.opacity = 0;
|
||||||
|
augmentations.style.pointerEvents = "none";
|
||||||
|
hacknetnodes.style.maxHeight = null;
|
||||||
|
hacknetnodes.style.opacity = 0;
|
||||||
|
hacknetnodes.style.pointerEvents = "none";
|
||||||
|
city.style.maxHeight = null;
|
||||||
|
city.style.opacity = 0;
|
||||||
|
city.style.pointerEvents = "none";
|
||||||
|
travel.style.maxHeight = null;
|
||||||
|
travel.style.opacity = 0;
|
||||||
|
travel.style.pointerEvents = "none";
|
||||||
|
job.style.maxHeight = null;
|
||||||
|
job.style.opacity = 0;
|
||||||
|
job.style.pointerEvents = "none";
|
||||||
|
tutorial.style.maxHeight = null;
|
||||||
|
tutorial.style.opacity = 0;
|
||||||
|
tutorial.style.pointerEvents = "none";
|
||||||
|
options.style.maxHeight = null;
|
||||||
|
options.style.opacity = 0;
|
||||||
|
options.style.pointerEvents = "none";
|
||||||
} else {
|
} else {
|
||||||
//No save found, start new game
|
//No save found, start new game
|
||||||
console.log("Initializing new game");
|
console.log("Initializing new game");
|
||||||
@ -802,9 +987,48 @@ var Engine = {
|
|||||||
initMessages();
|
initMessages();
|
||||||
initStockSymbols();
|
initStockSymbols();
|
||||||
|
|
||||||
|
//Open main menu accordions for new game
|
||||||
|
//Main menu accordions
|
||||||
|
var hackingHdr = document.getElementById("hacking-menu-header");
|
||||||
|
hackingHdr.classList.toggle("opened");
|
||||||
|
var characterHdr = document.getElementById("character-menu-header");
|
||||||
|
characterHdr.classList.toggle("opened");
|
||||||
|
var worldHdr = document.getElementById("world-menu-header");
|
||||||
|
worldHdr.classList.toggle("opened");
|
||||||
|
var helpHdr = document.getElementById("help-menu-header");
|
||||||
|
helpHdr.classList.toggle("opened");
|
||||||
|
terminal.style.maxHeight = terminal.scrollHeight + "px";
|
||||||
|
terminal.style.display = "block";
|
||||||
|
createScript.style.maxHeight = createScript.scrollHeight + "px";
|
||||||
|
createScript.style.display = "block";
|
||||||
|
activeScripts.style.maxHeight = activeScripts.scrollHeight + "px";
|
||||||
|
activeScripts.style.display = "block";
|
||||||
|
createProgram.style.maxHeight = createProgram.scrollHeight + "px";
|
||||||
|
createProgram.style.display = "block";
|
||||||
|
stats.style.maxHeight = stats.scrollHeight + "px";
|
||||||
|
stats.style.display = "block";
|
||||||
|
factions.style.maxHeight = factions.scrollHeight + "px";
|
||||||
|
factions.style.display = "block";
|
||||||
|
augmentations.style.maxHeight = augmentations.scrollHeight + "px";
|
||||||
|
augmentations.style.display = "block";
|
||||||
|
hacknetnodes.style.maxHeight = hacknetnodes.scrollHeight + "px";
|
||||||
|
hacknetnodes.style.display = "block";
|
||||||
|
city.style.maxHeight = city.scrollHeight + "px";
|
||||||
|
city.style.display = "block";
|
||||||
|
travel.style.maxHeight = travel.scrollHeight + "px";
|
||||||
|
travel.style.display = "block";
|
||||||
|
job.style.maxHeight = job.scrollHeight + "px";
|
||||||
|
job.style.display = "block";
|
||||||
|
tutorial.style.maxHeight = tutorial.scrollHeight + "px";
|
||||||
|
tutorial.style.display = "block";
|
||||||
|
options.style.maxHeight = options.scrollHeight + "px";
|
||||||
|
options.style.display = "block";
|
||||||
|
|
||||||
//Start interactive tutorial
|
//Start interactive tutorial
|
||||||
iTutorialStart();
|
iTutorialStart();
|
||||||
|
Engine.removeLoadingScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisplayElements: function() {
|
setDisplayElements: function() {
|
||||||
@ -941,6 +1165,222 @@ var Engine = {
|
|||||||
|
|
||||||
/* Initialization */
|
/* Initialization */
|
||||||
init: function() {
|
init: function() {
|
||||||
|
//Main menu accordions
|
||||||
|
var hackingHdr = document.getElementById("hacking-menu-header");
|
||||||
|
//hackingHdr.classList.toggle("opened");
|
||||||
|
var characterHdr = document.getElementById("character-menu-header");
|
||||||
|
//characterHdr.classList.toggle("opened");
|
||||||
|
var worldHdr = document.getElementById("world-menu-header");
|
||||||
|
//worldHdr.classList.toggle("opened");
|
||||||
|
var helpHdr = document.getElementById("help-menu-header");
|
||||||
|
//helpHdr.classList.toggle("opened");
|
||||||
|
|
||||||
|
hackingHdr.onclick = function() {
|
||||||
|
var terminal = document.getElementById("terminal-tab");
|
||||||
|
var terminalLink = document.getElementById("terminal-menu-link");
|
||||||
|
var createScript = document.getElementById("create-script-tab");
|
||||||
|
var createScriptLink = document.getElementById("create-script-menu-link");
|
||||||
|
var activeScripts = document.getElementById("active-scripts-tab");
|
||||||
|
var activeScriptsLink = document.getElementById("active-scripts-menu-link");
|
||||||
|
var createProgram = document.getElementById("create-program-tab");
|
||||||
|
var createProgramLink = document.getElementById("create-program-menu-link");
|
||||||
|
var createProgramNot = document.getElementById("create-program-notification");
|
||||||
|
this.classList.toggle("opened");
|
||||||
|
if (terminal.style.maxHeight) {
|
||||||
|
terminal.style.opacity = 0;
|
||||||
|
terminal.style.maxHeight = null;
|
||||||
|
terminalLink.style.opacity = 0;
|
||||||
|
terminalLink.style.maxHeight = null;
|
||||||
|
terminalLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
createScript.style.opacity = 0;
|
||||||
|
createScript.style.maxHeight = null;
|
||||||
|
createScriptLink.style.opacity = 0;
|
||||||
|
createScriptLink.style.maxHeight = null;
|
||||||
|
createScriptLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
activeScripts.style.opacity = 0;
|
||||||
|
activeScripts.style.maxHeight = null;
|
||||||
|
activeScriptsLink.style.opacity = 0;
|
||||||
|
activeScriptsLink.style.maxHeight = null;
|
||||||
|
activeScriptsLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
createProgram.style.opacity = 0;
|
||||||
|
createProgram.style.maxHeight = null;
|
||||||
|
createProgramLink.style.opacity = 0;
|
||||||
|
createProgramLink.style.maxHeight = null;
|
||||||
|
createProgramLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
createProgramNot.style.display = "none";
|
||||||
|
} else {
|
||||||
|
terminal.style.maxHeight = terminal.scrollHeight + "px";
|
||||||
|
terminal.style.opacity = 1;
|
||||||
|
terminalLink.style.maxHeight = terminalLink.scrollHeight + "px";
|
||||||
|
terminalLink.style.opacity = 1;
|
||||||
|
terminalLink.style.pointerEvents = "auto";
|
||||||
|
|
||||||
|
createScript.style.maxHeight = createScript.scrollHeight + "px";
|
||||||
|
createScript.style.opacity = 1;
|
||||||
|
createScriptLink.style.maxHeight = createScriptLink.scrollHeight + "px";
|
||||||
|
createScriptLink.style.opacity = 1;
|
||||||
|
createScriptLink.style.pointerEvents = "auto";
|
||||||
|
|
||||||
|
activeScripts.style.maxHeight = activeScripts.scrollHeight + "px";
|
||||||
|
activeScripts.style.opacity = 1;
|
||||||
|
activeScriptsLink.style.maxHeight = activeScriptsLink.scrollHeight + "px";
|
||||||
|
activeScriptsLink.style.opacity = 1;
|
||||||
|
activeScriptsLink.style.pointerEvents = "auto";
|
||||||
|
|
||||||
|
createProgram.style.maxHeight = createProgram.scrollHeight + "px";
|
||||||
|
createProgram.style.opacity = 1;
|
||||||
|
createProgramLink.style.maxHeight = createProgramLink.scrollHeight + "px";
|
||||||
|
createProgramLink.style.opacity = 1;
|
||||||
|
createProgramLink.style.pointerEvents = "auto";
|
||||||
|
createProgramNot.style.display = "block"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
characterHdr.onclick = function() {
|
||||||
|
var stats = document.getElementById("stats-tab");
|
||||||
|
var statsLink = document.getElementById("stats-menu-link");
|
||||||
|
var factions = document.getElementById("factions-tab");
|
||||||
|
var factionsLink = document.getElementById("factions-menu-link");
|
||||||
|
var augmentations = document.getElementById("augmentations-tab");
|
||||||
|
var augmentationsLink = document.getElementById("augmentations-menu-link");
|
||||||
|
var hacknetnodes = document.getElementById("hacknet-nodes-tab");
|
||||||
|
var hacknetnodesLink = document.getElementById("hacknet-nodes-menu-link");
|
||||||
|
this.classList.toggle("opened");
|
||||||
|
if (stats.style.maxHeight) {
|
||||||
|
stats.style.opacity = 0;
|
||||||
|
stats.style.maxHeight = null;
|
||||||
|
statsLink.style.opacity = 0;
|
||||||
|
statsLink.style.maxHeight = null;
|
||||||
|
statsLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
factions.style.opacity = 0;
|
||||||
|
factions.style.maxHeight = null;
|
||||||
|
factionsLink.style.opacity = 0;
|
||||||
|
factionsLink.style.maxHeight = null;
|
||||||
|
factionsLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
augmentations.style.opacity = 0;
|
||||||
|
augmentations.style.maxHeight = null;
|
||||||
|
augmentationsLink.style.opacity = 0;
|
||||||
|
augmentationsLink.style.maxHeight = null;
|
||||||
|
augmentationsLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
hacknetnodes.style.opacity = 0;
|
||||||
|
hacknetnodes.style.maxHeight = null;
|
||||||
|
hacknetnodesLink.style.opacity = 0;
|
||||||
|
hacknetnodesLink.style.maxHeight = null;
|
||||||
|
hacknetnodesLink.style.pointerEvents = "none";
|
||||||
|
} else {
|
||||||
|
stats.style.maxHeight = stats.scrollHeight + "px";
|
||||||
|
stats.style.opacity = 1;
|
||||||
|
statsLink.style.maxHeight = statsLink.scrollHeight + "px";
|
||||||
|
statsLink.style.opacity = 1;
|
||||||
|
statsLink.style.pointerEvents = "auto";
|
||||||
|
|
||||||
|
factions.style.maxHeight = factions.scrollHeight + "px";
|
||||||
|
factions.style.opacity = 1;
|
||||||
|
factionsLink.style.maxHeight = factionsLink.scrollHeight + "px";
|
||||||
|
factionsLink.style.opacity = 1;
|
||||||
|
factionsLink.style.pointerEvents = "auto";
|
||||||
|
|
||||||
|
augmentations.style.maxHeight = augmentations.scrollHeight + "px";
|
||||||
|
augmentations.style.opacity = 1;
|
||||||
|
augmentationsLink.style.maxHeight = augmentationsLink.scrollHeight + "px";
|
||||||
|
augmentationsLink.style.opacity = 1;
|
||||||
|
augmentationsLink.style.pointerEvents = "auto";
|
||||||
|
|
||||||
|
hacknetnodes.style.maxHeight = hacknetnodes.scrollHeight + "px";
|
||||||
|
hacknetnodes.style.opacity = 1;
|
||||||
|
hacknetnodesLink.style.maxHeight = hacknetnodesLink.scrollHeight + "px";
|
||||||
|
hacknetnodesLink.style.opacity = 1;
|
||||||
|
hacknetnodesLink.style.pointerEvents = "auto";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
worldHdr.onclick = function() {
|
||||||
|
var city = document.getElementById("city-tab");
|
||||||
|
var cityLink = document.getElementById("city-menu-link");
|
||||||
|
var travel = document.getElementById("travel-tab");
|
||||||
|
var travelLink = document.getElementById("travel-menu-link");
|
||||||
|
var job = document.getElementById("job-tab");
|
||||||
|
var jobLink = document.getElementById("job-menu-link");
|
||||||
|
this.classList.toggle("opened");
|
||||||
|
if (city.style.maxHeight) {
|
||||||
|
city.style.opacity = 0;
|
||||||
|
city.style.maxHeight = null;
|
||||||
|
cityLink.style.opacity = 0;
|
||||||
|
cityLink.style.maxHeight = null;
|
||||||
|
cityLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
travel.style.opacity = 0;
|
||||||
|
travel.style.maxHeight = null;
|
||||||
|
travelLink.style.opacity = 0;
|
||||||
|
travelLink.style.maxHeight = null;
|
||||||
|
travelLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
job.style.opacity = 0;
|
||||||
|
job.style.maxHeight = null;
|
||||||
|
jobLink.style.opacity = 0;
|
||||||
|
jobLink.style.maxHeight = null;
|
||||||
|
jobLink.style.pointerEvents = "none";
|
||||||
|
} else {
|
||||||
|
city.style.maxHeight = city.scrollHeight + "px";
|
||||||
|
city.style.opacity = 1;
|
||||||
|
cityLink.style.maxHeight = cityLink.scrollHeight + "px";
|
||||||
|
cityLink.style.opacity = 1;
|
||||||
|
cityLink.style.pointerEvents = "auto";
|
||||||
|
|
||||||
|
travel.style.maxHeight = travel.scrollHeight + "px";
|
||||||
|
travel.style.opacity = 1;
|
||||||
|
travelLink.style.maxHeight = travelLink.scrollHeight + "px";
|
||||||
|
travelLink.style.opacity = 1;
|
||||||
|
travelLink.style.pointerEvents = "auto";
|
||||||
|
|
||||||
|
job.style.maxHeight = job.scrollHeight + "px";
|
||||||
|
job.style.opacity = 1;
|
||||||
|
jobLink.style.maxHeight = jobLink.scrollHeight + "px";
|
||||||
|
jobLink.style.opacity = 1;
|
||||||
|
jobLink.style.pointerEvents = "auto";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
helpHdr.onclick = function() {
|
||||||
|
var tutorial = document.getElementById("tutorial-tab");
|
||||||
|
var tutorialLink = document.getElementById("tutorial-menu-link");
|
||||||
|
var options = document.getElementById("options-tab");
|
||||||
|
var optionsLink = document.getElementById("options-menu-link");
|
||||||
|
this.classList.toggle("opened");
|
||||||
|
if (tutorial.style.maxHeight) {
|
||||||
|
tutorial.style.opacity = 0;
|
||||||
|
tutorial.style.maxHeight = null;
|
||||||
|
tutorialLink.style.opacity = 0;
|
||||||
|
tutorialLink.style.maxHeight = null;
|
||||||
|
tutorialLink.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
options.style.opacity = 0;
|
||||||
|
options.style.maxHeight = null;
|
||||||
|
optionsLink.style.opacity = 0;
|
||||||
|
optionsLink.style.maxHeight = null;
|
||||||
|
optionsLink.style.pointerEvents = "none";
|
||||||
|
} else {
|
||||||
|
tutorial.style.maxHeight = tutorial.scrollHeight + "px";
|
||||||
|
tutorial.style.opacity = 1;
|
||||||
|
tutorialLink.style.maxHeight = tutorialLink.scrollHeight + "px";
|
||||||
|
tutorialLink.style.opacity = 1;
|
||||||
|
tutorialLink.style.pointerEvents = "auto";
|
||||||
|
|
||||||
|
options.style.maxHeight = options.scrollHeight + "px";
|
||||||
|
options.style.opacity = 1;
|
||||||
|
optionsLink.style.maxHeight = optionsLink.scrollHeight + "px";
|
||||||
|
optionsLink.style.opacity = 1;
|
||||||
|
optionsLink.style.pointerEvents = "auto";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Main menu buttons and content
|
//Main menu buttons and content
|
||||||
Engine.Clickables.terminalMainMenuButton = clearEventListeners("terminal-menu-link");
|
Engine.Clickables.terminalMainMenuButton = clearEventListeners("terminal-menu-link");
|
||||||
Engine.Clickables.terminalMainMenuButton.addEventListener("click", function() {
|
Engine.Clickables.terminalMainMenuButton.addEventListener("click", function() {
|
||||||
@ -948,7 +1388,7 @@ var Engine = {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
Engine.Clickables.characterMainMenuButton = clearEventListeners("character-menu-link");
|
Engine.Clickables.characterMainMenuButton = clearEventListeners("stats-menu-link");
|
||||||
Engine.Clickables.characterMainMenuButton.addEventListener("click", function() {
|
Engine.Clickables.characterMainMenuButton.addEventListener("click", function() {
|
||||||
Engine.loadCharacterContent();
|
Engine.loadCharacterContent();
|
||||||
return false;
|
return false;
|
||||||
@ -972,12 +1412,25 @@ var Engine = {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
Engine.Clickables.worldMainMenuButton = clearEventListeners("world-menu-link");
|
Engine.Clickables.worldMainMenuButton = clearEventListeners("city-menu-link");
|
||||||
Engine.Clickables.worldMainMenuButton.addEventListener("click", function() {
|
Engine.Clickables.worldMainMenuButton.addEventListener("click", function() {
|
||||||
Engine.loadWorldContent();
|
Engine.loadWorldContent();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Engine.Clickables.travelMainMenuButton = clearEventListeners("travel-menu-link");
|
||||||
|
Engine.Clickables.travelMainMenuButton.addEventListener("click", function() {
|
||||||
|
Engine.loadTravelContent();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
Engine.Clickables.jobMainMenuButton = clearEventListeners("job-menu-link");
|
||||||
|
Engine.Clickables.jobMainMenuButton.addEventListener("click", function() {
|
||||||
|
Engine.loadJobContent();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Engine.Clickables.createProgramMainMenuButton = clearEventListeners("create-program-menu-link");
|
Engine.Clickables.createProgramMainMenuButton = clearEventListeners("create-program-menu-link");
|
||||||
Engine.Clickables.createProgramMainMenuButton.addEventListener("click", function() {
|
Engine.Clickables.createProgramMainMenuButton.addEventListener("click", function() {
|
||||||
Engine.loadCreateProgramContent();
|
Engine.loadCreateProgramContent();
|
||||||
@ -1034,15 +1487,6 @@ var Engine = {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//Script Editor Netscript documentation button
|
|
||||||
var netscriptDocButton = document.getElementById("script-editor-netscript-doc-button");
|
|
||||||
netscriptDocButton.addEventListener("click", function() {
|
|
||||||
Engine.loadTutorialContent();
|
|
||||||
Engine.displayTutorialContent();
|
|
||||||
Engine.displayTutorialPage(CONSTANTS.TutorialNetscriptText);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
//Create Program buttons
|
//Create Program buttons
|
||||||
initCreateProgramButtons();
|
initCreateProgramButtons();
|
||||||
|
|
||||||
@ -1076,20 +1520,13 @@ var Engine = {
|
|||||||
|
|
||||||
//Remove classes from links (they might be set from tutorial)
|
//Remove classes from links (they might be set from tutorial)
|
||||||
document.getElementById("terminal-menu-link").removeAttribute("class");
|
document.getElementById("terminal-menu-link").removeAttribute("class");
|
||||||
document.getElementById("character-menu-link").removeAttribute("class");
|
document.getElementById("stats-menu-link").removeAttribute("class");
|
||||||
document.getElementById("create-script-menu-link").removeAttribute("class");
|
document.getElementById("create-script-menu-link").removeAttribute("class");
|
||||||
document.getElementById("active-scripts-menu-link").removeAttribute("class");
|
document.getElementById("active-scripts-menu-link").removeAttribute("class");
|
||||||
document.getElementById("hacknet-nodes-menu-link").removeAttribute("class");
|
document.getElementById("hacknet-nodes-menu-link").removeAttribute("class");
|
||||||
document.getElementById("world-menu-link").removeAttribute("class");
|
document.getElementById("city-menu-link").removeAttribute("class");
|
||||||
document.getElementById("tutorial-menu-link").removeAttribute("class");
|
document.getElementById("tutorial-menu-link").removeAttribute("class");
|
||||||
|
|
||||||
//Changelog
|
|
||||||
document.getElementById("changelog-link").addEventListener("click", function() {
|
|
||||||
gameOptionsBoxClose();
|
|
||||||
dialogBoxCreate(CONSTANTS.Changelog);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
//DEBUG Delete active Scripts on home
|
//DEBUG Delete active Scripts on home
|
||||||
document.getElementById("debug-delete-scripts-link").addEventListener("click", function() {
|
document.getElementById("debug-delete-scripts-link").addEventListener("click", function() {
|
||||||
console.log("Deleting running scripts on home computer");
|
console.log("Deleting running scripts on home computer");
|
||||||
@ -1118,6 +1555,7 @@ var Engine = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
|
Engine.displayLoadingScreen();
|
||||||
Engine.load();
|
Engine.load();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -32,11 +32,12 @@ infiltrationBoxCreate = function(inst) {
|
|||||||
formatNumber(inst.chaExpGained, 3) + " cha exp<br>");
|
formatNumber(inst.chaExpGained, 3) + " cha exp<br>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var facValue = totalValue * Player.faction_rep_mult * 1.2
|
||||||
var moneyValue = totalValue * CONSTANTS.InfiltrationMoneyValue;
|
var moneyValue = totalValue * CONSTANTS.InfiltrationMoneyValue;
|
||||||
infiltrationSetText("You can sell the classified documents and secrets " +
|
infiltrationSetText("You can sell the classified documents and secrets " +
|
||||||
"you stole from " + inst.companyName + " for $" +
|
"you stole from " + inst.companyName + " for $" +
|
||||||
formatNumber(moneyValue, 2) + " on the black market or you can give it " +
|
formatNumber(moneyValue, 2) + " on the black market or you can give it " +
|
||||||
"to a faction to gain " + formatNumber(totalValue, 3) + " reputation with " +
|
"to a faction to gain " + formatNumber(facValue, 3) + " reputation with " +
|
||||||
"that faction.");
|
"that faction.");
|
||||||
var selector = document.getElementById("infiltration-faction-select");
|
var selector = document.getElementById("infiltration-faction-select");
|
||||||
selector.innerHTML = "";
|
selector.innerHTML = "";
|
||||||
@ -72,9 +73,9 @@ infiltrationBoxCreate = function(inst) {
|
|||||||
dialogBoxCreate("Error finding faction. This is a bug please report to developer");
|
dialogBoxCreate("Error finding faction. This is a bug please report to developer");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
faction.playerReputation += totalValue;
|
faction.playerReputation += facValue;
|
||||||
dialogBoxCreate("You gave the classified information you stole from " + inst.companyName +
|
dialogBoxCreate("You gave the classified information you stole from " + inst.companyName +
|
||||||
" to " + facName + " and gained " + formatNumber(totalValue, 3) + " reputation with the faction. <br><br>" +
|
" to " + facName + " and gained " + formatNumber(facValue, 3) + " reputation with the faction. <br><br>" +
|
||||||
"You gained:<br>" +
|
"You gained:<br>" +
|
||||||
formatNumber(inst.hackingExpGained, 3) + " hacking exp<br>" +
|
formatNumber(inst.hackingExpGained, 3) + " hacking exp<br>" +
|
||||||
formatNumber(inst.strExpGained, 3) + " str exp<br>" +
|
formatNumber(inst.strExpGained, 3) + " str exp<br>" +
|
||||||
|
@ -36,7 +36,7 @@ purchaseRamForHomeBoxCreate = function() {
|
|||||||
//Calculate cost
|
//Calculate cost
|
||||||
//Have cost increase by some percentage each time RAM has been upgraded
|
//Have cost increase by some percentage each time RAM has been upgraded
|
||||||
var cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome;
|
var cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome;
|
||||||
var mult = Math.pow(1.52, numUpgrades);
|
var mult = Math.pow(1.55, numUpgrades);
|
||||||
cost = cost * mult;
|
cost = cost * mult;
|
||||||
|
|
||||||
purchaseRamForHomeBoxSetText("Would you like to purchase additional RAM for your home computer? <br><br>" +
|
purchaseRamForHomeBoxSetText("Would you like to purchase additional RAM for your home computer? <br><br>" +
|
||||||
|
Loading…
Reference in New Issue
Block a user