mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
change explosion sounds to factorio sounds
This commit is contained in:
BIN
src/web/alerts/www/public/explosions/factorioexplosion1.ogg
Executable file
BIN
src/web/alerts/www/public/explosions/factorioexplosion1.ogg
Executable file
Binary file not shown.
BIN
src/web/alerts/www/public/explosions/factorioexplosion2.ogg
Executable file
BIN
src/web/alerts/www/public/explosions/factorioexplosion2.ogg
Executable file
Binary file not shown.
BIN
src/web/alerts/www/public/explosions/factorioexplosion3.ogg
Executable file
BIN
src/web/alerts/www/public/explosions/factorioexplosion3.ogg
Executable file
Binary file not shown.
BIN
src/web/alerts/www/public/explosions/factorioexplosion4.ogg
Executable file
BIN
src/web/alerts/www/public/explosions/factorioexplosion4.ogg
Executable file
Binary file not shown.
BIN
src/web/alerts/www/public/explosions/factorioexplosion5.ogg
Executable file
BIN
src/web/alerts/www/public/explosions/factorioexplosion5.ogg
Executable file
Binary file not shown.
BIN
src/web/alerts/www/public/explosions/factoriolargeexplosion1.ogg
Executable file
BIN
src/web/alerts/www/public/explosions/factoriolargeexplosion1.ogg
Executable file
Binary file not shown.
BIN
src/web/alerts/www/public/explosions/factoriolargeexplosion2.ogg
Executable file
BIN
src/web/alerts/www/public/explosions/factoriolargeexplosion2.ogg
Executable file
Binary file not shown.
BIN
src/web/alerts/www/public/explosions/factorionuke.ogg
Executable file
BIN
src/web/alerts/www/public/explosions/factorionuke.ogg
Executable file
Binary file not shown.
@@ -2,12 +2,13 @@ import type { grenadeExplosionAlert } from "web/alerts/types";
|
|||||||
import type { AlertRunner } from "./index";
|
import type { AlertRunner } from "./index";
|
||||||
|
|
||||||
const duration = 1000;
|
const duration = 1000;
|
||||||
const volume = 0.1;
|
const volume = 1;
|
||||||
|
|
||||||
export default async function execute(
|
export default async function execute(
|
||||||
alert: grenadeExplosionAlert,
|
alert: grenadeExplosionAlert,
|
||||||
): Promise<AlertRunner> {
|
): Promise<AlertRunner> {
|
||||||
const audio = new Audio("/alerts/public/explosion2.ogg");
|
const audioPath = `/alerts/public/explosions/factorioexplosion${Math.ceil(Math.random() * 5)}.ogg`;
|
||||||
|
const audio = new Audio(audioPath);
|
||||||
audio.volume = volume;
|
audio.volume = volume;
|
||||||
|
|
||||||
const parentDiv = document.createElement("div");
|
const parentDiv = document.createElement("div");
|
||||||
|
|||||||
@@ -2,12 +2,13 @@ import type { userBlastAlert } from "web/alerts/types";
|
|||||||
import type { AlertRunner } from "./index";
|
import type { AlertRunner } from "./index";
|
||||||
|
|
||||||
const duration = 1000;
|
const duration = 1000;
|
||||||
const volume = 0.1;
|
const volume = 1;
|
||||||
|
|
||||||
export default async function execute(
|
export default async function execute(
|
||||||
alert: userBlastAlert,
|
alert: userBlastAlert,
|
||||||
): Promise<AlertRunner> {
|
): Promise<AlertRunner> {
|
||||||
const audio = new Audio("/alerts/public/explosion1.ogg");
|
const audioPath = `/alerts/public/explosions/factorioexplosion${Math.ceil(Math.random() * 5)}.ogg`;
|
||||||
|
const audio = new Audio(audioPath);
|
||||||
audio.volume = volume;
|
audio.volume = volume;
|
||||||
|
|
||||||
const parentDiv = document.createElement("div");
|
const parentDiv = document.createElement("div");
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import type { userExecutionAlert } from "web/alerts/types";
|
|||||||
import type { AlertRunner } from "./index";
|
import type { AlertRunner } from "./index";
|
||||||
|
|
||||||
const duration = 3000;
|
const duration = 3000;
|
||||||
const volume = 0.1;
|
const volume = 1;
|
||||||
|
|
||||||
export default async function execute(
|
export default async function execute(
|
||||||
alert: userExecutionAlert,
|
alert: userExecutionAlert,
|
||||||
@@ -56,9 +56,13 @@ export default async function execute(
|
|||||||
const randomX = Math.floor(Math.random() * (window.innerWidth - 800));
|
const randomX = Math.floor(Math.random() * (window.innerWidth - 800));
|
||||||
const randomY = Math.floor(Math.random() * (window.innerHeight - 800));
|
const randomY = Math.floor(Math.random() * (window.innerHeight - 800));
|
||||||
|
|
||||||
const audio1 = new Audio("/alerts/public/explosion1.ogg");
|
const audio1 = new Audio(
|
||||||
const audio2 = new Audio("/alerts/public/explosion2.ogg");
|
"/alerts/public/explosions/factoriolargeexplosion1.ogg",
|
||||||
const audio3 = new Audio("/alerts/public/explosion3.ogg");
|
);
|
||||||
|
const audio2 = new Audio(
|
||||||
|
"/alerts/public/explosions/factoriolargeexplosion1.ogg",
|
||||||
|
);
|
||||||
|
const audio3 = new Audio("/alerts/public/explosions/factorionuke.ogg");
|
||||||
|
|
||||||
audio1.volume = volume;
|
audio1.volume = volume;
|
||||||
audio2.volume = volume;
|
audio2.volume = volume;
|
||||||
|
|||||||
@@ -33,6 +33,16 @@ export default Bun.serve({
|
|||||||
return new Response(`${target} not found`, { status: 404 });
|
return new Response(`${target} not found`, { status: 404 });
|
||||||
return new Response(file);
|
return new Response(file);
|
||||||
},
|
},
|
||||||
|
// TODO: make this nicer, i don't want to redefine the same thing here every time
|
||||||
|
"/alerts/public/explosions/:filename": async (req) => {
|
||||||
|
const target = req.params.filename;
|
||||||
|
const file = Bun.file(
|
||||||
|
`${import.meta.dir}/alerts/www/public/explosions/${target}`,
|
||||||
|
);
|
||||||
|
if (!(await file.exists()))
|
||||||
|
return new Response(`${target} not found`, { status: 404 });
|
||||||
|
return new Response(file);
|
||||||
|
},
|
||||||
"/": async (req, srv) => {
|
"/": async (req, srv) => {
|
||||||
if (req.headers.get("Upgrade") === "websocket") {
|
if (req.headers.get("Upgrade") === "websocket") {
|
||||||
srv.upgrade(req);
|
srv.upgrade(req);
|
||||||
|
|||||||
Reference in New Issue
Block a user