import * as React from "react"; import { numeralWrapper } from "../ui/numeralFormat"; import { BitNodes } from "../BitNode/BitNode"; import { IPlayer } from "../PersonObjects/IPlayer"; import { MoneySourceTracker } from "../utils/MoneySourceTracker"; import { dialogBoxCreate } from "../../utils/DialogBox"; import { convertTimeMsToTimeElapsedString } from "../../utils/StringHelperFunctions"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; import { SourceFileFlags } from "../SourceFile/SourceFileFlags"; import { getPurchaseServerLimit } from "../Server/ServerPurchases"; import { MaxNumberHacknetServers } from "../Hacknet/HacknetServer"; export function CharacterInfo(p: IPlayer): React.ReactElement { function LastEmployer(): React.ReactElement { if (p.companyName) { return <>Employer at which you last worked: {p.companyName}
; } return <>; } function LastJob(): React.ReactElement { if (p.companyName !== "") { return <>Job you last worked: {p.jobs[p.companyName]}
; } return <>; } function Employers(): React.ReactElement { if (p.jobs && Object.keys(p.jobs).length !== 0) return <> All Employers:


return <>; } function convertMoneySourceTrackerToString(src: MoneySourceTracker): string { let parts: string[] = [`Total: ${numeralWrapper.formatMoney(src.total)}`]; if (src.bladeburner) { parts.push(`Bladeburner: ${numeralWrapper.formatMoney(src.bladeburner)}`) }; if (src.codingcontract) { parts.push(`Coding Contracts: ${numeralWrapper.formatMoney(src.codingcontract)}`) }; if (src.work) { parts.push(`Company Work: ${numeralWrapper.formatMoney(src.work)}`) }; if (src.corporation) { parts.push(`Corporation: ${numeralWrapper.formatMoney(src.corporation)}`) }; if (src.crime) { parts.push(`Crimes: ${numeralWrapper.formatMoney(src.crime)}`) }; if (src.gang) { parts.push(`Gang: ${numeralWrapper.formatMoney(src.gang)}`) }; if (src.hacking) { parts.push(`Hacking: ${numeralWrapper.formatMoney(src.hacking)}`) }; if (src.hacknetnode) { parts.push(`Hacknet Nodes: ${numeralWrapper.formatMoney(src.hacknetnode)}`) }; if (src.hospitalization) { parts.push(`Hospitalization: ${numeralWrapper.formatMoney(src.hospitalization)}`) }; if (src.infiltration) { parts.push(`Infiltration: ${numeralWrapper.formatMoney(src.infiltration)}`) }; if (src.stock) { parts.push(`Stock Market: ${numeralWrapper.formatMoney(src.stock)}`) }; return parts.join("
"); } function openMoneyModal() { let txt: string = "Money earned since you last installed Augmentations:
" + convertMoneySourceTrackerToString(p.moneySourceA); if (p.sourceFiles.length !== 0) { txt += "

Money earned in this BitNode:
" + convertMoneySourceTrackerToString(p.moneySourceB); } dialogBoxCreate(txt, false); } function Intelligence(): React.ReactElement { if (p.intelligence > 0) { return Intelligence: {(p.intelligence).toLocaleString()} ; } return <>; } function MultiplierTable(props: any): React.ReactElement { function bn5Stat(r: any) { if(SourceFileFlags[5] > 0 && r.length > 2 && r[1] != r[2]) { return ({numeralWrapper.formatPercentage(r[2])}) } return undefined; } return <> {props.rows.map((r: any) => {bn5Stat(r)} )}
{r[0]} multiplier: {numeralWrapper.formatPercentage(r[1])}
} function BitNodeTimeText(): React.ReactElement { if(p.sourceFiles.length > 0) { return <> Time played since last Bitnode destroyed: {convertTimeMsToTimeElapsedString(p.playtimeSinceLastBitnode)}
} return <> } function CurrentBitNode(): React.ReactElement { if(p.sourceFiles.length > 0) { const index = "BitNode" + p.bitNodeN; return <> Current BitNode: {p.bitNodeN} ({BitNodes[index].name})

{BitNodes[index].info.split("
").map((t, i) =>
{t}
)}
} return <> } return (
            General
            

Current City: {p.city}
Money: {numeralWrapper.formatMoney(p.money.toNumber())}

Stats
Hacking: {p.hacking_skill.toLocaleString()} ({numeralWrapper.format(p.hacking_exp, '0.000a')} exp)
Strength: {p.strength.toLocaleString()} ({numeralWrapper.format(p.strength_exp, '0.000a')} exp)
Defense: {p.defense.toLocaleString()} ({numeralWrapper.format(p.defense_exp, '0.000a')} exp)
Dexterity: {p.dexterity.toLocaleString()} ({numeralWrapper.format(p.dexterity_exp, '0.000a')} exp)
Agility: {p.agility.toLocaleString()} ({numeralWrapper.format(p.agility_exp, '0.000a')} exp)
Charisma: {p.charisma.toLocaleString()} ({numeralWrapper.format(p.charisma_exp, '0.000a')} exp)












Misc.

Servers owned: {p.purchasedServers.length} / {getPurchaseServerLimit()}
Hacknet Nodes owned: {p.hacknetNodes.length} / {MaxNumberHacknetServers}
Augmentations installed: {p.augmentations.length}
Time played since last Augmentation: {convertTimeMsToTimeElapsedString(p.playtimeSinceLastAug)}
Time played: {convertTimeMsToTimeElapsedString(p.totalPlaytime)}

) }