2021-06-17 23:47:45 +02:00
|
|
|
/**
|
|
|
|
* React Component for displaying the bonus time remaining.
|
|
|
|
*/
|
2021-06-17 23:37:05 +02:00
|
|
|
import * as React from "react";
|
|
|
|
import { Gang } from "../Gang";
|
|
|
|
import { CONSTANTS } from "../../Constants";
|
|
|
|
import { convertTimeMsToTimeElapsedString } from "../../../utils/StringHelperFunctions";
|
|
|
|
|
|
|
|
interface IProps {
|
|
|
|
gang: Gang;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function BonusTime(props: IProps): React.ReactElement {
|
|
|
|
const CyclerPerSecond = 1000 / CONSTANTS._idleSpeed;
|
|
|
|
if (props.gang.storedCycles / CyclerPerSecond*1000 <= 5000) return (<></>);
|
|
|
|
const bonusMillis = props.gang.storedCycles / CyclerPerSecond * 1000;
|
|
|
|
return (<>
|
|
|
|
<p className="tooltip" style={{display: "inline-block"}}>
|
|
|
|
Bonus time: {convertTimeMsToTimeElapsedString(bonusMillis)}
|
2021-08-15 20:09:58 +02:00
|
|
|
<span className="tooltiptext noselect">
|
2021-06-17 23:37:05 +02:00
|
|
|
You gain bonus time while offline or when the game is inactive
|
|
|
|
(e.g. when the tab is throttled by the browser). Bonus time
|
|
|
|
makes the Gang mechanic progress faster, up to 5x the normal
|
|
|
|
speed.
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
<br />
|
|
|
|
</>);
|
|
|
|
}
|