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.js | Allows for breaking more elements in explosions | Alice |
| rays.js | Adds more Ray types | Alice |
| rays++.js | Adds a couple more rays | uptzik |
+| subspace.js | Adds the Subspace Tripmine from Roblox | nousernamefound |
| weapons.js | Adds varieties of different weapons | Jayd |
| Food & Cooking |
@@ -301,7 +302,6 @@
| random_liquids.js | Randomly generates liquids on game load | Alice |
| sbmixup.js | Adds silly elements from a Mix-Up! game | stefanblox |
| star_wars.js | Adds various items from Star Wars by Disney | SeaPickle754 |
-
| subspace.js | Adds a Subspace Tripmine sound effect when an explosion happens | nousernamefound |
| sus.js | Adds an Among Us crewmate | Nv7 |
| triggerable_random_powders.js | Adds powders with different abilities, such as heating and cooling | Alice |
| troll.js | Adds various dumb elements that iterate randomly on the entire screen | Alice |
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