Small hotfix (#840)

* yesno box now correctly clean up before new content is loaded in.

* formatHp doesnt display decimal, duh

* character overview uses numeralWrapper formatHp

* minor formatting stuff

* Class spending is tracked indepedently of work money

* Made an augmentation named after myself.

* hotfix a bunch of small stuff
This commit is contained in:
hydroflame 2021-04-12 20:03:32 -04:00 committed by GitHub
parent 0afdba8f38
commit 80b703639e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 36 additions and 11 deletions

File diff suppressed because one or more lines are too long

@ -1395,6 +1395,23 @@ function initAugmentations() {
}
AddToAugmentations(Xanipher);
const HydroflameLeftArm = new Augmentation({
name:AugmentationNames.HydroflameLeftArm, repCost:500e3, moneyCost:500e9,
info:"The left arm of a legendary BitRunner who ascended beyond this world. " +
"It projects a light blue energy shield that protects the exposed inner parts. " +
"Even though it contains no weapons, the advance tungsten titanium " +
"alloy increases the users strength to unbelievable levels.<br><br>" +
"This augmentation increases the player's strength by 300%.",
strength_mult: 3,
});
HydroflameLeftArm.addToFactions(["NWO"]);
if (augmentationExists(AugmentationNames.HydroflameLeftArm)) {
delete Augmentations[AugmentationNames.HydroflameLeftArm];
}
AddToAugmentations(HydroflameLeftArm);
// ClarkeIncorporated
const nextSENS = new Augmentation({
name:AugmentationNames.nextSENS, repCost:175e3, moneyCost:385e6,

@ -89,6 +89,7 @@ export let AugmentationNames: IMap<string> = {
BrachiBlades: "BrachiBlades",
BionicArms: "Bionic Arms",
SNA: "Social Negotiation Assistant (S.N.A)",
HydroflameLeftArm: "Hydroflame left arm",
EsperEyewear: "EsperTech Bladeburner Eyewear",
EMS4Recombination: "EMS-4 Recombination",
OrionShoulder: "ORION-MKIV Shoulder",

@ -124,8 +124,7 @@ export class HacknetNode extends React.Component {
<li className={"hacknet-node"}>
<div className={"hacknet-node-container"}>
<div className={"row"}>
<p>Node name:</p>
<span className={"text"}>{node.name}</span>
<h1 style={{"fontSize":"1em"}}>{node.name}</h1>
</div>
<div className={"row"}>
<p>Production:</p>

@ -163,8 +163,7 @@ export class HacknetServer extends React.Component {
<li className={"hacknet-node"}>
<div className={"hacknet-node-container"}>
<div className={"row"}>
<p>Node name:</p>
<span className={"text"}>{node.hostname}</span>
<h1 style={{"fontSize":"1em"}}>{node.hostname}</h1>
</div>
<div className={"row"}>
<p>Production:</p>

@ -550,7 +550,11 @@ export function processWorkEarnings(numCycles=1) {
this.gainAgilityExp(agiExpGain);
this.gainCharismaExp(chaExpGain);
this.gainMoney(moneyGain);
this.recordMoneySource(moneyGain, "work");
if (this.className) {
this.recordMoneySource(moneyGain, "class");
} else {
this.recordMoneySource(moneyGain, "work");
}
this.workHackExpGained += hackExpGain;
this.workStrExpGained += strExpGain;
this.workDefExpGained += defExpGain;

@ -40,7 +40,7 @@ export function CharacterInfo(p: IPlayer): React.ReactElement {
function Hacknet(): React.ReactElement {
// Can't import HacknetHelpers for some reason.
if(!(p.bitNodeN === 9 || SourceFileFlags[9] > 0)) {
return <><span>{`Hacknet Nodes owned: ${p.hacknetNodes.length}</span>`}</span><br /></>
return <><span>{`Hacknet Nodes owned: ${p.hacknetNodes.length}`}</span><br /></>
} else {
return <><span>{`Hacknet Servers owned: ${p.hacknetNodes.length} / ${HacknetServerConstants.MaxServers}`}</span><br /></>
}
@ -51,6 +51,7 @@ export function CharacterInfo(p: IPlayer): React.ReactElement {
if (src.bladeburner) { parts.push([`Bladeburner:`, Money(src.bladeburner)]) };
if (src.codingcontract) { parts.push([`Coding Contracts:`, Money(src.codingcontract)]) };
if (src.work) { parts.push([`Company Work:`, Money(src.work)]) };
if (src.class) { parts.push([`Class:`, Money(src.class)]) };
if (src.corporation) { parts.push([`Corporation:`, Money(src.corporation)]) };
if (src.crime) { parts.push([`Crimes:`, Money(src.crime)]) };
if (src.gang) { parts.push([`Gang:`, Money(src.gang)]) };

@ -19,7 +19,7 @@ export class CharacterOverviewComponent extends Component {
<table>
<tbody>
<tr id="character-hp-wrapper">
<td className="character-hp-cell">Hp:</td><td id="character-hp-text" className="character-hp-cell character-stat-cell">{Player.hp + " / " + Player.max_hp}</td>
<td className="character-hp-cell">Hp:</td><td id="character-hp-text" className="character-hp-cell character-stat-cell">{numeralWrapper.formatHp(Player.hp) + " / " + numeralWrapper.formatHp(Player.max_hp)}</td>
</tr>
<tr id="character-money-wrapper">
<td className="character-money-cell">Money:&nbsp;</td><td id="character-money-text" className="character-money-cell character-stat-cell">{numeralWrapper.formatMoney(Player.money.toNumber())}</td>

@ -49,7 +49,7 @@ class NumeralFormatter {
}
formatHp(n: number): string {
return this.format(n, "0.0");
return this.format(n, "0");
}
formatMoney(n: number): string {

@ -11,6 +11,8 @@ export class MoneySourceTracker {
}
bladeburner: number = 0;
casino: number = 0;
class: number = 0;
codingcontract: number = 0;
corporation: number = 0;
crime: number = 0;
@ -22,7 +24,6 @@ export class MoneySourceTracker {
stock: number = 0;
total: number = 0;
work: number = 0;
casino: number = 0;
[key: string]: number | Function;

@ -56,6 +56,8 @@ export function yesNoBoxCreate(txt: string | JSX.Element) {
yesNoBoxOpen = true;
if (yesNoBoxTextElement) {
ReactDOM.unmountComponentAtNode(yesNoBoxTextElement);
yesNoBoxTextElement.innerHTML = '';
if(typeof txt === 'string') {
yesNoBoxTextElement.innerHTML = txt as string;
} else {
@ -136,6 +138,7 @@ export function yesNoTxtInpBoxCreate(txt: string | JSX.Element) {
if (yesNoTextInputBoxTextElement) {
ReactDOM.unmountComponentAtNode(yesNoTextInputBoxTextElement);
yesNoTextInputBoxTextElement.innerHTML = '';
if(typeof txt === 'string') {
yesNoTextInputBoxTextElement.innerHTML = txt;