From 8f4ac830ada1820e1f3c71ab5c310f48e38fdaac Mon Sep 17 00:00:00 2001 From: danielyxie Date: Sat, 29 Sep 2018 13:58:32 -0500 Subject: [PATCH] Fixed Infiltration exp display bug. Set cursor: pointer css styling for main menu --- css/mainmenu.scss | 1 + src/Constants.js | 6 ++++-- utils/InfiltrationBox.js | 33 +++++++++++---------------------- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/css/mainmenu.scss b/css/mainmenu.scss index ce2c81884..0fc27d8a7 100644 --- a/css/mainmenu.scss +++ b/css/mainmenu.scss @@ -29,6 +29,7 @@ padding: 12px 8px; text-decoration: none; + cursor: pointer; width: 100%; text-align: left; } diff --git a/src/Constants.js b/src/Constants.js index 88a06b68d..556c53075 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -508,13 +508,15 @@ let CONSTANTS = { ` v0.40.4
* Added new Coding Contracts mechanic. Solve programming problems to earn rewards - * (TODO NEEDS DOCUMENTATION) The write() and read() Netscript functions now work on scripts + * The write() and read() Netscript functions now work on scripts + * Added wget() Netscript function * Added bladeburner.getActionRepGain() function to the Netscript Bladeburner API * The getLevelUpgradeCost(), getRamUpgradeCost(), and getCoreUpgradeCost() functions in the Hacknet API now return Infinity if the node is at max level. See documentation * It is now possible to use freely use angled bracket (<, >) and create DOM elements using tprint() * The game's theme colors can now be set through the Terminal configuration (.fconf). * You can now switch to the old left-hand main menu bar through the Terminal configuration (.fconf) - * grow() percentage is no longer reported as Infinity when a server's money is grown from 0 to X + * Bug Fix: grow() percentage is no longer reported as Infinity when a server's money is grown from 0 to X + * Bug Fix: Infiltration popup now displays the correct amount of exp gained ` } diff --git a/utils/InfiltrationBox.js b/utils/InfiltrationBox.js index 18667bd82..2e179b267 100644 --- a/utils/InfiltrationBox.js +++ b/utils/InfiltrationBox.js @@ -37,20 +37,21 @@ function infiltrationBoxCreate(inst) { Player.gainCharismaExp(inst.chaExpGained * expMultiplier); Player.gainIntelligenceExp(inst.intExpGained * expMultiplier); + const expGainText = ["You gained:", + `${formatNumber(inst.hackingExpGained * expMultiplier, 3)} hacking exp`, + `${formatNumber(inst.strExpGained * expMultiplier, 3)} str exp`, + `${formatNumber(inst.defExpGained * expMultiplier, 3)} def exp`, + `${formatNumber(inst.dexExpGained * expMultiplier, 3)} dex exp`, + `${formatNumber(inst.agiExpGained * expMultiplier, 3)} agi exp`, + `${formatNumber(inst.chaExpGained * expMultiplier, 3)} cha exp`].join("\n"); + var totalValue = 0; for (var i = 0; i < inst.secretsStolen.length; ++i) { totalValue += inst.secretsStolen[i]; } if (totalValue == 0) { dialogBoxCreate("You successfully escaped the facility but you did not steal " + - "anything of worth when infiltrating.

" + - "You gained:
" + - formatNumber(inst.hackingExpGained, 3) + " hacking exp
" + - formatNumber(inst.strExpGained, 3) + " str exp
" + - formatNumber(inst.defExpGained, 3) + " def exp
" + - formatNumber(inst.dexExpGained, 3) + " dex exp
" + - formatNumber(inst.agiExpGained, 3) + " agi exp
" + - formatNumber(inst.chaExpGained, 3) + " cha exp
"); + "anything of worth when infiltrating.

" + expGainText); return; } var facValue = totalValue * Player.faction_rep_mult * @@ -86,13 +87,7 @@ function infiltrationBoxCreate(inst) { Player.gainMoney(moneyValue); dialogBoxCreate("You sold the classified information you stole from " + inst.companyName + " for $" + formatNumber(moneyValue, 2) + " on the black market!

" + - "You gained:
" + - formatNumber(inst.hackingExpGained, 3) + " hacking exp
" + - formatNumber(inst.strExpGained, 3) + " str exp
" + - formatNumber(inst.defExpGained, 3) + " def exp
" + - formatNumber(inst.dexExpGained, 3) + " dex exp
" + - formatNumber(inst.agiExpGained, 3) + " agi exp
" + - formatNumber(inst.chaExpGained, 3) + " cha exp
"); + expGainText); infiltrationBoxClose(); return false; }); @@ -112,13 +107,7 @@ function infiltrationBoxCreate(inst) { faction.playerReputation += facValue; dialogBoxCreate("You gave the classified information you stole from " + inst.companyName + " to " + facName + " and gained " + formatNumber(facValue, 3) + " reputation with the faction.

" + - "You gained:
" + - formatNumber(inst.hackingExpGained, 3) + " hacking exp
" + - formatNumber(inst.strExpGained, 3) + " str exp
" + - formatNumber(inst.defExpGained, 3) + " def exp
" + - formatNumber(inst.dexExpGained, 3) + " dex exp
" + - formatNumber(inst.agiExpGained, 3) + " agi exp
" + - formatNumber(inst.chaExpGained, 3) + " cha exp
"); + expGainText); infiltrationBoxClose(); return false; });