From 36e3a3b5d200972a75f3bb88911112703ac70f57 Mon Sep 17 00:00:00 2001 From: Daniel Xie Date: Mon, 3 Jul 2017 14:42:11 -0500 Subject: [PATCH] StockMarket and Infiltration implementations --- css/menupages.css | 86 +++- css/popupboxes.css | 206 ++------- css/styles.css | 8 +- index.html | 116 ++++- src/Augmentations.js | 2 +- src/Company.js | 27 +- src/CompanyJobApplication.js | 2 +- src/Constants.js | 124 ++++-- src/Infiltration.js | 796 +++++++++++++++++++++++++++++++++++ src/InteractiveTutorial.js | 2 +- src/Location.js | 179 +++++++- src/NetscriptEvaluator.js | 24 +- src/Player.js | 31 +- src/Prestige.js | 6 + src/SaveObject.js | 25 ++ src/Server.js | 4 +- src/StockMarket.js | 546 ++++++++++++++++++++++++ src/engine.js | 68 ++- utils/InfiltrationBox.js | 90 ++++ 19 files changed, 2037 insertions(+), 305 deletions(-) create mode 100644 src/Infiltration.js create mode 100644 src/StockMarket.js create mode 100644 utils/InfiltrationBox.js diff --git a/css/menupages.css b/css/menupages.css index 34d6162a6..9ed069200 100644 --- a/css/menupages.css +++ b/css/menupages.css @@ -75,7 +75,7 @@ } #script-editor-filename { -background-color: #555; + background-color: #555; display: inline-block; float: center; resize: none; @@ -274,15 +274,9 @@ background-color: #555; padding: 10px; } - -#hacknet-nodes-container li{ - padding: 6px; - margin: 6px; - width: 70%; -} - #hacknet-nodes-text, -#hacknet-nodes-money { +#hacknet-nodes-money, +#hacknet-nodes-container li { width: 70%; margin: 10px; padding: 10px; @@ -344,10 +338,7 @@ background-color: #555; padding-top: 10px; } -#create-program-page-text { - width: 70%; -} - +#create-program-page-text, #create-program-list { width: 70%; } @@ -510,6 +501,12 @@ div.faction-clear { #location-container { position: fixed; padding: 6px; + overflow-x: hidden; +} + +#location-container a { + display:inline-block; + width: 30%; } #location-slums-description { @@ -535,3 +532,66 @@ div.faction-clear { position: fixed; padding: 6px; } +#infiltration-left-panel, +#infiltration-right-panel { + display:inline-block; + border: 1px solid white; + width: 35%; + height: 75%; + top: 10px; + overflow-y: auto; + overflow-x: auto; +} + +#infiltration-faction-select { + color:white; +} + +#infiltration-left-panel p, +#infiltration-right-panel p { + margin: 4px; +} + +#infiltration-buttons .a-link-button { + display:inline; + width: 25%; +} + +/* Stock market */ +#stock-market-container { + position: fixed; + padding: 6px; +} + +#stock-market-container p { + padding: 10px; + margin: 10px; + width: 70%; +} + +#stock-market-container a { + margin: 10px; +} + +.stock-market-qty-input { + border: 1px solid white; + color: var(--my-font-color); + padding: 4px; + margin: 4px; +} + +.stock-market-buy-sell-button { + color: #aaa; + font-size: 16px; + font-weight: bold; + padding: 2px; + margin: 6px; + border: 1px solid white; +} + +.stock-market-buy-sell-button:hover, +.stock-market-buy-sell-button:focus { + color: var(--my-font-color); + text-decoration: none; + cursor: pointer; +} \ No newline at end of file diff --git a/css/popupboxes.css b/css/popupboxes.css index 4c338addd..c204464a0 100644 --- a/css/popupboxes.css +++ b/css/popupboxes.css @@ -5,14 +5,38 @@ z-index: 1; /* Sit on top */ left: 0; top: 0; - width: 100%; /* Full width */ - height: 100%; /* Full height */ + width: 100%; + height: 100%; overflow: auto; /* Enable scroll if needed */ - /*background-color: black; /* Fallback color */ - /*background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ background-color: rbga(var(--my-background-color), 0.4); } +.popup-box-content { + background-color: var(--my-background-color); + margin: 15% auto; + padding: 12px; + border: 5px solid var(--my-highlight-color); + width: 70%; + color: var(--my-font-color); +} + +.popup-box-button { + color: #aaa; + float: right; + font-size: 16px; + font-weight: bold; + padding: 2px; + margin: 6px; + border: 1px solid white; +} + +.popup-box-button:hover, +.popup-box-button:focus { + color: var(--my-font-color); + text-decoration: none; + cursor: pointer; +} + .dialog-box-container, #log-box-container { display: block; @@ -69,207 +93,45 @@ transition: opacity 400ms ease-in; } -#purchase-server-box-content { - background-color: var(--my-background-color); - margin: 15% auto; /* 15% from the top and centered */ - padding: 12px; - border: 5px solid var(--my-highlight-color);; - width: 80%; /* Could be more or less, depending on screen size */ - color: var(--my-font-color); -} - #purchase-server-box-input { color: white; } -#purchase-server-box-confirm, -#purchase-server-box-cancel { - color: #aaa; - float: right; - font-size: 16px; - font-weight: bold; - padding: 2px; - margin: 6px; - border: 1px solid white; -} - -#purchase-server-box-confirm:hover, -#purchase-server-box-confirm:focus { - color: var(--my-font-color); - text-decoration: none; - cursor: pointer; -} - -#purchase-server-box-cancel:hover, -#purchase-server-box-cancel:focus { - color: var(--my-font-color); - text-decoration: none; - cursor: pointer; -} - /* Purchase RAM for Home computer pop-up box */ #purchase-ram-for-home-box-container { transition: opacity 400ms ease-in; } -#purchase-ram-for-home-box-content { - background-color: var(--my-background-color); - margin: 15% auto; /* 15% from the top and centered */ - padding: 12px; - border: 5px solid var(--my-highlight-color); - width: 50%; /* Could be more or less, depending on screen size */ - color: var(--my-font-color); -} - -#purchase-ram-for-home-box-confirm, -#purchase-ram-for-home-box-cancel { - color: #aaa; - float: right; - font-size: 16px; - font-weight: bold; - padding: 2px; - margin: 6px; - border: 1px solid white; -} - -#purchase-ram-for-home-box-confirm:hover, -#purchase-ram-for-home-box-confirm:focus { - color: var(--my-font-color); - text-decoration: none; - cursor: pointer; -} - -#purchase-ram-for-home-box-cancel:hover, -#purchase-ram-for-home-box-cancel:focus { - color: var(--my-font-color); - text-decoration: none; - cursor: pointer; -} - /* Purchase Invitation Box */ #purchase-augmentation-box-container { transition: opacity 400ms ease-in; } -#purchase-augmentation-box-content { - background-color: var(--my-background-color); - margin: 15% auto; /* 15% from the top and centered */ - padding: 8px; - border: 5px solid var(--my-highlight-color);; - width: 80%; /* Could be more or less, depending on screen size */ - color: var(--my-font-color); -} - -#purchase-augmentation-box-confirm, -#purchase-augmentation-box-cancel { - color: #aaa; - float: right; - font-size: 16px; - font-weight: bold; - padding: 4px; - margin: 6px; - border: 1px solid white; -} - -#purchase-augmentation-box-confirm:hover, -#purchase-augmentation-box-confirm:focus { - color: var(--my-font-color); - text-decoration: none; - cursor: pointer; -} - -#purchase-augmentation-box-cancel:hover, -#purchase-augmentation-box-cancel:focus { - color: var(--my-font-color); - text-decoration: none; - cursor: pointer; -} - /* Faction invitation box */ #faction-invitation-box-container { transition: opacity 400ms ease-in; } - -#faction-invitation-box-content { - background-color: var(--my-background-color); - margin: 15% auto; /* 15% from the top and centered */ - padding: 10px; - border: 5px solid var(--my-highlight-color);; - width: 80%; /* Could be more or less, depending on screen size */ - color: var(--my-font-color); -} - #faction-invitation-box-warning { margin: 4px; padding: 4px; } -#faction-invitation-box-yes, -#faction-invitation-box-no { - color: #aaa; - font-size: 20px; - font-weight: bold; - padding: 2px; - margin: 6px; - border: 1px solid white; -} - -#faction-invitation-box-yes:hover, -#faction-invitation-box-yes:focus { - color: white; - text-decoration: none; - cursor: pointer; -} - -#faction-invitation-box-no:hover, -#faction-invitation-box-no:focus { - color: white; - text-decoration: none; - cursor: pointer; -} - - /* Travel Pop-up Box */ #travel-box-container { transition: opacity 400ms ease-in; } -#travel-box-content { - background-color: var(--my-background-color); - margin: 15% auto; /* 15% from the top and centered */ - padding: 10px; - border: 5px solid var(--my-highlight-color);; - width: 50%; /* Could be more or less, depending on screen size */ - color: var(--my-font-color); -} #travel-box-text { margin: 8px; } -#travel-box-confirm, -#travel-box-cancel { - color: #aaa; - float: right; - font-size: 16px; - font-weight: bold; - padding: 2px; - margin: 6px; - border: 1px solid white; -} - -#travel-box-confirm:hover, -#travel-box-confirm:focus { - color: white; - text-decoration: none; - cursor: pointer; -} - -#travel-box-cancel:hover, -#travel-box-cancel:focus { - color: white; - text-decoration: none; - cursor: pointer; +/* Infiltration-box */ +#infiltration-box-sell, +#infiltration-box-faction { + display: block; + padding: 8px; + margin: 8px; } /* Game Options */ diff --git a/css/styles.css b/css/styles.css index f3b8d08d2..47419edb1 100644 --- a/css/styles.css +++ b/css/styles.css @@ -32,7 +32,7 @@ h2 { } ul { - padding: 6px; + padding: 2px; list-style-type: none; } @@ -252,7 +252,7 @@ tr:focus { position: absolute; /* Stay in place */ right: 0; top: 0; - height: 185px; /* Full height */ + height: 195px; /* Full height */ /*margin: 50% auto;*/ padding: 5px; border: 2px solid var(--my-highlight-color); @@ -264,7 +264,7 @@ tr:focus { #character-overview-text { padding: 4px; - margin: 10px; + margin: 8px; color: white; background-color: #444; } @@ -272,7 +272,7 @@ tr:focus { #character-overview-save-button, #character-overview-options-button { color: #aaa; - font-size: 16px; + font-size: 14px; font-weight: bold; -webkit-border-radius: 12px; -moz-border-radius: 12px; diff --git a/index.html b/index.html index 92a07748d..c73b58f79 100644 --- a/index.html +++ b/index.html @@ -26,6 +26,7 @@ + @@ -61,6 +62,8 @@ + + @@ -115,7 +118,7 @@
  • - Augmentations + Augmentations
  • @@ -212,6 +215,9 @@
  • Travel Agency
  • +
  • + Hospital +
  • Summit University
  • @@ -260,6 +266,9 @@
  • Travel Agency
  • +
  • + Hospital +
  • KuaiGong International
  • @@ -275,6 +284,9 @@
  • Travel Agency
  • +
  • + Hospital +
  • Rothman University
  • @@ -329,6 +341,9 @@
  • Travel Agency
  • +
  • + Hospital +
  • DefComm
  • @@ -350,6 +365,9 @@
  • Travel Agency
  • +
  • + Hospital +
  • Storm Technologies
  • @@ -368,6 +386,9 @@
  • Travel Agency
  • +
  • + Hospital +
  • ZB Insitute of Technology
  • @@ -399,6 +420,12 @@ The Slums + + @@ -559,7 +586,8 @@ Scripts on every computer but your home computer
    Purchased servers
    Hacknet Nodes
    - Faction/Company reputation

    + Faction/Company reputation
    + Stocks

    Purchasing an Augmentation lets you start over with the perks and benefits granted by all of the Augmentations you have ever purchased. Also, you will keep any scripts and RAM upgrades on your home computer (but you will lose all programs besides NUKE.exe). @@ -583,7 +611,7 @@ Scripts Netscript Programming Language Traveling - Jobs + Companies and Infiltration Factions Augmentations @@ -649,6 +677,17 @@ Purchase TOR Router - $100,000 Purchase additional RAM for Home computer + + Infiltrate Company + + Infiltrate this company's facility to try and steal their classified secrets! + Warning: You may end up hospitalized if you are unsuccessful! + + + + + Get Treatment for Wounds +

    From here, you can travel to any other city! A ticket costs $200,000. @@ -699,6 +738,35 @@

    + +
    +

    + Welcome to the World Stock Exchange (WSE)!

    + + To begin trading, you must first purchase an account. WSE accounts will persist + after you 'reset' by installing Augmentations. +

    + Buy WSE Account +

    + You can also purchase access to the World Stock Exchange's TIX API! TIX, short for + Trade Information eXchange, is the communications protocol supported by the WSE. +

    + Gaining access to the TIX API lets you write code to build automated trading + systems. In other words, you can create your own algorithmic trading strategies! +

    + If you purchase access to the TIX API, you will retain that access even after + you 'reset' by installing Augmentations. +

    + + Buy Trade Information eXchange (TEX) API Access - COMING SOON + +

    + + +
    + +
    @@ -710,55 +778,67 @@