Skip to content

Commit

Permalink
UI: Change description and add tooltip for HackMoney-related multipliers
Browse files Browse the repository at this point in the history
  • Loading branch information
catloversg committed Dec 3, 2024
1 parent 933ec96 commit 700926b
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 31 deletions.
2 changes: 1 addition & 1 deletion markdown/bitburner.bitnodemultipliers.manualhackmoney.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## BitNodeMultipliers.ManualHackMoney property

Influences how much money can be stolen from a server when the player performs a hack against it through the Terminal.
Influences how much money is stolen from a server when the player performs a hack against it through the terminal.

**Signature:**

Expand Down
6 changes: 3 additions & 3 deletions markdown/bitburner.bitnodemultipliers.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ interface BitNodeMultipliers
| [HomeComputerRamCost](./bitburner.bitnodemultipliers.homecomputerramcost.md) | | number | Influences how much money it costs to upgrade your home computer's RAM |
| [InfiltrationMoney](./bitburner.bitnodemultipliers.infiltrationmoney.md) | | number | Influences how much money is gained when the player infiltrates a company. |
| [InfiltrationRep](./bitburner.bitnodemultipliers.infiltrationrep.md) | | number | Influences how much rep the player can gain from factions when selling stolen documents and secrets |
| [ManualHackMoney](./bitburner.bitnodemultipliers.manualhackmoney.md) | | number | Influences how much money can be stolen from a server when the player performs a hack against it through the Terminal. |
| [ManualHackMoney](./bitburner.bitnodemultipliers.manualhackmoney.md) | | number | Influences how much money is stolen from a server when the player performs a hack against it through the terminal. |
| [PurchasedServerCost](./bitburner.bitnodemultipliers.purchasedservercost.md) | | number | Influence how much it costs to purchase a server |
| [PurchasedServerLimit](./bitburner.bitnodemultipliers.purchasedserverlimit.md) | | number | Influences the maximum number of purchased servers you can have |
| [PurchasedServerMaxRam](./bitburner.bitnodemultipliers.purchasedservermaxram.md) | | number | Influences the maximum allowed RAM for a purchased server |
| [PurchasedServerSoftcap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md) | | number | Influence how much it costs to purchase a server |
| [RepToDonateToFaction](./bitburner.bitnodemultipliers.reptodonatetofaction.md) | | number | Influences the minimum favor the player must have with a faction before they can donate to gain rep. |
| [ScriptHackMoney](./bitburner.bitnodemultipliers.scripthackmoney.md) | | number | Influences how much money can be stolen from a server when a script performs a hack against it. |
| [ScriptHackMoneyGain](./bitburner.bitnodemultipliers.scripthackmoneygain.md) | | number | The amount of money actually gained when a script hacks a server. This is different than the above because you can reduce the amount of money but not gain that same amount. |
| [ScriptHackMoney](./bitburner.bitnodemultipliers.scripthackmoney.md) | | number | Influences how much money is stolen from a server when a script performs a hack against it. |
| [ScriptHackMoneyGain](./bitburner.bitnodemultipliers.scripthackmoneygain.md) | | number | Influences how much money the player actually gains when a script hacks a server. This is different from ScriptHackMoney. When a script hacks a server, the amount of money in that server is reduced, but the player does not gain that same amount. |
| [ServerGrowthRate](./bitburner.bitnodemultipliers.servergrowthrate.md) | | number | Influences the growth percentage per cycle against a server. |
| [ServerMaxMoney](./bitburner.bitnodemultipliers.servermaxmoney.md) | | number | Influences the maximum money that a server can grow to. |
| [ServerStartingMoney](./bitburner.bitnodemultipliers.serverstartingmoney.md) | | number | Influences the initial money that a server starts with. |
Expand Down
2 changes: 1 addition & 1 deletion markdown/bitburner.bitnodemultipliers.scripthackmoney.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## BitNodeMultipliers.ScriptHackMoney property

Influences how much money can be stolen from a server when a script performs a hack against it.
Influences how much money is stolen from a server when a script performs a hack against it.

**Signature:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## BitNodeMultipliers.ScriptHackMoneyGain property

The amount of money actually gained when a script hacks a server. This is different than the above because you can reduce the amount of money but not gain that same amount.
Influences how much money the player actually gains when a script hacks a server. This is different from ScriptHackMoney. When a script hacks a server, the amount of money in that server is reduced, but the player does not gain that same amount.

**Signature:**

