fix infiltration

This commit is contained in:
Olivier Gagnon 2021-09-20 17:10:44 -04:00
parent 9552ae3ef1
commit bb4de3f62c
9 changed files with 116 additions and 11 deletions

@ -0,0 +1,73 @@
export {};
describe("netscript", () => {
it("Do naviguation", () => {
cy.findByRole("button", { name: "SKIP TUTORIAL" }).click();
cy.findByText("Got it!").click();
cy.findByText("Dev").click();
cy.findByText(/Source-Files/i).click();
cy.findByLabelText(/all-sf-3/i).click();
cy.findByText(/Experience/i).click();
cy.findByText(/Tons of exp/i).click();
cy.findByText(/General/i).click();
cy.findByText(/Hack w0/i).click();
cy.findByText(/SEMPOOL INVALID/i);
cy.findByText(/Many decades/i, { timeout: 15000 });
cy.findByLabelText("enter-bitnode-1").click();
cy.findByText(/Enter BN1.2/i).click();
cy.get("body").type("{esc}");
cy.findByText("Dev").click();
cy.findByText(/Experience/i).click();
cy.findByText(/Tons of exp/i).click();
cy.findByText("Create Script").click();
cy.findByText(/Script name:/i);
cy.findByText("Active Scripts").click();
cy.findByText(/Total online production of/i);
cy.findByText("Create Program").click();
cy.findByText(/This page displays/i);
cy.findByText("Stats").click();
cy.findByText(/Current City:/i);
cy.findByText("Factions").click();
cy.findByText(/Lists all/i);
cy.findByText("Augmentations").click();
cy.findByText(/Purchased Augmentations/i);
cy.findByText("Hacknet").click();
cy.findByText(/The Hacknet is a global/i);
cy.findByText("Sleeves").click();
cy.findByText(/Duplicate Sleeves are MK/i);
cy.findByText("City").click();
cy.findByText(/Sector-12/i);
cy.findByLabelText("The Slums").click();
cy.findByText("City").click();
cy.findByLabelText("Powerhouse Gym").click();
cy.findByText("City").click();
cy.findByLabelText("MegaCorp").click();
cy.findByText("Travel").click();
cy.findByText(/Travel Agency/i);
cy.findByText("Stock Market").click();
cy.findByText(/ECorp/i);
cy.findByText("Milestones").click();
cy.findByText(/don't reward you for/i);
cy.findByText("Tutorial").click();
cy.findByText(/AKA Links to/i);
cy.findByText("Options").click();
cy.findByText(/Netscript exec time/i);
});
});

@ -44,7 +44,11 @@ function BitNodePortal(props: IPortalProps): React.ReactElement {
} }
return ( return (
<a className={`bitnode ${cssClass} tooltip`} onClick={openPortalPopup}> <button
className={`bitnode ${cssClass} tooltip`}
aria-label={`enter-bitnode-${bitNode.number.toString()}`}
onClick={openPortalPopup}
>
<strong>O</strong> <strong>O</strong>
<span className="tooltiptext"> <span className="tooltiptext">
<strong> <strong>
@ -56,7 +60,7 @@ function BitNodePortal(props: IPortalProps): React.ReactElement {
{bitNode.desc} {bitNode.desc}
<br /> <br />
</span> </span>
</a> </button>
); );
} }

