Fix missing money display

This commit is contained in:
Olivier Gagnon 2021-09-04 14:03:19 -04:00
parent c9efa977fb
commit e1c29f25e2
14 changed files with 43 additions and 51 deletions

File diff suppressed because one or more lines are too long

@ -627,7 +627,7 @@ class DevMenuComponent extends Component {
this.processStocks((stock) => { this.processStocks((stock) => {
stocks.push(<tr key={stock.symbol}> stocks.push(<tr key={stock.symbol}>
<td>{stock.symbol}</td> <td>{stock.symbol}</td>
<td style={{'textAlign':'right'}}>{Money(stock.cap)}</td> <td style={{'textAlign':'right'}}><Money money={stock.cap} /></td>
</tr>); </tr>);
}); });
dialogBoxCreate(<table><tbody><tr><th>Stock</th><th>Price cap</th></tr> dialogBoxCreate(<table><tbody><tr><th>Stock</th><th>Price cap</th></tr>
@ -727,11 +727,11 @@ class DevMenuComponent extends Component {
<h2>Generic</h2> <h2>Generic</h2>
</div> </div>
<div className="row"> <div className="row">
<button className="std-button" onClick={this.addMoney(1e6)}>Add $1m</button> <button className="std-button" onClick={this.addMoney(1e6)}>Add <Money money={1e6} /></button>
<button className="std-button" onClick={this.addMoney(1e9)}>Add $1b</button> <button className="std-button" onClick={this.addMoney(1e9)}>Add <Money money={1e9} /></button>
<button className="std-button" onClick={this.addMoney(1e12)}>Add $1t</button> <button className="std-button" onClick={this.addMoney(1e12)}>Add <Money money={1e12} /></button>
<button className="std-button" onClick={this.addMoney(1e15)}>Add $1000t</button> <button className="std-button" onClick={this.addMoney(1e15)}>Add <Money money={1000e12} /></button>
<button className="std-button" onClick={this.addMoney(Infinity)}>Add $Infinity</button> <button className="std-button" onClick={this.addMoney(Infinity)}>Add <Money money={Infinity} /></button>
<button className="std-button" onClick={this.upgradeRam}>Upgrade Home Computer's RAM</button> <button className="std-button" onClick={this.upgradeRam}>Upgrade Home Computer's RAM</button>
</div> </div>
<div className="row"> <div className="row">

@ -124,7 +124,7 @@ export function purchaseAugmentationBoxCreate(aug, fac) {
<h2>{aug.name}</h2><br /> <h2>{aug.name}</h2><br />
{content}<br /><br /> {content}<br /><br />
<br />Would you like to purchase the {aug.name} Augmentation for&nbsp; <br />Would you like to purchase the {aug.name} Augmentation for&nbsp;
{Money(aug.baseCost * factionInfo.augmentationPriceMult)}? <Money money={aug.baseCost * factionInfo.augmentationPriceMult} />?
</>); </>);
} }

@ -40,7 +40,7 @@ export class HacknetNode extends React.Component {
} }
const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, Player.hacknet_node_level_cost_mult); const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, Player.hacknet_node_level_cost_mult);
upgradeLevelContent = <>Upgrade x{multiplier} - {Money(upgradeLevelCost)}</>; upgradeLevelContent = <>Upgrade x{multiplier} - <Money money={upgradeLevelCost} player={Player} /></>;
if (Player.money.lt(upgradeLevelCost)) { if (Player.money.lt(upgradeLevelCost)) {
upgradeLevelClass = "std-button-disabled"; upgradeLevelClass = "std-button-disabled";
} else { } else {
@ -71,7 +71,7 @@ export class HacknetNode extends React.Component {
} }
const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, Player.hacknet_node_ram_cost_mult); const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, Player.hacknet_node_ram_cost_mult);
upgradeRamContent = <>Upgrade x{multiplier} - {Money(upgradeRamCost)}</>; upgradeRamContent = <>Upgrade x{multiplier} - <Money money={upgradeRamCost} player={Player} /></>;
if (Player.money.lt(upgradeRamCost)) { if (Player.money.lt(upgradeRamCost)) {
upgradeRamClass = "std-button-disabled"; upgradeRamClass = "std-button-disabled";
} else { } else {
@ -102,7 +102,7 @@ export class HacknetNode extends React.Component {
} }
const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, Player.hacknet_node_core_cost_mult); const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, Player.hacknet_node_core_cost_mult);
upgradeCoresContent = <>Upgrade x{multiplier} - {Money(upgradeCoreCost)}</>; upgradeCoresContent = <>Upgrade x{multiplier} - <Money money={upgradeCoreCost} player={Player} /></>;
if (Player.money.lt(upgradeCoreCost)) { if (Player.money.lt(upgradeCoreCost)) {
upgradeCoresClass = "std-button-disabled"; upgradeCoresClass = "std-button-disabled";
} else { } else {
@ -128,7 +128,7 @@ export class HacknetNode extends React.Component {
<div className={"row"}> <div className={"row"}>
<p>Production:</p> <p>Production:</p>
<span className={"text money-gold"}> <span className={"text money-gold"}>
{Money(node.totalMoneyGenerated)} ({MoneyRate(node.moneyGainRatePerSecond)}) <Money money={node.totalMoneyGenerated} player={Player} /> ({MoneyRate(node.moneyGainRatePerSecond)})
</span> </span>
</div> </div>
<div className={"row"}> <div className={"row"}>

@ -44,7 +44,7 @@ export class HacknetServer extends React.Component {
} }
const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, Player.hacknet_node_level_cost_mult); const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, Player.hacknet_node_level_cost_mult);
upgradeLevelContent = <>Upgrade x{multiplier} - {Money(upgradeLevelCost)}</>; upgradeLevelContent = <>Upgrade x{multiplier} - <Money money={upgradeLevelCost} player={Player} /></>;
if (Player.money.lt(upgradeLevelCost)) { if (Player.money.lt(upgradeLevelCost)) {
upgradeLevelClass = "std-button-disabled"; upgradeLevelClass = "std-button-disabled";
} else { } else {
@ -76,7 +76,7 @@ export class HacknetServer extends React.Component {
} }
const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, Player.hacknet_node_ram_cost_mult); const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, Player.hacknet_node_ram_cost_mult);
upgradeRamContent = <>Upgrade x{multiplier} - {Money(upgradeRamCost)}</>; upgradeRamContent = <>Upgrade x{multiplier} - <Money money={upgradeRamCost} player={Player} /></>;
if (Player.money.lt(upgradeRamCost)) { if (Player.money.lt(upgradeRamCost)) {
upgradeRamClass = "std-button-disabled"; upgradeRamClass = "std-button-disabled";
} else { } else {
@ -108,7 +108,7 @@ export class HacknetServer extends React.Component {
} }
const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, Player.hacknet_node_core_cost_mult); const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, Player.hacknet_node_core_cost_mult);
upgradeCoresContent = <>Upgrade x{multiplier} - {Money(upgradeCoreCost)}</>; upgradeCoresContent = <>Upgrade x{multiplier} - <Money money={upgradeCoreCost} player={Player} /></>;
if (Player.money.lt(upgradeCoreCost)) { if (Player.money.lt(upgradeCoreCost)) {
upgradeCoresClass = "std-button-disabled"; upgradeCoresClass = "std-button-disabled";
} else { } else {
@ -140,7 +140,7 @@ export class HacknetServer extends React.Component {
} }
const upgradeCacheCost = node.calculateCacheUpgradeCost(multiplier); const upgradeCacheCost = node.calculateCacheUpgradeCost(multiplier);
upgradeCacheContent = <>Upgrade x{multiplier} - {Money(upgradeCacheCost)}</>; upgradeCacheContent = <>Upgrade x{multiplier} - <Money money={upgradeCacheCost} player={Player} /></>;
if (Player.money.lt(upgradeCacheCost)) { if (Player.money.lt(upgradeCacheCost)) {
upgradeCacheClass = "std-button-disabled"; upgradeCacheClass = "std-button-disabled";
} else { } else {

@ -26,7 +26,7 @@ export function PlayerInfo(props) {
return ( return (
<p id={"hacknet-nodes-money"}> <p id={"hacknet-nodes-money"}>
<span>Money: </span> <span>Money: </span>
{Money(Player.money.toNumber())}<br /> <Money money={Player.money.toNumber()} /><br />
{ {
hasServers && <><span>Hashes: {Hashes(Player.hashManager.hashes)} / {Hashes(Player.hashManager.capacity)}</span><br /></> hasServers && <><span>Hashes: {Hashes(Player.hashManager.hashes)} / {Hashes(Player.hashManager.capacity)}</span><br /></>

@ -23,10 +23,10 @@ export function PurchaseButton(props) {
text = <>Hacknet Server limit reached</>; text = <>Hacknet Server limit reached</>;
style = {color: "red"}; style = {color: "red"};
} else { } else {
text = <>Purchase Hacknet Server - {Money(cost)}</>; text = <>Purchase Hacknet Server - <Money money={cost} player={Player} /></>;
} }
} else { } else {
text = <>Purchase Hacknet Node - {Money(cost)}</>; text = <>Purchase Hacknet Node - <Money money={cost} player={Player} /></>;
} }
return ( return (

@ -12,6 +12,7 @@ import { purchaseRamForHomeComputer } from "../../Server/ServerPurchases";
import { StdButtonPurchased } from "../../ui/React/StdButtonPurchased"; import { StdButtonPurchased } from "../../ui/React/StdButtonPurchased";
import { StdButton } from "../../ui/React/StdButton"; import { StdButton } from "../../ui/React/StdButton";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import { MathComponent } from 'mathjax-react';
type IProps = { type IProps = {
p: IPlayer; p: IPlayer;
@ -34,18 +35,7 @@ export function CoresButton(props: IProps): React.ReactElement {
/>); />);
} }
const allCosts = [ const cost = 1e9*Math.pow(7.5, homeComputer.cpuCores);
0,
10e9,
250e9,
5e12,
100e12,
1e15,
20e15,
200e15,
];
const cost: number = allCosts[homeComputer.cpuCores];
function buy(): void { function buy(): void {
if(maxCores) return; if(maxCores) return;
@ -54,11 +44,12 @@ export function CoresButton(props: IProps): React.ReactElement {
homeComputer.cpuCores++; homeComputer.cpuCores++;
rerender(); rerender();
} }
//tooltip={<MathComponent tex={String.raw`cost = `} />}
return (<StdButton return (<StdButton
disabled={!props.p.canAfford(cost)} disabled={!props.p.canAfford(cost)}
onClick={buy} onClick={buy}
style={btnStyle} style={btnStyle}
text={<>Upgrade 'home' cores ({homeComputer.cpuCores} -&gt; {homeComputer.cpuCores+1}) - <Money money={cost} player={props.p} /></>} text={<>Upgrade 'home' cores ({homeComputer.cpuCores} -&gt; {homeComputer.cpuCores+1}) - <Money money={cost} player={props.p} /></>}
/>); />);
} }

@ -38,6 +38,7 @@ export function TechVendorLocation(props: IProps): React.ReactElement {
onClick={() => createPurchaseServerPopup(i, props.p)} onClick={() => createPurchaseServerPopup(i, props.p)}
style={btnStyle} style={btnStyle}
text={<>Purchase {i}GB Server - <Money money={cost} player={props.p} /></>} text={<>Purchase {i}GB Server - <Money money={cost} player={props.p} /></>}
disabled={!props.p.canAfford(cost)}
/>, />,
) )
} }

@ -47,7 +47,7 @@ export class TravelAgencyLocation extends React.Component<IProps, any> {
<div className="noselect"> <div className="noselect">
<p> <p>
From here, you can travel to any other city! A ticket From here, you can travel to any other city! A ticket
costs {Money(CONSTANTS.TravelCost)}. costs <Money money={CONSTANTS.TravelCost} />.
</p> </p>
<pre> ,_ . ._. _. .</pre> <pre> ,_ . ._. _. .</pre>
<pre> , _-\','|~\~ ~/ ;-'_ _-' ,;_;_, ~~-</pre> <pre> , _-\','|~\~ ~/ ;-'_ _-' ,;_;_, ~~-</pre>
@ -98,7 +98,7 @@ export class TravelAgencyLocation extends React.Component<IProps, any> {
<div> <div>
<p> <p>
From here, you can travel to any other city! A ticket From here, you can travel to any other city! A ticket
costs {Money(CONSTANTS.TravelCost)}. costs <Money money={CONSTANTS.TravelCost} />.
</p> </p>
{travelBtns} {travelBtns}
</div> </div>

@ -600,7 +600,7 @@ export function work(numCycles) {
You are currently working as a {position} at {this.companyName} (Current Company Reputation: {Reputation(companyRep)})<br /><br /> You are currently working as a {position} at {this.companyName} (Current Company Reputation: {Reputation(companyRep)})<br /><br />
You have been working for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br /> You have been working for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br />
You have earned: <br /><br /> You have earned: <br /><br />
{Money(this.workMoneyGained)} ({MoneyRate(this.workMoneyGainRate * CYCLES_PER_SEC)}) <br /><br /> <Money money={this.workMoneyGained} /> ({MoneyRate(this.workMoneyGainRate * CYCLES_PER_SEC)}) <br /><br />
{Reputation(this.workRepGained)} ({ReputationRate(this.workRepGainRate * CYCLES_PER_SEC)}) reputation for this company <br /><br /> {Reputation(this.workRepGained)} ({ReputationRate(this.workRepGainRate * CYCLES_PER_SEC)}) reputation for this company <br /><br />
{numeralWrapper.formatExp(this.workHackExpGained)} ({`${numeralWrapper.formatExp(this.workHackExpGainRate * CYCLES_PER_SEC)} / sec`}) hacking exp <br /><br /> {numeralWrapper.formatExp(this.workHackExpGained)} ({`${numeralWrapper.formatExp(this.workHackExpGainRate * CYCLES_PER_SEC)} / sec`}) hacking exp <br /><br />
{numeralWrapper.formatExp(this.workStrExpGained)} ({`${numeralWrapper.formatExp(this.workStrExpGainRate * CYCLES_PER_SEC)} / sec`}) strength exp <br /> {numeralWrapper.formatExp(this.workStrExpGained)} ({`${numeralWrapper.formatExp(this.workStrExpGainRate * CYCLES_PER_SEC)} / sec`}) strength exp <br />
@ -626,7 +626,7 @@ export function finishWork(cancelled, sing=false) {
let content = <> let content = <>
You earned a total of: <br /> You earned a total of: <br />
{Money(this.workMoneyGained)}<br /> <Money money={this.workMoneyGained} /><br />
{Reputation(this.workRepGained)} reputation for the company <br /> {Reputation(this.workRepGained)} reputation for the company <br />
{numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br /> {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />
{numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br /> {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />
@ -728,7 +728,7 @@ export function workPartTime(numCycles) {
You are currently working as a {position} at {this.companyName} (Current Company Reputation: {Reputation(companyRep)})<br /><br /> You are currently working as a {position} at {this.companyName} (Current Company Reputation: {Reputation(companyRep)})<br /><br />
You have been working for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br /> You have been working for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br />
You have earned: <br /><br /> You have earned: <br /><br />
{Money(this.workMoneyGained)} ({MoneyRate(this.workMoneyGainRate * CYCLES_PER_SEC)}) <br /><br /> <Money money={this.workMoneyGained} /> ({MoneyRate(this.workMoneyGainRate * CYCLES_PER_SEC)}) <br /><br />
{Reputation(this.workRepGained)} ({Reputation(`${numeralWrapper.formatExp(this.workRepGainRate * CYCLES_PER_SEC)} / sec`)}) reputation for this company <br /><br /> {Reputation(this.workRepGained)} ({Reputation(`${numeralWrapper.formatExp(this.workRepGainRate * CYCLES_PER_SEC)} / sec`)}) reputation for this company <br /><br />
{numeralWrapper.formatExp(this.workHackExpGained)} ({`${numeralWrapper.formatExp(this.workHackExpGainRate * CYCLES_PER_SEC)} / sec`}) hacking exp <br /><br /> {numeralWrapper.formatExp(this.workHackExpGained)} ({`${numeralWrapper.formatExp(this.workHackExpGainRate * CYCLES_PER_SEC)} / sec`}) hacking exp <br /><br />
{numeralWrapper.formatExp(this.workStrExpGained)} ({`${numeralWrapper.formatExp(this.workStrExpGainRate * CYCLES_PER_SEC)} / sec`}) strength exp <br /> {numeralWrapper.formatExp(this.workStrExpGained)} ({`${numeralWrapper.formatExp(this.workStrExpGainRate * CYCLES_PER_SEC)} / sec`}) strength exp <br />
@ -749,7 +749,7 @@ export function finishWorkPartTime(sing=false) {
const content = <> const content = <>
You worked for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br /> You worked for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br />
You earned a total of: <br /> You earned a total of: <br />
{Money(this.workMoneyGained)}<br /> <Money money={this.workMoneyGained} /><br />
{Reputation(this.workRepGained)} reputation for the company <br /> {Reputation(this.workRepGained)} reputation for the company <br />
{numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br /> {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />
{numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br /> {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />
@ -913,7 +913,7 @@ export function workForFaction(numCycles) {
(Current Faction Reputation: {Reputation(faction.playerReputation)}). <br /> (Current Faction Reputation: {Reputation(faction.playerReputation)}). <br />
You have been doing this for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br /> You have been doing this for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br />
You have earned: <br /><br /> You have earned: <br /><br />
{Money(this.workMoneyGained)} ({MoneyRate(this.workMoneyGainRate * CYCLES_PER_SEC)}) <br /><br /> <Money money={this.workMoneyGained} /> ({MoneyRate(this.workMoneyGainRate * CYCLES_PER_SEC)}) <br /><br />
{Reputation(this.workRepGained)} ({ReputationRate(this.workRepGainRate * CYCLES_PER_SEC)}) reputation for this faction <br /><br /> {Reputation(this.workRepGained)} ({ReputationRate(this.workRepGainRate * CYCLES_PER_SEC)}) reputation for this faction <br /><br />
{numeralWrapper.formatExp(this.workHackExpGained)} ({numeralWrapper.formatExp(this.workHackExpGainRate * CYCLES_PER_SEC)} / sec) hacking exp <br /><br /> {numeralWrapper.formatExp(this.workHackExpGained)} ({numeralWrapper.formatExp(this.workHackExpGainRate * CYCLES_PER_SEC)} / sec) hacking exp <br /><br />
{numeralWrapper.formatExp(this.workStrExpGained)} ({numeralWrapper.formatExp(this.workStrExpGainRate * CYCLES_PER_SEC)} / sec) strength exp <br /> {numeralWrapper.formatExp(this.workStrExpGained)} ({numeralWrapper.formatExp(this.workStrExpGainRate * CYCLES_PER_SEC)} / sec) strength exp <br />
@ -936,7 +936,7 @@ export function finishFactionWork(cancelled, sing=false) {
dialogBoxCreate(<> dialogBoxCreate(<>
You worked for your faction {faction.name} for a total of {convertTimeMsToTimeElapsedString(this.timeWorked)} <br /><br /> You worked for your faction {faction.name} for a total of {convertTimeMsToTimeElapsedString(this.timeWorked)} <br /><br />
You earned a total of: <br /> You earned a total of: <br />
{Money(this.workMoneyGained)}<br /> <Money money={this.workMoneyGained} /><br />
{Reputation(this.workRepGained)} reputation for the faction <br /> {Reputation(this.workRepGained)} reputation for the faction <br />
{numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br /> {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />
{numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br /> {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />
@ -1316,7 +1316,7 @@ export function takeClass(numCycles) {
ReactDOM.render(<> ReactDOM.render(<>
You have been {className} for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br /> You have been {className} for {convertTimeMsToTimeElapsedString(this.timeWorked)}<br /><br />
This has cost you: <br /> This has cost you: <br />
{Money(-this.workMoneyGained)} ({MoneyRate(this.workMoneyLossRate * CYCLES_PER_SEC)}) <br /><br /> <Money money={-this.workMoneyGained} /> ({MoneyRate(this.workMoneyLossRate * CYCLES_PER_SEC)}) <br /><br />
You have gained: <br /> You have gained: <br />
{numeralWrapper.formatExp(this.workHackExpGained)} ({numeralWrapper.formatExp(this.workHackExpGainRate * CYCLES_PER_SEC)} / sec) hacking exp <br /> {numeralWrapper.formatExp(this.workHackExpGained)} ({numeralWrapper.formatExp(this.workHackExpGainRate * CYCLES_PER_SEC)} / sec) hacking exp <br />
{numeralWrapper.formatExp(this.workStrExpGained)} ({numeralWrapper.formatExp(this.workStrExpGainRate * CYCLES_PER_SEC)} / sec) strength exp <br /> {numeralWrapper.formatExp(this.workStrExpGained)} ({numeralWrapper.formatExp(this.workStrExpGainRate * CYCLES_PER_SEC)} / sec) strength exp <br />
@ -1341,7 +1341,7 @@ export function finishClass(sing=false) {
if (!sing) { if (!sing) {
dialogBoxCreate(<> dialogBoxCreate(<>
After {this.className} for {convertTimeMsToTimeElapsedString(this.timeWorked)}, <br /> After {this.className} for {convertTimeMsToTimeElapsedString(this.timeWorked)}, <br />
you spent a total of {Money(this.workMoneyGained * -1)}. <br /><br /> you spent a total of <Money money={-this.workMoneyGained} />. <br /><br />
You earned a total of: <br /> You earned a total of: <br />
{numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br /> {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />
{numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br /> {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />
@ -1475,7 +1475,7 @@ export function finishCrime(cancelled) {
dialogBoxCreate(<> dialogBoxCreate(<>
Crime successful!<br /><br /> Crime successful!<br /><br />
You gained:<br /> You gained:<br />
{Money(this.workMoneyGained)}<br /> <Money money={this.workMoneyGained} /><br />
{numeralWrapper.formatExp(this.workHackExpGained)} hacking experience <br /> {numeralWrapper.formatExp(this.workHackExpGained)} hacking experience <br />
{numeralWrapper.formatExp(this.workStrExpGained)} strength experience<br /> {numeralWrapper.formatExp(this.workStrExpGained)} strength experience<br />
{numeralWrapper.formatExp(this.workDefExpGained)} defense experience<br /> {numeralWrapper.formatExp(this.workDefExpGained)} defense experience<br />
@ -1596,7 +1596,7 @@ export function hospitalize() {
dialogBoxCreate(<> dialogBoxCreate(<>
You were in critical condition! You were taken to the hospital where You were in critical condition! You were taken to the hospital where
luckily they were able to save your life. You were charged&nbsp; luckily they were able to save your life. You were charged&nbsp;
{Money(cost)} <Money money={cost} />
</>); </>);
} }

@ -555,7 +555,7 @@ let Terminal = {
server.fortify(CONSTANTS.ServerFortifyAmount); server.fortify(CONSTANTS.ServerFortifyAmount);
postElement(<>Hack successful! Gained {Money(moneyGained)} and {numeralWrapper.formatExp(expGainedOnSuccess)} hacking exp</>); postElement(<>Hack successful! Gained <Money money={moneyGained} /> and {numeralWrapper.formatExp(expGainedOnSuccess)} hacking exp</>);
} else { // Failure } else { // Failure
// Player only gains 25% exp for failure? TODO Can change this later to balance // Player only gains 25% exp for failure? TODO Can change this later to balance
Player.gainHackingExp(expGainedOnFailure) Player.gainHackingExp(expGainedOnFailure)
@ -600,7 +600,7 @@ let Terminal = {
post("Chance to hack: " + (!isHacknet ? numeralWrapper.formatPercentage(hackingChance) : "N/A")); post("Chance to hack: " + (!isHacknet ? numeralWrapper.formatPercentage(hackingChance) : "N/A"));
const hackingTime = calculateHackingTime(currServ, Player)*1000; const hackingTime = calculateHackingTime(currServ, Player)*1000;
post("Time to hack: " + (!isHacknet ? convertTimeMsToTimeElapsedString(hackingTime, true) : "N/A")); post("Time to hack: " + (!isHacknet ? convertTimeMsToTimeElapsedString(hackingTime, true) : "N/A"));
postElement(<>Total money available on server: {!isHacknet ? Money(currServ.moneyAvailable) : "N/A"}</>); postElement(<>Total money available on server: {!isHacknet ? <Money money={currServ.moneyAvailable} /> : "N/A"}</>);
const numPort = currServ.numOpenPortsRequired; const numPort = currServ.numOpenPortsRequired;
post("Required number of open ports for NUKE: " + (!isHacknet ? numPort : "N/A")); post("Required number of open ports for NUKE: " + (!isHacknet ? numPort : "N/A"));
post("SSH port: "+ (currServ.sshPortOpen ? "Open" : "Closed")) post("SSH port: "+ (currServ.sshPortOpen ? "Open" : "Closed"))
@ -2242,7 +2242,7 @@ let Terminal = {
Player.hacking_skill >= 2500; Player.hacking_skill >= 2500;
if(!fulfilled) { if(!fulfilled) {
post(`Augmentations: ${Player.augmentations.length} / ${numAugReq}`); post(`Augmentations: ${Player.augmentations.length} / ${numAugReq}`);
postElement(<>Money: {Money(Player.money.toNumber())} / {Money(1e11)}</>); postElement(<>Money: <Money money={Player.money.toNumber()} /> / <Money money={1e11} /></>);
post(`Hacking skill: ${Player.hacking_skill} / 2500`); post(`Hacking skill: ${Player.hacking_skill} / 2500`);
return; return;
} }

@ -1059,7 +1059,7 @@ const Engine = {
var offlineProductionFromHacknetNodes = processHacknetEarnings(numCyclesOffline); var offlineProductionFromHacknetNodes = processHacknetEarnings(numCyclesOffline);
const hacknetProdInfo = hasHacknetServers() ? const hacknetProdInfo = hasHacknetServers() ?
<>{Hashes(offlineProductionFromHacknetNodes)} hashes</>: <>{Hashes(offlineProductionFromHacknetNodes)} hashes</>:
Money(offlineProductionFromHacknetNodes); <Money money={offlineProductionFromHacknetNodes} />;
// Passive faction rep gain offline // Passive faction rep gain offline
processPassiveFactionRepGain(numCyclesOffline); processPassiveFactionRepGain(numCyclesOffline);
@ -1113,7 +1113,7 @@ const Engine = {
const timeOfflineString = convertTimeMsToTimeElapsedString(time); const timeOfflineString = convertTimeMsToTimeElapsedString(time);
dialogBoxCreate(<> dialogBoxCreate(<>
Offline for {timeOfflineString}. While you were offline, your scripts Offline for {timeOfflineString}. While you were offline, your scripts
generated {Money(offlineHackingIncome)}, your Hacknet Nodes generated <Money money={offlineHackingIncome} />, your Hacknet Nodes
generated {hacknetProdInfo} and you generated {hacknetProdInfo} and you
gained {Reputation(offlineReputation)} divided amongst your factions. gained {Reputation(offlineReputation)} divided amongst your factions.
</>); </>);

@ -154,7 +154,7 @@ export function CharacterInfo(p: IPlayer): React.ReactElement {
<LastEmployer /> <LastEmployer />
<LastJob /> <LastJob />
<Employers /> <Employers />
<span>Money: {Money(p.money.toNumber())}</span> <span>Money: <Money money={p.money.toNumber()} /></span>
<button className="popup-box-button" style={{display: 'inline-block', float: 'none'}} onClick={openMoneyModal}>Money Statistics & Breakdown</button><br /><br /> <button className="popup-box-button" style={{display: 'inline-block', float: 'none'}} onClick={openMoneyModal}>Money Statistics & Breakdown</button><br /><br />
<b>Stats</b> <b>Stats</b>
<table> <table>