mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
UI: Fix some DevMenu react errors, add number of exploits to savegame comparison (#825)
This commit is contained in:
parent
7b00fcc5b1
commit
673efb427f
@ -217,16 +217,13 @@ export function BladeburnerDev({ bladeburner }: { bladeburner: Bladeburner }): R
|
||||
reset={wipeAllChaos}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<Tooltip title="Wipe Active City Chaos">
|
||||
<IconButton
|
||||
onClick={wipeActiveCityChaos}
|
||||
size="large"
|
||||
arial-label="clear-active-city-chaos"
|
||||
title="Clear Only Active City Chaos"
|
||||
>
|
||||
<IconButton onClick={wipeActiveCityChaos} size="large" aria-label="clear-active-city-chaos">
|
||||
<DeleteIcon sx={{ fontSize: 40 }} />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -1,13 +1,13 @@
|
||||
/*
|
||||
The game cannot block every possible exploits. Specially since one of them is
|
||||
that you can just edit your save file and that's impractical to prevent.
|
||||
The game cannot block every possible exploit. Especially since one of them is
|
||||
that you can just edit your save file, and that's impractical 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 developers 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.
|
||||
So instead, we have "Source-File -1" ("negative one"). 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 purposes - [1] the developers don't have to spend time
|
||||
trying to implement anti-cheat measures and [2] finding ways to break a
|
||||
hacking game is very much a learning experience in the spirit of the game.
|
||||
Source-File minus 1 is extremely weak because it can be fully levelled up quickly.
|
||||
*/
|
||||
|
||||
// Exploits don't need an enum helper so they are not in an enums file
|
||||
@ -22,9 +22,10 @@ export enum Exploit {
|
||||
YoureNotMeantToAccessThis = "YoureNotMeantToAccessThis",
|
||||
TrueRecursion = "TrueRecursion",
|
||||
INeedARainbow = "INeedARainbow",
|
||||
// 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.
|
||||
// To the players reading this:
|
||||
// Yes, you're supposed to gain the EditSaveFile exploit by editing your real save file.
|
||||
// TBH, you could gain them all the same way, but that is not our challenge to you.
|
||||
// You are the captain of your own ship.
|
||||
EditSaveFile = "EditSaveFile",
|
||||
}
|
||||
|
||||
|
@ -92,9 +92,7 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
|
||||
}
|
||||
return res;
|
||||
},
|
||||
getOwnedSourceFiles: () => () => {
|
||||
return [...Player.sourceFiles].map(([n, lvl]) => ({ n, lvl }));
|
||||
},
|
||||
getOwnedSourceFiles: () => () => [...Player.sourceFiles].map(([n, lvl]) => ({ n, lvl })),
|
||||
getAugmentationFactions: (ctx) => (_augName) => {
|
||||
helpers.checkSingularityAccess(ctx);
|
||||
const augName = getEnumHelper("AugmentationName").nsGetMember(ctx, _augName);
|
||||
|
@ -178,7 +178,7 @@ export class PlayerObject extends Person implements IPlayer {
|
||||
isMember("AugmentationName", ownedAug.name),
|
||||
);
|
||||
player.updateSkillLevels();
|
||||
// Converstion code for Player.sourceFiles is here instead of normal save conversion area because it needs
|
||||
// Conversion code for Player.sourceFiles is here instead of normal save conversion area because it needs
|
||||
// to happen earlier for use in the savegame comparison tool.
|
||||
if (Array.isArray(player.sourceFiles)) {
|
||||
// Expect pre-2.3 sourcefile format here.
|
||||
|
@ -70,6 +70,7 @@ export interface ImportPlayerData {
|
||||
bitNode: number;
|
||||
bitNodeLevel: number;
|
||||
sourceFiles: number;
|
||||
exploits: number;
|
||||
}
|
||||
|
||||
class BitburnerSaveObject {
|
||||
@ -232,6 +233,7 @@ class BitburnerSaveObject {
|
||||
bitNode: importedPlayer.bitNodeN,
|
||||
bitNodeLevel: importedPlayer.sourceFileLvl(Player.bitNodeN) + 1,
|
||||
sourceFiles: [...importedPlayer.sourceFiles].reduce<number>((total, [__bn, lvl]) => (total += lvl), 0),
|
||||
exploits: importedPlayer.exploits.length,
|
||||
};
|
||||
|
||||
data.playerData = playerData;
|
||||
|
@ -80,11 +80,17 @@ export function initSourceFiles() {
|
||||
<br />
|
||||
<ul>
|
||||
<li>
|
||||
<span>
|
||||
The <code>getBitNodeMultipliers()</code> Netscript function
|
||||
</span>
|
||||
</li>
|
||||
<li>Permanent access to Formulas.exe</li>
|
||||
<li>
|
||||
<span>Permanent access to Formulas.exe</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>
|
||||
Access to BitNode multiplier information on the <b>Stats</b> page
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
It will also raise all of your hacking-related multipliers by:
|
||||
|
@ -301,7 +301,9 @@ export const ImportSave = (props: { importString: string; automatic: boolean }):
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableCell>Source Files</TableCell>
|
||||
<Tooltip title="The total SF levels owned, except for SF-1 Exploit levels.">
|
||||
<TableCell>Source File Levels</TableCell>
|
||||
</Tooltip>
|
||||
<TableCell>{currentData.playerData?.sourceFiles}</TableCell>
|
||||
<TableCell>{importData.playerData?.sourceFiles}</TableCell>
|
||||
<TableCell>
|
||||
@ -314,7 +316,24 @@ export const ImportSave = (props: { importString: string; automatic: boolean }):
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<Tooltip title="Number of exploits owned.">
|
||||
<TableCell>Exploits</TableCell>
|
||||
</Tooltip>
|
||||
<TableCell>{currentData.playerData?.exploits}</TableCell>
|
||||
<TableCell>{importData.playerData?.exploits}</TableCell>
|
||||
<TableCell>
|
||||
{importData.playerData?.exploits !== currentData.playerData?.exploits && (
|
||||
<ComparisonIcon
|
||||
isBetter={(importData.playerData?.exploits ?? 0) > (currentData.playerData?.exploits ?? 0)}
|
||||
/>
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<Tooltip title="The player's current BitNode.">
|
||||
<TableCell>BitNode</TableCell>
|
||||
</Tooltip>
|
||||
<TableCell>
|
||||
{currentData.playerData?.bitNode}-{currentData.playerData?.bitNodeLevel}
|
||||
</TableCell>
|
||||
@ -346,6 +365,7 @@ export const ImportSave = (props: { importString: string; automatic: boolean }):
|
||||
<br />
|
||||
</>
|
||||
}
|
||||
additionalButton={<Button onClick={closeImportModal}>Cancel</Button>}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
|
Loading…
Reference in New Issue
Block a user