@ -119,10 +119,10 @@ export function Factions(props: IProps): React.ReactElement {
value={faction} value={faction}
startAdornment={ startAdornment={
<> <>
<IconButton onClick={receiveAllInvites} size="large"> <IconButton onClick={receiveAllInvites} size="large" arial-label="receive-all-invitation">
<ReplyAllIcon /> <ReplyAllIcon />
</IconButton> </IconButton>
<IconButton onClick={receiveInvite} size="large"> <IconButton onClick={receiveInvite} size="large" arial-label="receive-one-invitation">
<ReplyIcon /> <ReplyIcon />
</IconButton> </IconButton>
</> </>

@ -72,10 +72,18 @@ export function SourceFiles(props: IProps): React.ReactElement {
</td> </td>
<td> <td>
<ButtonGroup> <ButtonGroup>
<Button onClick={setAllSF(0)}>0</Button> <Button aria-label="all-sf-0" onClick={setAllSF(0)}>
<Button onClick={setAllSF(1)}>1</Button> 0
<Button onClick={setAllSF(2)}>2</Button> </Button>
<Button onClick={setAllSF(3)}>3</Button> <Button aria-label="all-sf-1" onClick={setAllSF(1)}>
1
</Button>
<Button aria-label="all-sf-2" onClick={setAllSF(2)}>
2
</Button>
<Button aria-label="all-sf-3" onClick={setAllSF(3)}>
3
</Button>
</ButtonGroup> </ButtonGroup>
</td> </td>
</tr> </tr>

@ -48,11 +48,12 @@ function coloredArrow(difficulty: number): JSX.Element {
} }
export function Intro(props: IProps): React.ReactElement { export function Intro(props: IProps): React.ReactElement {
console.log(props);
return ( return (
<> <>
<Grid container spacing={3}> <Grid container spacing={3}>
<Grid item xs={10}> <Grid item xs={10}>
<h1>Infiltrating {props.Location}</h1> <h1>Infiltrating {props.Location.name}</h1>
</Grid> </Grid>
<Grid item xs={10}> <Grid item xs={10}>
<h2>Maximum level: {props.MaxLevel}</h2> <h2>Maximum level: {props.MaxLevel}</h2>

@ -35,6 +35,7 @@ function LocationLetter(location: Location): React.ReactElement {
if (!location) return <span>*</span>; if (!location) return <span>*</span>;
return ( return (
<span <span
aria-label={location.name}
key={location.name} key={location.name}
className="tooltip" className="tooltip"
style={{ style={{

@ -114,6 +114,7 @@ export function SlumsLocation(): React.ReactElement {
return ( return (
<div> <div>
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Shoplift (${numeralWrapper.formatPercentage(shopliftChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={shoplift} onClick={shoplift}
style={{ display: "block" }} style={{ display: "block" }}
@ -121,6 +122,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to shoplift from a low-end retailer"} tooltip={"Attempt to shoplift from a low-end retailer"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Rob store (${numeralWrapper.formatPercentage(robStoreChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={robStore} onClick={robStore}
style={{ display: "block" }} style={{ display: "block" }}
@ -128,6 +130,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to commit armed robbery on a high-end store"} tooltip={"Attempt to commit armed robbery on a high-end store"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Mug someone (${numeralWrapper.formatPercentage(mugChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={mug} onClick={mug}
style={{ display: "block" }} style={{ display: "block" }}
@ -135,6 +138,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to mug a random person on the street"} tooltip={"Attempt to mug a random person on the street"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Larceny (${numeralWrapper.formatPercentage(larcenyChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={larceny} onClick={larceny}
style={{ display: "block" }} style={{ display: "block" }}
@ -142,6 +146,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to rob property from someone's house"} tooltip={"Attempt to rob property from someone's house"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Deal Drugs (${numeralWrapper.formatPercentage(drugsChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={dealDrugs} onClick={dealDrugs}
style={{ display: "block" }} style={{ display: "block" }}
@ -149,6 +154,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to deal drugs"} tooltip={"Attempt to deal drugs"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Bond Forgery (${numeralWrapper.formatPercentage(bondChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={bondForgery} onClick={bondForgery}
style={{ display: "block" }} style={{ display: "block" }}
@ -156,6 +162,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to forge corporate bonds"} tooltip={"Attempt to forge corporate bonds"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Traffick illegal Arms (${numeralWrapper.formatPercentage(armsChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={traffickArms} onClick={traffickArms}
style={{ display: "block" }} style={{ display: "block" }}
@ -163,6 +170,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to smuggle illegal arms into the city"} tooltip={"Attempt to smuggle illegal arms into the city"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Homicide (${numeralWrapper.formatPercentage(homicideChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={homicide} onClick={homicide}
style={{ display: "block" }} style={{ display: "block" }}
@ -170,6 +178,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to murder a random person on the street"} tooltip={"Attempt to murder a random person on the street"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Grand theft Auto (${numeralWrapper.formatPercentage(gtaChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={grandTheftAuto} onClick={grandTheftAuto}
style={{ display: "block" }} style={{ display: "block" }}
@ -177,6 +186,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to commit grand theft auto"} tooltip={"Attempt to commit grand theft auto"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Kidnap and Ransom (${numeralWrapper.formatPercentage(kidnapChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={kidnap} onClick={kidnap}
style={{ display: "block" }} style={{ display: "block" }}
@ -184,6 +194,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to kidnap and ransom a high-profile-target"} tooltip={"Attempt to kidnap and ransom a high-profile-target"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Assassinate (${numeralWrapper.formatPercentage(assassinateChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={assassinate} onClick={assassinate}
style={{ display: "block" }} style={{ display: "block" }}
@ -191,6 +202,7 @@ export function SlumsLocation(): React.ReactElement {
tooltip={"Attempt to assassinate a high-profile target"} tooltip={"Attempt to assassinate a high-profile target"}
/> />
<AutoupdatingStdButton <AutoupdatingStdButton
label={`Heist (${numeralWrapper.formatPercentage(heistChance)} chance of success)`}
intervalTime={5e3} intervalTime={5e3}
onClick={heist} onClick={heist}
style={{ display: "block" }} style={{ display: "block" }}

@ -7,6 +7,7 @@
import * as React from "react"; import * as React from "react";
interface IProps { interface IProps {
label?: string;
disabled?: boolean; disabled?: boolean;
intervalTime?: number; intervalTime?: number;
onClick?: (e: React.MouseEvent<HTMLElement>) => any; onClick?: (e: React.MouseEvent<HTMLElement>) => any;
@ -65,7 +66,12 @@ export class AutoupdatingStdButton extends React.Component<IProps, IState> {
}; };
return ( return (
<button className={className} onClick={this.props.onClick} style={this.props.style}> <button
aria-label={this.props.label || ""}
className={className}
onClick={this.props.onClick}
style={this.props.style}
>
{this.props.text} {this.props.text}
{hasTooltip && <span className={"tooltiptext"} dangerouslySetInnerHTML={tooltipMarkup}></span>} {hasTooltip && <span className={"tooltiptext"} dangerouslySetInnerHTML={tooltipMarkup}></span>}
</button> </button>

@ -57,7 +57,7 @@ module.exports = (env, argv) => {
$: "jquery", $: "jquery",
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
title: "Bitburner" + (isDevelopment ? " - development" : ""), title: "Bitburner",
template: "src/index.html", template: "src/index.html",
favicon: "favicon.ico", favicon: "favicon.ico",
googleAnalytics: { googleAnalytics: {