mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 21:53:50 +01:00
commit
ed49e75d52
5619
dist/engine.bundle.js
vendored
5619
dist/engine.bundle.js
vendored
File diff suppressed because it is too large
Load Diff
5619
dist/tests.bundle.js
vendored
5619
dist/tests.bundle.js
vendored
File diff suppressed because it is too large
Load Diff
@ -744,7 +744,7 @@
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<input type ="range" max="250" min="25"
|
||||
<input type ="range" max="250" min="15"
|
||||
step="1" name="settingsNSExecTimeRangeVal" id="settingsNSExecTimeRangeVal" value="100">
|
||||
</input>
|
||||
<em id="settingsNSExecTimeRangeValLabel" style="font-style: normal;"></em>
|
||||
@ -825,7 +825,7 @@
|
||||
<span class="tooltiptext">
|
||||
If this is set, then most hotkeys (keyboard shortcuts) in the game are disabled.
|
||||
This includes Terminal commands, hotkeys to navigate between different parts of the game,
|
||||
and the "Save and Close (Ctrl + b)" hotkey in the Text Editor.
|
||||
and the "Save and Close (Ctrl + b)" hotkey in the Text Editor.
|
||||
</span>
|
||||
</label>
|
||||
<input type="checkbox" name="settingsDisableHotkeys" id="settingsDisableHotkeys">
|
||||
|
@ -1,3 +1,4 @@
|
||||
import {Engine} from "./engine.js";
|
||||
import {workerScripts,
|
||||
addWorkerScript,
|
||||
killWorkerScript} from "./NetscriptWorker.js";
|
||||
@ -147,7 +148,9 @@ function deleteActiveScriptsItem(workerscript) {
|
||||
ActiveScriptsTasks.push(function(workerscript) {
|
||||
var server = getServer(workerscript.serverIp);
|
||||
if (server == null) {
|
||||
console.log("ERROR: Invalid server IP for workerscript.");
|
||||
throw new Error("ERROR: Invalid server IP for workerscript. This most likely occurred because " +
|
||||
"you tried to delete a large number of scripts and also purchased servers at the " +
|
||||
"same time. It's not a big deal, just save and refresh the game.");
|
||||
return;
|
||||
}
|
||||
let hostname = server.hostname;
|
||||
@ -182,7 +185,7 @@ function deleteActiveScriptsItem(workerscript) {
|
||||
function updateActiveScriptsItems() {
|
||||
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
||||
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
||||
let numTasks = Math.min(50, ActiveScriptsTasks.length);
|
||||
let numTasks = Math.min(100, ActiveScriptsTasks.length);
|
||||
for (let i = 0; i < numTasks; ++i) {
|
||||
let task = ActiveScriptsTasks.shift();
|
||||
try {
|
||||
@ -193,6 +196,7 @@ function updateActiveScriptsItems() {
|
||||
}
|
||||
}
|
||||
|
||||
if (Engine.currentPage !== Engine.Page.ActiveScripts) {return;}
|
||||
var total = 0;
|
||||
for (var i = 0; i < workerScripts.length; ++i) {
|
||||
try {
|
||||
|
@ -1248,10 +1248,10 @@ Bladeburner.prototype.completeAction = function() {
|
||||
break;
|
||||
case ActionTypes["Training"]:
|
||||
this.stamina -= (0.5 * BaseStaminaLoss);
|
||||
var strExpGain = 20 * Player.strength_exp_mult,
|
||||
defExpGain = 20 * Player.defense_exp_mult,
|
||||
dexExpGain = 20 * Player.dexterity_exp_mult,
|
||||
agiExpGain = 20 * Player.agility_exp_mult,
|
||||
var strExpGain = 30 * Player.strength_exp_mult,
|
||||
defExpGain = 30 * Player.defense_exp_mult,
|
||||
dexExpGain = 30 * Player.dexterity_exp_mult,
|
||||
agiExpGain = 30 * Player.agility_exp_mult,
|
||||
staminaGain = 0.04 * this.skillMultipliers.stamina;
|
||||
Player.gainStrengthExp(strExpGain);
|
||||
Player.gainDefenseExp(defExpGain);
|
||||
@ -3175,7 +3175,7 @@ function initBladeburner() {
|
||||
name:SkillNames.Overclock,
|
||||
desc:"Each level of this skill decreases the time it takes " +
|
||||
"to attempt a contract or operation by 1% (Max Level: 99)",
|
||||
baseCost:5, costInc:1, maxLvl:99,
|
||||
baseCost:5, costInc:1, maxLvl:95,
|
||||
actionTime:1
|
||||
});
|
||||
Skills[SkillNames.EvasiveSystem] = new Skill({
|
||||
|
@ -1,5 +1,5 @@
|
||||
let CONSTANTS = {
|
||||
Version: "0.36.0",
|
||||
Version: "0.36.1",
|
||||
|
||||
//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
|
||||
@ -1147,21 +1147,22 @@ let CONSTANTS = {
|
||||
"** Datamancer skill effect increased from 4% per level to 5%<br>" +
|
||||
"** Slightly decreased the base stamina cost of contracts/operations<br>" +
|
||||
"** Slightly increased the effects of the Tracer, Digital Observer, Short Circuit, Cloak, and Blade's Intuition skills<br>" +
|
||||
"** Overclock skill capped at level 95, rather than 99<br>" +
|
||||
"** Training gives significantly more exp/s<br>" +
|
||||
"* Crime, Infiltration, and Hacking are now slightly more profitable in BN-6<br>" +
|
||||
"* Gyms are now more expensive, but give slightly more exp<br>" +
|
||||
"* Added getScriptName() and getHacknetMultipliers() Netscript functions (added by Github user hydroflame)<br>" +
|
||||
"* getScriptRam() Netscript function now has default value for the second argument, which is hostname/ip (implemented by Github user hydroflame)<br>" +
|
||||
"* getScriptRam() Netscript function now has default value for the second argument, which is hostname/ip (implemented by Github user hydroflame)<br>" +
|
||||
"* There is now a soft-cap on stock price, which means it's no longer possible for the price of a stock to reach insanely-high values<br>" +
|
||||
"* The ctrl+b hotkey in the text editor is now also triggered by command+b or winkey+b<br>" +
|
||||
"* The ctrl+b hotkey in the text editor should now also be triggered by command+b on OSX (I don't have OSX so I can't confirm if this works)<br>" +
|
||||
"* Many servers now have additional RAM<br>" +
|
||||
"* Added an option to disable hotkeys/keyboard shortcuts<br>" +
|
||||
"* Refactored 'Active Scripts' UI page to optimize its performance<br>" +
|
||||
"* Added a new .fconf setting: ENABLE_TIMESTAMP<br>" +
|
||||
"* Added a new .fconf Terminal setting: ENABLE_TIMESTAMP<br>" +
|
||||
"* 'Netscript Execution Time', which can be found in the Options, now has a minimum value of 15ms rather than 25ms<br>" +
|
||||
"* Bug Fix: Fixed a typo in the Fulcrum Technologies company name (Technolgies -> Technologies)<br>" +
|
||||
"* Bug Fix: hacknetnodes keyword should no longer incur RAM cost if its in a comment<br>" +
|
||||
"v0.36.0<br>" +
|
||||
"* Added BN-6: Bladeburners<br>" +
|
||||
"* Rebalanced many combat Augmentations so that they are slightly less powerful<br>" +
|
||||
"* Bug Fix: When faction invites are suppressed, an invitation will no longer load the Faction page<br>"
|
||||
"* Bug Fix: disableLog() now works for the commitCrime() Netscript function (fixed by Github user hydroflame)"
|
||||
|
||||
}
|
||||
|
||||
|
@ -1095,7 +1095,9 @@ function getNextNeurofluxLevel() {
|
||||
}
|
||||
}
|
||||
if (aug == null) {
|
||||
console.log("ERROR, Could not find NeuroFlux Governor aug");
|
||||
console.log("WARNING: Could not find NeuroFlux Governor aug. This is OK if " +
|
||||
"it happens during the loading/initialization of the game, but probably " +
|
||||
"indicates something seriously wrong at other times");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -565,13 +565,13 @@ function displayLocationContent() {
|
||||
break;
|
||||
|
||||
case Locations.AevumCrushFitnessGym:
|
||||
var costMult = 2, expMult = 1.5;
|
||||
var costMult = 3, expMult = 2;
|
||||
displayGymLocationContent(costMult);
|
||||
setGymLocationButtons(costMult, expMult);
|
||||
break;
|
||||
|
||||
case Locations.AevumSnapFitnessGym:
|
||||
var costMult = 6, expMult = 4;
|
||||
var costMult = 10, expMult = 5;
|
||||
displayGymLocationContent(costMult);
|
||||
setGymLocationButtons(costMult, expMult);
|
||||
break;
|
||||
@ -793,7 +793,7 @@ function displayLocationContent() {
|
||||
break;
|
||||
|
||||
case Locations.Sector12PowerhouseGym:
|
||||
var costMult = 10, expMult = 7.5;
|
||||
var costMult = 20, expMult = 10;
|
||||
displayGymLocationContent(costMult);
|
||||
setGymLocationButtons(costMult, expMult);
|
||||
break;
|
||||
@ -1045,7 +1045,7 @@ function displayLocationContent() {
|
||||
break;
|
||||
|
||||
case Locations.VolhavenMilleniumFitnessGym:
|
||||
var costMult = 3, expMult = 2.5;
|
||||
var costMult = 7, expMult = 4;
|
||||
displayGymLocationContent(costMult);
|
||||
setGymLocationButtons(costMult, expMult);
|
||||
break;
|
||||
|
@ -53,6 +53,7 @@ function prestigeWorkerScripts() {
|
||||
deleteActiveScriptsItem(workerScripts[i]);
|
||||
workerScripts[i].env.stopFlag = true;
|
||||
}
|
||||
updateActiveScriptsItems(); //Force UI to update
|
||||
workerScripts.length = 0;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ function scriptEditorInit() {
|
||||
}
|
||||
var closeButton = createElement("a", {
|
||||
class:"a-link-button", display:"inline-block",
|
||||
innerText:"Save & Close (Ctrl + b)",
|
||||
innerText:"Save & Close (Ctrl/Cmd + b)",
|
||||
clickListener:()=>{
|
||||
saveAndCloseScriptEditor();
|
||||
return false;
|
||||
|
@ -68,29 +68,6 @@ function Server(params={ip:createRandomIp(), hostname:""}) {
|
||||
this.openPortCount = 0;
|
||||
};
|
||||
|
||||
/*
|
||||
//Set the hacking properties of a server
|
||||
Server.prototype.setHackingParameters = function(requiredHackingSkill, moneyAvailable, hackDifficulty, serverGrowth) {
|
||||
this.requiredHackingSkill = requiredHackingSkill;
|
||||
if (isNaN(moneyAvailable)) {
|
||||
this.moneyAvailable = 1e6;
|
||||
} else {
|
||||
this.moneyAvailable = moneyAvailable * BitNodeMultipliers.ServerStartingMoney;
|
||||
}
|
||||
this.moneyMax =
|
||||
this.hackDifficulty = hackDifficulty * BitNodeMultipliers.ServerStartingSecurity;
|
||||
this.baseDifficulty = hackDifficulty * BitNodeMultipliers.ServerStartingSecurity;
|
||||
this.minDifficulty = Math.max(1, Math.round(this.hackDifficulty / 3));
|
||||
this.serverGrowth = serverGrowth;
|
||||
}
|
||||
|
||||
//Set the port properties of a server
|
||||
//Right now its only the number of open ports needed to PortHack the server.
|
||||
Server.prototype.setPortProperties = function(numOpenPortsReq) {
|
||||
this.numOpenPortsRequired = numOpenPortsReq;
|
||||
}
|
||||
*/
|
||||
|
||||
Server.prototype.setMaxRam = function(ram) {
|
||||
this.maxRam = ram;
|
||||
}
|
||||
|
@ -498,30 +498,18 @@ let Engine = {
|
||||
|
||||
displayCharacterOverviewInfo: function() {
|
||||
if (Player.hp == null) {Player.hp = Player.max_hp;}
|
||||
var overviewText = "Hp: " + Player.hp + " / " + Player.max_hp + "<br>" +
|
||||
"Money: " + numeral(Player.money.toNumber()).format('($0.000a)') + "<br>" +
|
||||
"Hack: " + (Player.hacking_skill).toLocaleString() + "<br>" +
|
||||
"Str: " + (Player.strength).toLocaleString() + "<br>" +
|
||||
"Def: " + (Player.defense).toLocaleString() + "<br>" +
|
||||
"Dex: " + (Player.dexterity).toLocaleString() + "<br>" +
|
||||
"Agi: " + (Player.agility).toLocaleString() + "<br>" +
|
||||
"Cha: " + (Player.charisma).toLocaleString();
|
||||
if (Player.intelligence >= 1) {
|
||||
document.getElementById("character-overview-text").innerHTML =
|
||||
("Hp: " + Player.hp + " / " + Player.max_hp + "<br>" +
|
||||
"Money: " + numeral(Player.money.toNumber()).format('($0.000a)') + "<br>" +
|
||||
"Hack: " + (Player.hacking_skill).toLocaleString() + "<br>" +
|
||||
"Str: " + (Player.strength).toLocaleString() + "<br>" +
|
||||
"Def: " + (Player.defense).toLocaleString() + "<br>" +
|
||||
"Dex: " + (Player.dexterity).toLocaleString() + "<br>" +
|
||||
"Agi: " + (Player.agility).toLocaleString() + "<br>" +
|
||||
"Cha: " + (Player.charisma).toLocaleString() + "<br>" +
|
||||
"Int: " + (Player.intelligence).toLocaleString()
|
||||
).replace( / /g, " " );
|
||||
} else {
|
||||
document.getElementById("character-overview-text").innerHTML =
|
||||
("Hp: " + Player.hp + " / " + Player.max_hp + "<br>" +
|
||||
"Money: " + numeral(Player.money.toNumber()).format('($0.000a)') + "<br>" +
|
||||
"Hack: " + (Player.hacking_skill).toLocaleString() + "<br>" +
|
||||
"Str: " + (Player.strength).toLocaleString() + "<br>" +
|
||||
"Def: " + (Player.defense).toLocaleString() + "<br>" +
|
||||
"Dex: " + (Player.dexterity).toLocaleString() + "<br>" +
|
||||
"Agi: " + (Player.agility).toLocaleString() + "<br>" +
|
||||
"Cha: " + (Player.charisma).toLocaleString()
|
||||
).replace( / /g, " " );
|
||||
overviewText += "<br>Int: " + (Player.intelligence).toLocaleString();
|
||||
}
|
||||
document.getElementById("character-overview-text").innerHTML = overviewText.replace( / /g, " ");
|
||||
},
|
||||
|
||||
/* Display character info */
|
||||
@ -899,9 +887,10 @@ let Engine = {
|
||||
Counters: {
|
||||
autoSaveCounter: 300, //Autosave every minute
|
||||
updateSkillLevelsCounter: 10, //Only update skill levels every 2 seconds. Might improve performance
|
||||
updateDisplays: 3, //Update displays such as Active Scripts display and character display
|
||||
updateDisplays: 3,
|
||||
updateDisplaysMed: 9,
|
||||
updateDisplaysLong: 15,
|
||||
updateActiveScriptsDisplay: 5,
|
||||
createProgramNotifications: 10, //Checks whether any programs can be created and notifies
|
||||
checkFactionInvitations: 100, //Check whether you qualify for any faction invitations
|
||||
passiveFactionGrowth: 600,
|
||||
@ -939,6 +928,16 @@ let Engine = {
|
||||
Engine.Counters.updateSkillLevelsCounter = 10;
|
||||
}
|
||||
|
||||
if (Engine.Counters.updateActiveScriptsDisplay <= 0) {
|
||||
//Always update, but make the interval longer if the page isn't active
|
||||
updateActiveScriptsItems();
|
||||
if (Engine.currentPage === Engine.Page.ActiveScripts) {
|
||||
Engine.Counters.updateActiveScriptsDisplay = 5;
|
||||
} else {
|
||||
Engine.Counters.updateActiveScriptsDisplay = 15;
|
||||
}
|
||||
}
|
||||
|
||||
if (Engine.Counters.updateDisplays <= 0) {
|
||||
Engine.displayCharacterOverviewInfo();
|
||||
if (Engine.currentPage == Engine.Page.CharacterInfo) {
|
||||
@ -957,12 +956,10 @@ let Engine = {
|
||||
}
|
||||
|
||||
if (Engine.Counters.updateDisplaysMed <= 0) {
|
||||
if (Engine.currentPage == Engine.Page.ActiveScripts) {
|
||||
updateActiveScriptsItems();
|
||||
} else if (Engine.currentPage === Engine.Page.Corporation) {
|
||||
if (Engine.currentPage === Engine.Page.Corporation) {
|
||||
Player.corporation.updateUIContent();
|
||||
}
|
||||
Engine.Counters.updateDisplaysMed = 6;
|
||||
Engine.Counters.updateDisplaysMed = 9;
|
||||
}
|
||||
|
||||
if (Engine.Counters.updateDisplaysLong <= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user