import { Box, Button, Section, Dimmer, Table, Icon, NoticeBox, Tabs, Grid, LabeledList } from "../components";
import { useBackend } from "../backend";
import { Fragment, Component } from "inferno";
export class FakeTerminal extends Component {
constructor(props) {
super(props);
this.timer = null;
this.state = {
currentIndex: 0,
currentDisplay: [],
};
}
tick() {
const { props, state } = this;
if (state.currentIndex <= props.allMessages.length) {
this.setState(prevState => {
return ({
currentIndex: prevState.currentIndex + 1,
});
});
const { currentDisplay } = state;
currentDisplay.push(props.allMessages[state.currentIndex]);
} else {
clearTimeout(this.timer);
setTimeout(props.onFinished, props.finishedTimeout);
}
}
componentDidMount() {
const {
linesPerSecond = 2.5,
} = this.props;
this.timer = setInterval(() => this.tick(), 1000 / linesPerSecond);
}
componentWillUnmount() {
clearTimeout(this.timer);
}
render() {
return (
{this.state.currentDisplay.map(value => (
{value}
))}
);
}
}
export const SyndContractor = props => {
const { data, act } = useBackend(props);
const terminalMessages = [
"Recording biometric data...",
"Analyzing embedded syndicate info...",
"STATUS CONFIRMED",
"Contacting syndicate database...",
"Awaiting response...",
"Awaiting response...",
"Awaiting response...",
"Awaiting response...",
"Awaiting response...",
"Awaiting response...",
"Response received, ack 4851234...",
"CONFIRM ACC " + (Math.round(Math.random() * 20000)),
"Setting up private accounts...",
"CONTRACTOR ACCOUNT CREATED",
"Searching for available contracts...",
"Searching for available contracts...",
"Searching for available contracts...",
"Searching for available contracts...",
"CONTRACTS FOUND",
"WELCOME, AGENT",
];
const infoEntries = [
"SyndTract v2.0",
"",
"We've identified potentional high-value targets that are",
"currently assigned to your mission area. They are believed",
"to hold valuable information which could be of immediate",
"importance to our organisation.",
"",
"Listed below are all of the contracts available to you. You",
"are to bring the specified target to the designated",
"drop-off, and contact us via this uplink. We will send",
"a specialised extraction unit to put the body into.",
"",
"We want targets alive - but we will sometimes pay slight",
"amounts if they're not, you just won't recieve the shown",
"bonus. You can redeem your payment through this uplink in",
"the form of raw telecrystals, which can be put into your",
"regular Syndicate uplink to purchase whatever you may need.",
"We provide you with these crystals the moment you send the",
"target up to us, which can be collected at anytime through",
"this system.",
"",
"Targets extracted will be ransomed back to the station once",
"their use to us is fulfilled, with us providing you a small",
"percentage cut. You may want to be mindful of them",
"identifying you when they come back. We provide you with",
"a standard contractor loadout, which will help cover your",
"identity.",
];
const errorPane = !!data.error && (