From af584e8c873601e6f1b0820430be3ee8e30c10ea Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Tue, 9 Mar 2021 23:22:05 -0500 Subject: [PATCH] Removed CharacterInfo maximum hacknet, styling in the options, comments in exploits --- css/styles.scss | 35 ++++++++++++++++++++++++++++ src/Exploits/Exploit.ts | 16 +++++++++++-- src/Hacknet/HacknetHelpers.jsx | 2 +- src/index.html | 28 +++++++++++------------ src/ui/CharacterInfo.tsx | 3 +-- src/ui/setSettingsLabels.js | 42 ++++++++++++++++++++-------------- 6 files changed, 90 insertions(+), 36 deletions(-) diff --git a/css/styles.scss b/css/styles.scss index ea543e3e9..b6b876b1d 100644 --- a/css/styles.scss +++ b/css/styles.scss @@ -359,3 +359,38 @@ a:visited { .smallfont { font-size: $defaultFontSize * 0.8125; } + + +.optionCheckbox { + filter: invert(100%) hue-rotate(0deg) brightness(1.7); + margin: 5px; + float: right; +} + +.optionRange { + -webkit-appearance: none; + background: #777; + outline: none; + opacity: 0.7; + height: 10px; + -webkit-transition: .2s; + transition: opacity .2s; + margin: 3px; +} + + +.optionRange::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 10px; + height: 10px; + background: var(--my-font-color); + cursor: pointer; +} + +.optionRange::-moz-range-thumb { + width: 10px; + height: 10px; + background: var(--my-font-color); + cursor: pointer; +} \ No newline at end of file diff --git a/src/Exploits/Exploit.ts b/src/Exploits/Exploit.ts index 9df93e339..2e687b862 100644 --- a/src/Exploits/Exploit.ts +++ b/src/Exploits/Exploit.ts @@ -1,10 +1,22 @@ /* +The game cannot block every possible exploits. Specially since one of them is +that you can just edit your save file and that's impragmatic to prevent. + +So instead we have source file minus 1. It is not obtained by destroying a +BitNode but instead it is awarded when the player finds innovative ways to break +the game, this serves 2 purpose, [one] the developpers don't have to spend time +trying to implement anti-cheat measures and [two] finding ways to break a +hacking game is very much in the spirit of the game. +Source-File minus 1 is extremely weak because it can be fully level up quickly. */ export enum Exploit { UndocumentedFunctionCall = 'UndocumentedFunctionCall', - EditSaveFile = 'EditSaveFile', - PrototypeTampering = 'PrototypeTampering' + PrototypeTampering = 'PrototypeTampering', + // To the players reading this. Yes you're supposed to add EditSaveFile by + // editing your save file, yes you could add them all, no we don't care + // that's not the point + EditSaveFile = 'EditSaveFile' } const names: { diff --git a/src/Hacknet/HacknetHelpers.jsx b/src/Hacknet/HacknetHelpers.jsx index 6172593e2..b16021858 100644 --- a/src/Hacknet/HacknetHelpers.jsx +++ b/src/Hacknet/HacknetHelpers.jsx @@ -120,7 +120,7 @@ export function getCostOfNextHacknetServer() { const numOwned = Player.hacknetNodes.length; const mult = HacknetServerPurchaseMult; - if (numOwned > MaxNumberHacknetServers) { return Infinity; } + if (numOwned >= MaxNumberHacknetServers) { return Infinity; } return BaseCostForHacknetServer * Math.pow(mult, numOwned) * Player.hacknet_node_purchase_cost_mult; } diff --git a/src/index.html b/src/index.html index 2bf3f9991..fb7af1c5c 100644 --- a/src/index.html +++ b/src/index.html @@ -406,7 +406,7 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %>
-
-
-
-
@@ -467,7 +467,7 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %> and can be viewed with the 'cat' Terminal command. - + @@ -478,7 +478,7 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %> on the screen. Your outstanding faction invites can be viewed in the 'Factions' page. - + @@ -488,7 +488,7 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %> If this is set, the confirmation message before traveling will not show up. You will automatically be deducted the travel cost as soon as you click. - + @@ -499,7 +499,7 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %> If this is set, the confirmation message before buying augmentation will not show up. - + @@ -509,7 +509,7 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %> If this is set, a popup message will no longer be shown when you are hospitalized after taking too much damage. - + @@ -521,7 +521,7 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %> and the "Save and Close (Ctrl + b)" hotkey in the Text Editor. - + diff --git a/src/ui/CharacterInfo.tsx b/src/ui/CharacterInfo.tsx index b50dc5607..4383f24ba 100644 --- a/src/ui/CharacterInfo.tsx +++ b/src/ui/CharacterInfo.tsx @@ -11,7 +11,6 @@ import { SourceFileFlags } from "../SourceFile/SourceFileFlags"; import { getPurchaseServerLimit } from "../Server/ServerPurchases"; import { MaxNumberHacknetServers } from "../Hacknet/HacknetServer"; - export function CharacterInfo(p: IPlayer): React.ReactElement { function LastEmployer(): React.ReactElement { if (p.companyName) { @@ -225,7 +224,7 @@ export function CharacterInfo(p: IPlayer): React.ReactElement { Misc.

Servers owned: {p.purchasedServers.length} / {getPurchaseServerLimit()}
- Hacknet Nodes owned: {p.hacknetNodes.length} / {MaxNumberHacknetServers}
+ Hacknet Nodes owned: {p.hacknetNodes.length}
Augmentations installed: {p.augmentations.length}
Time played since last Augmentation: {convertTimeMsToTimeElapsedString(p.playtimeSinceLastAug)}
diff --git a/src/ui/setSettingsLabels.js b/src/ui/setSettingsLabels.js index 64010fddb..f3b96de1a 100644 --- a/src/ui/setSettingsLabels.js +++ b/src/ui/setSettingsLabels.js @@ -5,17 +5,25 @@ import {numeralWrapper} from "./numeralFormat"; function setSettingsLabels() { - var nsExecTime = document.getElementById("settingsNSExecTimeRangeValLabel"); - var nsLogLimit = document.getElementById("settingsNSLogRangeValLabel"); - var nsPortLimit = document.getElementById("settingsNSPortRangeValLabel"); - var suppressMsgs = document.getElementById("settingsSuppressMessages"); - var suppressFactionInv = document.getElementById("settingsSuppressFactionInvites") - var suppressTravelConfirmation = document.getElementById("settingsSuppressTravelConfirmation"); - var suppressBuyAugmentationConfirmation = document.getElementById("settingsSuppressBuyAugmentationConfirmation"); - var suppressHospitalizationPopup = document.getElementById("settingsSuppressHospitalizationPopup"); - var autosaveInterval = document.getElementById("settingsAutosaveIntervalValLabel"); - var disableHotkeys = document.getElementById("settingsDisableHotkeys"); - var locale = document.getElementById("settingsLocale"); + function setAutosaveLabel(elem) { + if(Settings.AutosaveInterval === 0) { + elem.innerHTML = `disabled`; + } else { + elem.innerHTML = `every ${Settings.AutosaveInterval}s`; + } + } + + const nsExecTime = document.getElementById("settingsNSExecTimeRangeValLabel"); + const nsLogLimit = document.getElementById("settingsNSLogRangeValLabel"); + const nsPortLimit = document.getElementById("settingsNSPortRangeValLabel"); + const suppressMsgs = document.getElementById("settingsSuppressMessages"); + const suppressFactionInv = document.getElementById("settingsSuppressFactionInvites") + const suppressTravelConfirmation = document.getElementById("settingsSuppressTravelConfirmation"); + const suppressBuyAugmentationConfirmation = document.getElementById("settingsSuppressBuyAugmentationConfirmation"); + const suppressHospitalizationPopup = document.getElementById("settingsSuppressHospitalizationPopup"); + const autosaveInterval = document.getElementById("settingsAutosaveIntervalValLabel"); + const disableHotkeys = document.getElementById("settingsDisableHotkeys"); + const locale = document.getElementById("settingsLocale"); //Initialize values on labels nsExecTime.innerHTML = Settings.CodeInstructionRunTime + "ms"; @@ -26,16 +34,16 @@ function setSettingsLabels() { suppressTravelConfirmation.checked = Settings.SuppressTravelConfirmation; suppressBuyAugmentationConfirmation.checked = Settings.SuppressBuyAugmentationConfirmation; suppressHospitalizationPopup.checked = Settings.SuppressHospitalizationPopup; - autosaveInterval.innerHTML = Settings.AutosaveInterval; + setAutosaveLabel(autosaveInterval); disableHotkeys.checked = Settings.DisableHotkeys; locale.value = Settings.Locale; numeralWrapper.updateLocale(Settings.Locale); //Initialize locale //Set handlers for when input changes for sliders - var nsExecTimeInput = document.getElementById("settingsNSExecTimeRangeVal"); - var nsLogRangeInput = document.getElementById("settingsNSLogRangeVal"); - var nsPortRangeInput = document.getElementById("settingsNSPortRangeVal"); - var nsAutosaveIntervalInput = document.getElementById("settingsAutosaveIntervalVal"); + const nsExecTimeInput = document.getElementById("settingsNSExecTimeRangeVal"); + const nsLogRangeInput = document.getElementById("settingsNSLogRangeVal"); + const nsPortRangeInput = document.getElementById("settingsNSPortRangeVal"); + const nsAutosaveIntervalInput = document.getElementById("settingsAutosaveIntervalVal"); nsExecTimeInput.value = Settings.CodeInstructionRunTime; nsLogRangeInput.value = Settings.MaxLogCapacity; nsPortRangeInput.value = Settings.MaxPortCapacity; @@ -57,8 +65,8 @@ function setSettingsLabels() { }; nsAutosaveIntervalInput.oninput = function() { - autosaveInterval.innerHTML = this.value; Settings.AutosaveInterval = Number(this.value); + setAutosaveLabel(autosaveInterval) if (Number(this.value) === 0) { Engine.Counters.autoSaveCounter = Infinity; } else {