mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 21:25:47 +01:00
fix "Slash when his guard is down!" actually means "Slash when he's attacking!" Also the Might of Ares timer is wrong. #4125
- Added ignoreAugment_WKSharmonizer to GameTimer to allow for strict, unmodified timers - Changed SlashGame failure check - Changed `timeUntilAttacking` value so the progress bar in SlashGame is accurate
This commit is contained in:
parent
9c579e294a
commit
0d6b6b404d
@ -8,12 +8,15 @@ interface IProps {
|
|||||||
millis: number;
|
millis: number;
|
||||||
onExpire: () => void;
|
onExpire: () => void;
|
||||||
noPaper?: boolean;
|
noPaper?: boolean;
|
||||||
|
ignoreAugment_WKSharmonizer?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function GameTimer(props: IProps): React.ReactElement {
|
export function GameTimer(props: IProps): React.ReactElement {
|
||||||
const player = use.Player();
|
const player = use.Player();
|
||||||
const [v, setV] = useState(100);
|
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;
|
const tick = 200;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -33,7 +33,7 @@ export function SlashGame(props: IMinigameProps): React.ReactElement {
|
|||||||
function press(this: Document, event: KeyboardEvent): void {
|
function press(this: Document, event: KeyboardEvent): void {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (event.key !== KEY.SPACE) return;
|
if (event.key !== KEY.SPACE) return;
|
||||||
if (phase !== 2) {
|
if (phase !== 1) {
|
||||||
props.onFailure();
|
props.onFailure();
|
||||||
} else {
|
} else {
|
||||||
props.onSuccess();
|
props.onSuccess();
|
||||||
@ -42,7 +42,7 @@ export function SlashGame(props: IMinigameProps): React.ReactElement {
|
|||||||
const hasAugment = Player.hasAugmentation(AugmentationNames.MightOfAres, true);
|
const hasAugment = Player.hasAugmentation(AugmentationNames.MightOfAres, true);
|
||||||
const phaseZeroTime = Math.random() * 3250 + 1500 - (250 + difficulty.window);
|
const phaseZeroTime = Math.random() * 3250 + 1500 - (250 + difficulty.window);
|
||||||
const phaseOneTime = 250;
|
const phaseOneTime = 250;
|
||||||
const timeUntilAttacking = phaseZeroTime + phaseOneTime;
|
const timeUntilAttacking = phaseZeroTime;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let id = window.setTimeout(() => {
|
let id = window.setTimeout(() => {
|
||||||
@ -66,7 +66,7 @@ export function SlashGame(props: IMinigameProps): React.ReactElement {
|
|||||||
{hasAugment ? (
|
{hasAugment ? (
|
||||||
<Box sx={{ my: 1 }}>
|
<Box sx={{ my: 1 }}>
|
||||||
<Typography variant="h5">Guard will drop in...</Typography>
|
<Typography variant="h5">Guard will drop in...</Typography>
|
||||||
<GameTimer millis={timeUntilAttacking} onExpire={() => null} noPaper />
|
<GameTimer millis={timeUntilAttacking} onExpire={() => null} ignoreAugment_WKSharmonizer noPaper />
|
||||||
</Box>
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
|
Loading…
Reference in New Issue
Block a user