From 170f8b9208e1d5f62fa2bc330320bf7aedf05416 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Mon, 27 May 2024 13:16:00 -0400 Subject: [PATCH] subspae update --- mod-list.html | 2 +- mods/subspace.js | 52 ++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/mod-list.html b/mod-list.html index 0a9f3b8b..3d610c21 100644 --- a/mod-list.html +++ b/mod-list.html @@ -225,6 +225,7 @@ more_breaking.jsAllows for breaking more elements in explosionsAlice rays.jsAdds more Ray typesAlice rays++.jsAdds a couple more raysuptzik +subspace.jsAdds the Subspace Tripmine from Robloxnousernamefound weapons.jsAdds varieties of different weapons Jayd Food & Cooking @@ -301,7 +302,6 @@ random_liquids.jsRandomly generates liquids on game loadAlice sbmixup.jsAdds silly elements from a Mix-Up! gamestefanblox star_wars.jsAdds various items from Star Wars by DisneySeaPickle754 -subspace.jsAdds a Subspace Tripmine sound effect when an explosion happensnousernamefound sus.jsAdds an Among Us crewmateNv7 triggerable_random_powders.jsAdds powders with different abilities, such as heating and coolingAlice troll.jsAdds various dumb elements that iterate randomly on the entire screenAlice diff --git a/mods/subspace.js b/mods/subspace.js index 1dd56f8f..3230b879 100644 --- a/mods/subspace.js +++ b/mods/subspace.js @@ -1,10 +1,46 @@ -function playSubspace() { - var audio = new Audio("https://JustAGenericUsername.github.io/subspaceboom.mp3"); +function playSubspace(file) { + var audio = new Audio("https://JustAGenericUsername.github.io/" + file + ".mp3"); audio.play(); } -window.addEventListener('load', function() { -const oldexpfunc = explodeAt; -explodeAt = function(x,y,radius,fire="fire"){ - oldexpfunc(x,y,radius,fire) - playSubspace() -}}) \ No newline at end of file +elements.subspace_trimpine = { + color: "#2e2430", + behavior: behaviors.STURDYPOWDER, + maxSize: 1, + cooldown: defaultCooldown, + density: 1500, + category: "weapons", + state: "solid", + properties:{ + counter: 0 + }, + tick: function(pixel){ + if (pixel.counter == 0){ + playSubspace("subspaceplace") + } + if (!pixel.rgb){pixel.rgb = pixel.color.match(/\d+/g);} + if (pixel.counter >= 90 && pixel.counter < 121){ + if (!pixel.a){pixel.a = 1} + pixel.a -= 0.05 + pixel.color = "rgba(" + pixel.rgb[0] + "," + pixel.rgb[1] + "," + pixel.rgb[2] + "," + pixel.a + ")" + } + if (pixel.counter >= 121){ + if (!isEmpty(pixel.x, pixel.y-1, true)){ + let oldx = pixel.x + let oldy = pixel.y + explodeAt(pixel.x, pixel.y, 20) + playSubspace("subspaceboom") + deletePixel(pixel.x, pixel.y) + var coords = circleCoords(oldx, oldy, 25) + for (var i = 0; i < coords.length; i++){ + var x = coords[i].x + var y = coords[i].y + if (!isEmpty(x, y, true)){ + var newPixel = pixelMap[x][y] + newPixel.color = pixelColorPick(pixel, "#FF00FF") + } + } + } + } + pixel.counter ++ + } +} \ No newline at end of file