moved over to player stats

* added new augmentations
This commit is contained in:
phyzical
2022-03-27 12:26:43 +08:00
parent e11cc1946e
commit 7f28158005
14 changed files with 267 additions and 25 deletions
+4 -1
View File
@@ -3,6 +3,7 @@ import React, { useState, useEffect } from "react";
import withStyles from "@mui/styles/withStyles";
import { Theme } from "@mui/material/styles";
import Grid from "@mui/material/Grid";
import { use } from "../../ui/Context";
const TimerProgress = withStyles((theme: Theme) => ({
root: {
@@ -20,14 +21,16 @@ interface IProps {
}
export function GameTimer(props: IProps): React.ReactElement {
const player = use.Player();
const [v, setV] = useState(100);
const totalMillis = player.infiltration_timer_mult * props.millis;
const tick = 200;
useEffect(() => {
const intervalId = setInterval(() => {
setV((old) => {
if (old <= 0) props.onExpire();
return old - (tick / props.millis) * 100;
return old - (tick / totalMillis) * 100;
});
}, tick);
return () => {