From 97531509fad4df0516ac365f7bcfa9acd628899b Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Sat, 11 May 2024 19:38:35 -0400 Subject: [PATCH 1/2] ray color, better interference --- mods/nousersthings.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 4c21a709..58824ec3 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -2709,7 +2709,8 @@ elements.ray_emitter = { if (!rayans) { return } rayElement = mostSimilarElement(rayans); var rayans2 = prompt("Should the ray stop by walls? Write true or false.",(rayStoppedByWalls||false)); - if (!rayans2 || rayans2 !== "true" || rayans2 !== "false") { return } + if (!rayans2) { rayans2 = false } else { rayans2 = true } + rayStoppedByWalls = rayans2 }, hoverStat: function(pixel){ return pixel.rayElement.toUpperCase() || "unset" @@ -2743,9 +2744,15 @@ elements.ray_emitter = { if (isEmpty(lx,ly)){ createPixel(pixel.rayElement, lx, ly) pixelMap[lx][ly].temp = pixelMap[x][y].temp + if (pixel.rayElement == "ray"){ + pixelMap[lx][ly].rColor = pixel.color + } } else if (!isEmpty(lx, ly, true)){ if (pixelMap[lx][ly].element != pixel.rayElement && pixel.rayStoppedByWalls){ break; + } else if (pixelMap[lx][ly].element == "ray" && pixel.rayElement == "ray"){ + pixelMap[lx][ly].rColor = pixel.color + pixelMap[lx][ly].life = 30 } } } @@ -2763,6 +2770,7 @@ elements.indestructible_battery = { elements.ray = { color: "#ffffff", behavior: behaviors.WALL, + movable: true, category: "special", hoverStat: function(pixel){ return pixel.life || "unset" @@ -2771,8 +2779,15 @@ elements.ray = { life: 30 }, tick: function(pixel){ + if (pixel.rColor){ + pixel.rgb = pixel.rColor.match(/\d+/g); + } else { + pixel.rgb = [255,255,255] + } pixel.life -= 1 - pixel.color = "rgba(255,255,255,"+(pixel.life/30)+")" + if (pixel.life < 30){ + pixel.color = "rgba("+pixel.rgb[0]+","+pixel.rgb[1]+","+pixel.rgb[2]+","+(pixel.life/30)+")" + } else {pixel.color = "rgba("+pixel.rgb[0]+","+pixel.rgb[1]+","+pixel.rgb[2]+",1)"} if (pixel.life <= 0){ deletePixel(pixel.x, pixel.y) } From 38262f5df4249546b5424bd7eaa862d736dcdf37 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Sat, 11 May 2024 19:47:20 -0400 Subject: [PATCH 2/2] f --- mods/nousersthings.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 58824ec3..4ae5f65f 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -2746,6 +2746,7 @@ elements.ray_emitter = { pixelMap[lx][ly].temp = pixelMap[x][y].temp if (pixel.rayElement == "ray"){ pixelMap[lx][ly].rColor = pixel.color + pixelMap[lx][ly].color = pixel.color } } else if (!isEmpty(lx, ly, true)){ if (pixelMap[lx][ly].element != pixel.rayElement && pixel.rayStoppedByWalls){ @@ -2753,6 +2754,7 @@ elements.ray_emitter = { } else if (pixelMap[lx][ly].element == "ray" && pixel.rayElement == "ray"){ pixelMap[lx][ly].rColor = pixel.color pixelMap[lx][ly].life = 30 + pixelMap[lx][ly].color = pixel.color } } }