Compare commits
No commits in common. "8e10b9e5852c974e1a45824af118488ea6dcd920" and "404a23b2e109144bc4f02d1f3cbc0d0183acc6c4" have entirely different histories.
8e10b9e585
...
404a23b2e1
@ -5,7 +5,6 @@ import bgStyles from "../styles/Background.module.css";
|
|||||||
import { bossToName, bossToReward } from "./BossInfo";
|
import { bossToName, bossToReward } from "./BossInfo";
|
||||||
import { bossLevelToClass } from "./Boss";
|
import { bossLevelToClass } from "./Boss";
|
||||||
import { lostSound, wonSound } from "../utils/soundsEffect";
|
import { lostSound, wonSound } from "../utils/soundsEffect";
|
||||||
import { useEffect } from "react";
|
|
||||||
|
|
||||||
interface BossOutcomeModalProps {
|
interface BossOutcomeModalProps {
|
||||||
setIsOpen: (val: boolean) => void;
|
setIsOpen: (val: boolean) => void;
|
||||||
@ -13,20 +12,17 @@ interface BossOutcomeModalProps {
|
|||||||
|
|
||||||
const BossOutcomeModal = ({ setIsOpen }: BossOutcomeModalProps) => {
|
const BossOutcomeModal = ({ setIsOpen }: BossOutcomeModalProps) => {
|
||||||
const { lastBossResult } = usePlayer();
|
const { lastBossResult } = usePlayer();
|
||||||
const outcome = lastBossResult?.reward != BigInt(0);
|
|
||||||
const ascended = lastBossResult?.prestigeGained;
|
|
||||||
useEffect(() => {
|
|
||||||
if (lastBossResult != null) {
|
|
||||||
if (outcome) {
|
|
||||||
wonSound();
|
|
||||||
} else {
|
|
||||||
lostSound();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, [outcome, lastBossResult])
|
|
||||||
|
|
||||||
if (lastBossResult == null) return null;
|
if (lastBossResult == null) return null;
|
||||||
|
|
||||||
|
const outcome = lastBossResult.reward != BigInt(0);
|
||||||
|
const ascended = lastBossResult.prestigeGained;
|
||||||
|
|
||||||
|
if (outcome) {
|
||||||
|
wonSound();
|
||||||
|
} else {
|
||||||
|
lostSound();
|
||||||
|
}
|
||||||
|
|
||||||
const text = outcome ? (
|
const text = outcome ? (
|
||||||
<span>
|
<span>
|
||||||
and you <strong className={styles.won}>won!</strong> 🤩
|
and you <strong className={styles.won}>won!</strong> 🤩
|
||||||
|
|||||||
@ -29,7 +29,6 @@ export const clickSound = () => {
|
|||||||
export const lostSound = () => {
|
export const lostSound = () => {
|
||||||
const fail = new Howl({
|
const fail = new Howl({
|
||||||
src: ["/sounds/lost.wav"],
|
src: ["/sounds/lost.wav"],
|
||||||
volume: 0.7
|
|
||||||
});
|
});
|
||||||
|
|
||||||
fail.play();
|
fail.play();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user