diff --git a/mod-list.html b/mod-list.html
index be779ef8..0f423bc7 100644
--- a/mod-list.html
+++ b/mod-list.html
@@ -175,6 +175,7 @@
| extrasaveslots.js | Extra saves slots [KEEP IMPORTANT SAVES AS FILES!!] | Jayd |
| find.js | Find mode that highlights a chosen element as pulsating red and yellow [More Info] | Alice |
| hideandshowtools.js | Tools to hide elements and show hidden elements | MicaelNotUsed |
+
| gasdecay.js | Gases will slowly decay over time | nousernamefound |
| human_friendly_design.js | Drag and Mix tools don't kill humans | Nekonico |
| insane_random_events.js | Massively buffs random events | Alice |
| jaydsfunctions.js | Extra tools | Jayd |
diff --git a/mods/gasdecay.js b/mods/gasdecay.js
index 11db2630..3295bc97 100644
--- a/mods/gasdecay.js
+++ b/mods/gasdecay.js
@@ -1,15 +1,31 @@
-let gasList = []
+let gasBlacklist = ["pointer", "tornado"]
+let gasDecaySpeed = 0.002
runAfterLoad(function(){
- for (let _element in elements){
- if (elements[_element].state == "gas"){
- gasList.push(_element)
- }
- }
runPerPixel(function(pixel){
- if (gasList.indexOf(pixel.element) >= 0){
- if (Math.random() < 0.002){
+ if (elements[pixel.element].state === "gas" && gasBlacklist.indexOf(pixel.element) == -1){
+ if (Math.random() < gasDecaySpeed){
deletePixel(pixel.x, pixel.y)
}
}
})
+})
+dependOn("betterSettings.js", function(){
+ let gasTab = new SettingsTab("Gas Decay")
+ let speedSetting = new Setting("Chance for gas pixels to decay per tick. Should be between 0 and 1", "decay_chance", settingType.NUMBER, false, 0.002,)
+ let ignoreSetting = new Setting("Comma seperated list of elements that should be ignored.", "decay_blacklist", settingType.TEXT, false, "pointer,tornado")
+ gasTab.registerSettings("Settings", speedSetting, ignoreSetting)
+ settingsManager.registerTab(gasTab)
+ gasDecaySpeed = speedSetting.value;
+ gasBlacklist = (ignoreSetting.value).split(",")
+ speedSetting.onUpdate(function(value){
+ gasDecaySpeed = value
+ })
+ ignoreSetting.onUpdate(function(value){
+ gasBlacklist = value.split(",")
+ })
+ runAfterLoad(function(){
+ document.getElementById("betterSettings/undefined/decay_chance").step = "0.001";
+ document.getElementById("betterSettings/undefined/decay_chance").max = 1;
+ document.getElementById("betterSettings/undefined/decay_chance").min = 0;
+ })
})
\ No newline at end of file