Expand Down
10 changes: 5 additions & 5 deletions src/BitNode/BitNodeMultipliers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ export class BitNodeMultipliers {
InfiltrationRep = 1;

/**
* Influences how much money can be stolen from a server when the player performs a hack against it through
* the Terminal.
* Influences how much money is stolen from a server when the player performs a hack against it through
* the terminal.
*/
ManualHackMoney = 1;

Expand All @@ -135,12 +135,12 @@ export class BitNodeMultipliers {
/** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */
RepToDonateToFaction = 1;

/** Influences how much money can be stolen from a server when a script performs a hack against it. */
/** Influences how much money is stolen from a server when a script performs a hack against it. */
ScriptHackMoney = 1;

/**
* The amount of money actually gained when a script hacks a server. This is
* different than the above because you can reduce the amount of money but
* Influences how much money the player actually gains when a script hacks a server. This is different from
* ScriptHackMoney. When a script hacks a server, the amount of money in that server is reduced, but the player does
* not gain that same amount.
*/
ScriptHackMoneyGain = 1;
Expand Down
52 changes: 39 additions & 13 deletions src/BitNode/ui/BitnodeMultipliersDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import React from "react";
import { uniqueId } from "lodash";
import { Box, Collapse, ListItemButton, ListItemText, Paper, Table, TableBody, Typography } from "@mui/material";
import {
Box,
Collapse,
ListItemButton,
ListItemText,
Paper,
Table,
TableBody,
Tooltip,
Typography,
} from "@mui/material";
import ExpandLess from "@mui/icons-material/ExpandLess";
import ExpandMore from "@mui/icons-material/ExpandMore";

Expand Down Expand Up @@ -70,6 +79,7 @@ type IBNMultRows = PartialRecord<
name: string;
content?: string;
color?: string;
tooltipText?: string;
}
>;

Expand All @@ -82,14 +92,26 @@ interface IBNMultTableProps {
const BNMultTable = (props: IBNMultTableProps): React.ReactElement => {
const rowsArray = getRecordEntries(props.rowData)
.filter(([key]) => props.mults[key] !== defaultMultipliers[key])
.map(([key, value]) => (
<StatsRow
key={uniqueId()}
name={value.name}
data={{ content: value.content ?? `${(props.mults[key] * 100).toFixed(3)}%` }}
color={value.color ?? Settings.theme.primary}
/>
));
.map(([key, value]) => {
const name = value.tooltipText ? (
<Tooltip title={<span>{value.tooltipText}</span>}>
<span>
{value.name}
<sup>(*)</sup>
</span>
</Tooltip>
) : (
value.name
);
return (
<StatsRow
key={`${props.sectionName}-${value.name}`}
name={name}
data={{ content: value.content ?? `${(props.mults[key] * 100).toFixed(3)}%` }}
color={value.color ?? Settings.theme.primary}
/>
);
});

return rowsArray.length > 0 ? (
<span style={{ display: "inline-block", width: "100%", marginBottom: "16px" }}>
Expand Down Expand Up @@ -241,16 +263,20 @@ function HackingMults({ mults }: IMultsProps): React.ReactElement {
ServerStartingSecurity: { name: "Server Starting Security" },
ServerWeakenRate: { name: "Server Weaken Rate" },
ManualHackMoney: {
name: "Manual Hack Money",
name: "Stolen Money From Manual Hack",
color: Settings.theme.money,
tooltipText:
"Influences how much money is stolen from a server when the player performs a hack against it through the terminal",
},
ScriptHackMoney: {
name: "Script Hack Money",
name: "Stolen Money From Script Hack",
color: Settings.theme.money,
tooltipText: "Influences how much money is stolen from a server when a script performs a hack against it",
},
ScriptHackMoneyGain: {
name: "Money Gained From Hack",
name: "Money Gained From Script Hack",
color: Settings.theme.money,
tooltipText: `Influences how much money the player actually gains when a script hacks a server. This is different from "Stolen Money From Script Hack". When a script hacks a server, the amount of money in that server is reduced, but the player does not gain that same amount.`,
},
};

Expand Down
10 changes: 5 additions & 5 deletions src/ScriptEditor/NetscriptDefinitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,8 @@ interface BitNodeMultipliers {
/** Influences how much rep the player can gain from factions when selling stolen documents and secrets */
InfiltrationRep: number;
/**
* Influences how much money can be stolen from a server when the player performs a hack against it through
* the Terminal.
* Influences how much money is stolen from a server when the player performs a hack against it through
* the terminal.
*/
ManualHackMoney: number;
/** Influence how much it costs to purchase a server */
Expand All @@ -742,11 +742,11 @@ interface BitNodeMultipliers {
PurchasedServerMaxRam: number;
/** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */
RepToDonateToFaction: number;
/** Influences how much money can be stolen from a server when a script performs a hack against it. */
/** Influences how much money is stolen from a server when a script performs a hack against it. */
ScriptHackMoney: number;
/**
* The amount of money actually gained when a script hacks a server. This is
* different than the above because you can reduce the amount of money but
* Influences how much money the player actually gains when a script hacks a server. This is different from
* ScriptHackMoney. When a script hacks a server, the amount of money in that server is reduced, but the player does
* not gain that same amount.
*/
ScriptHackMoneyGain: number;
Expand Down
4 changes: 3 additions & 1 deletion src/ui/CharacterStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ function CurrentBitNode(): React.ReactElement {
<Typography variant="h5">
BitNode {Player.bitNodeN}: {BitNodes[index].name} (Level {lvl})
</Typography>
<Typography sx={{ whiteSpace: "pre-wrap", overflowWrap: "break-word" }}>{BitNodes[index].info}</Typography>
<Typography component="div" sx={{ whiteSpace: "pre-wrap", overflowWrap: "break-word" }}>
{BitNodes[index].info}
</Typography>
</Paper>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/React/StatsRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface ITableRowData {
}

interface IProps {
name: string;
name: string | React.ReactElement;
color: string;
data?: ITableRowData;
children?: React.ReactElement;
Expand Down

0 comments on commit 700926b

Please sign in to comment.