mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-08 03:24:48 +01:00
Merge pull request #4196 from connertennery/4125
INFILTRATION: Slash minigame fixed so attacking when the guard is preparing doesn't cause failure, fixed indicator when player has Might of Ares augmentation
This commit is contained in:
@ -8,11 +8,14 @@ interface IProps {
|
||||
millis: number;
|
||||
onExpire: () => void;
|
||||
noPaper?: boolean;
|
||||
ignoreAugment_WKSharmonizer?: boolean;
|
||||
}
|
||||
|
||||
export function GameTimer(props: IProps): React.ReactElement {
|
||||
const [v, setV] = useState(100);
|
||||
const totalMillis = (Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.3 : 1) * props.millis;
|
||||
const totalMillis =
|
||||
(!props.ignoreAugment_WKSharmonizer && player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.3 : 1) *
|
||||
props.millis;
|
||||
|
||||
const tick = 200;
|
||||
useEffect(() => {
|
||||
|
@ -33,7 +33,7 @@ export function SlashGame(props: IMinigameProps): React.ReactElement {
|
||||
function press(this: Document, event: KeyboardEvent): void {
|
||||
event.preventDefault();
|
||||
if (event.key !== KEY.SPACE) return;
|
||||
if (phase !== 2) {
|
||||
if (phase !== 1) {
|
||||
props.onFailure();
|
||||
} else {
|
||||
props.onSuccess();
|
||||
@ -42,7 +42,7 @@ export function SlashGame(props: IMinigameProps): React.ReactElement {
|
||||
const hasAugment = Player.hasAugmentation(AugmentationNames.MightOfAres, true);
|
||||
const phaseZeroTime = Math.random() * 3250 + 1500 - (250 + difficulty.window);
|
||||
const phaseOneTime = 250;
|
||||
const timeUntilAttacking = phaseZeroTime + phaseOneTime;
|
||||
const timeUntilAttacking = phaseZeroTime;
|
||||
|
||||
useEffect(() => {
|
||||
let id = window.setTimeout(() => {
|
||||
@ -66,7 +66,7 @@ export function SlashGame(props: IMinigameProps): React.ReactElement {
|
||||
{hasAugment ? (
|
||||
<Box sx={{ my: 1 }}>
|
||||
<Typography variant="h5">Guard will drop in...</Typography>
|
||||
<GameTimer millis={timeUntilAttacking} onExpire={() => null} noPaper />
|
||||
<GameTimer millis={timeUntilAttacking} onExpire={() => null} ignoreAugment_WKSharmonizer noPaper />
|
||||
</Box>
|
||||
) : (
|
||||
<></>
|
||||
|
Reference in New Issue
Block a user