Compare commits

...

2 Commits

Author SHA1 Message Date
8e10b9e585
Whoops deleted chainlink lib
Some checks failed
CI / Foundry project (push) Has been cancelled
CI / Foundry project (pull_request) Has been cancelled
2024-11-03 23:51:44 +01:00
711e092e5b
Prevents sounds playing twice on boss modal, lowered the volume oflosing sound just a bit 2024-11-03 23:51:00 +01:00
2 changed files with 14 additions and 9 deletions

View File

@ -5,6 +5,7 @@ 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;
@ -12,17 +13,20 @@ 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> 🤩

View File

@ -29,6 +29,7 @@ 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();