studyup 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hexgl-package/HexGL-master/.htaccess +4 -0
- package/hexgl-package/HexGL-master/LICENSE +21 -0
- package/hexgl-package/HexGL-master/README.md +26 -0
- package/hexgl-package/HexGL-master/audio/LICENSE +28 -0
- package/hexgl-package/HexGL-master/audio/bg.ogg +0 -0
- package/hexgl-package/HexGL-master/audio/boost.ogg +0 -0
- package/hexgl-package/HexGL-master/audio/crash.ogg +0 -0
- package/hexgl-package/HexGL-master/audio/destroyed.ogg +0 -0
- package/hexgl-package/HexGL-master/audio/wind.ogg +0 -0
- package/hexgl-package/HexGL-master/bkcore/Audio.js +142 -0
- package/hexgl-package/HexGL-master/bkcore/hexgl/CameraChase.js +73 -0
- package/hexgl-package/HexGL-master/bkcore/hexgl/Gameplay.js +231 -0
- package/hexgl-package/HexGL-master/bkcore/hexgl/HUD.js +270 -0
- package/hexgl-package/HexGL-master/bkcore/hexgl/HexGL.js +446 -0
- package/hexgl-package/HexGL-master/bkcore/hexgl/Ladder.js +52 -0
- package/hexgl-package/HexGL-master/bkcore/hexgl/RaceData.js +99 -0
- package/hexgl-package/HexGL-master/bkcore/hexgl/ShipControls.js +806 -0
- package/hexgl-package/HexGL-master/bkcore/hexgl/ShipEffects.js +186 -0
- package/hexgl-package/HexGL-master/bkcore/hexgl/tracks/Cityscape.js +521 -0
- package/hexgl-package/HexGL-master/bkcore/threejs/Loader.js +260 -0
- package/hexgl-package/HexGL-master/bkcore/threejs/Particles.js +191 -0
- package/hexgl-package/HexGL-master/bkcore/threejs/Preloader.js +151 -0
- package/hexgl-package/HexGL-master/bkcore/threejs/RenderManager.js +132 -0
- package/hexgl-package/HexGL-master/bkcore/threejs/Shaders.js +950 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/ImageData.coffee +141 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/ImageData.js +156 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/Timer.coffee +118 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/Timer.js +159 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/Utils.coffee +193 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/Utils.js +250 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/controllers/GamepadController.coffee +45 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/controllers/GamepadController.js +73 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/controllers/OrientationController.coffee +72 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/controllers/OrientationController.js +130 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/controllers/TouchController.coffee +109 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/controllers/TouchController.js +188 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/tests.html +10 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/threejs/Particles.coffee +199 -0
- package/hexgl-package/HexGL-master/bkcore.coffee/threejs/Particles.js +210 -0
- package/hexgl-package/HexGL-master/cache.appcache +74 -0
- package/hexgl-package/HexGL-master/css/BebasNeue-webfont.eot +0 -0
- package/hexgl-package/HexGL-master/css/BebasNeue-webfont.svg +245 -0
- package/hexgl-package/HexGL-master/css/BebasNeue-webfont.ttf +0 -0
- package/hexgl-package/HexGL-master/css/BebasNeue-webfont.woff +0 -0
- package/hexgl-package/HexGL-master/css/bg.jpg +0 -0
- package/hexgl-package/HexGL-master/css/fonts.css +16 -0
- package/hexgl-package/HexGL-master/css/help-0.png +0 -0
- package/hexgl-package/HexGL-master/css/help-1.png +0 -0
- package/hexgl-package/HexGL-master/css/help-2.png +0 -0
- package/hexgl-package/HexGL-master/css/help-3.png +0 -0
- package/hexgl-package/HexGL-master/css/mobile-controls-1.jpg +0 -0
- package/hexgl-package/HexGL-master/css/mobile-controls-2.jpg +0 -0
- package/hexgl-package/HexGL-master/css/mobile-over.jpg +0 -0
- package/hexgl-package/HexGL-master/css/mobile.jpg +0 -0
- package/hexgl-package/HexGL-master/css/multi.css +264 -0
- package/hexgl-package/HexGL-master/css/title.png +0 -0
- package/hexgl-package/HexGL-master/css/touchcontroller.css +8 -0
- package/hexgl-package/HexGL-master/favicon.png +0 -0
- package/hexgl-package/HexGL-master/geometries/bonus/base/base.js +45 -0
- package/hexgl-package/HexGL-master/geometries/booster/booster.js +45 -0
- package/hexgl-package/HexGL-master/geometries/ships/feisar/feisar.js +45 -0
- package/hexgl-package/HexGL-master/geometries/tracks/cityscape/bonus/speed.js +45 -0
- package/hexgl-package/HexGL-master/geometries/tracks/cityscape/scrapers1.js +45 -0
- package/hexgl-package/HexGL-master/geometries/tracks/cityscape/scrapers2.js +45 -0
- package/hexgl-package/HexGL-master/geometries/tracks/cityscape/start.js +45 -0
- package/hexgl-package/HexGL-master/geometries/tracks/cityscape/startbanner.js +45 -0
- package/hexgl-package/HexGL-master/geometries/tracks/cityscape/track.js +45 -0
- package/hexgl-package/HexGL-master/geometries/tracks/edge/track.js +38 -0
- package/hexgl-package/HexGL-master/icon_128.png +0 -0
- package/hexgl-package/HexGL-master/icon_256.png +0 -0
- package/hexgl-package/HexGL-master/icon_32.png +0 -0
- package/hexgl-package/HexGL-master/icon_64.png +0 -0
- package/hexgl-package/HexGL-master/index.html +129 -0
- package/hexgl-package/HexGL-master/launch.coffee +85 -0
- package/hexgl-package/HexGL-master/launch.js +116 -0
- package/hexgl-package/HexGL-master/libs/DAT.GUI.min.js +53 -0
- package/hexgl-package/HexGL-master/libs/Detector.js +59 -0
- package/hexgl-package/HexGL-master/libs/Editor.html +717 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/App.js +212 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/CanvasRenderer.js +389 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/Diagram.js +148 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/Iterator.js +92 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/Links.js +56 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/ModuleList.js +47 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/Node.js +122 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/Parser.js +140 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/Project.js +162 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/Timer.js +166 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/ace.js +11 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/class.js +989 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/editor.css +16 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/font.css +24 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/gamecore.js +133 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/hashlist.js +41 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/jhashtable.js +468 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/jquery-1.8.js +2 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/kinetic.js +30 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/main.css +204 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/mode-json.js +1 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/pooled.js +542 -0
- package/hexgl-package/HexGL-master/libs/Editor_files/theme-monokai.js +1 -0
- package/hexgl-package/HexGL-master/libs/ShaderExtras.js +1788 -0
- package/hexgl-package/HexGL-master/libs/Stats.js +6 -0
- package/hexgl-package/HexGL-master/libs/Three.dev.js +758 -0
- package/hexgl-package/HexGL-master/libs/Three.r53.js +767 -0
- package/hexgl-package/HexGL-master/libs/leap-0.4.1.min.js +3 -0
- package/hexgl-package/HexGL-master/libs/postprocessing/BloomPass.js +100 -0
- package/hexgl-package/HexGL-master/libs/postprocessing/DotScreenPass.js +52 -0
- package/hexgl-package/HexGL-master/libs/postprocessing/EffectComposer.js +143 -0
- package/hexgl-package/HexGL-master/libs/postprocessing/FilmPass.js +51 -0
- package/hexgl-package/HexGL-master/libs/postprocessing/MaskPass.js +86 -0
- package/hexgl-package/HexGL-master/libs/postprocessing/RenderPass.js +63 -0
- package/hexgl-package/HexGL-master/libs/postprocessing/SavePass.js +52 -0
- package/hexgl-package/HexGL-master/libs/postprocessing/ShaderPass.js +51 -0
- package/hexgl-package/HexGL-master/libs/postprocessing/TexturePass.js +37 -0
- package/hexgl-package/HexGL-master/manifest.webapp +18 -0
- package/hexgl-package/HexGL-master/package.webapp +10 -0
- package/hexgl-package/HexGL-master/package.zip +0 -0
- package/hexgl-package/HexGL-master/replays/cityscape-casual/bkcore.replay.json +1 -0
- package/hexgl-package/HexGL-master/textures/bonus/base/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/bonus/base/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/bonus/base/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/checker.png +0 -0
- package/hexgl-package/HexGL-master/textures/hud/hex.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/hud/hud-bg.png +0 -0
- package/hexgl-package/HexGL-master/textures/hud/hud-fg-shield.png +0 -0
- package/hexgl-package/HexGL-master/textures/hud/hud-fg-speed.png +0 -0
- package/hexgl-package/HexGL-master/textures/particles/cloud - Copie.png +0 -0
- package/hexgl-package/HexGL-master/textures/particles/cloud.png +0 -0
- package/hexgl-package/HexGL-master/textures/particles/damage.png +0 -0
- package/hexgl-package/HexGL-master/textures/particles/spark - Copie.png +0 -0
- package/hexgl-package/HexGL-master/textures/particles/spark.png +0 -0
- package/hexgl-package/HexGL-master/textures/ships/feisar/booster/booster.png +0 -0
- package/hexgl-package/HexGL-master/textures/ships/feisar/booster/boostersprite.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/ships/feisar/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/ships/feisar/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/ships/feisar/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/nx.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/ny.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/nz.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/px.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/py.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/skybox/dawnclouds/pz.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/collision.png +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/height.png +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers1/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers1/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers1/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers2/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers2/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/scrapers2/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/start/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/start/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/start/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures/tracks/cityscape/start/start.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/bonus/base/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/bonus/base/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/bonus/base/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/checker.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/hud/hex.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/hud/hud-bg.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/hud/hud-fg-shield.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/hud/hud-fg-speed.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/particles/cloud - Copie.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/particles/cloud.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/particles/damage.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/particles/spark - Copie.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/particles/spark.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/ships/feisar/booster/booster.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/ships/feisar/booster/boostersprite.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/ships/feisar/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/ships/feisar/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/ships/feisar/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/nx.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/ny.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/nz.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/px.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/py.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/skybox/dawnclouds/pz.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/collision.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/height.png +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers1/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers1/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers1/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers2/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers2/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/scrapers2/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/start/diffuse.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/start/normal.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/start/specular.jpg +0 -0
- package/hexgl-package/HexGL-master/textures.full/tracks/cityscape/start/start.jpg +0 -0
- package/index.html +291 -0
- package/package.json +12 -3
- package/sandboxels-package/sandboxels-1.13.2/.github/CONTRIBUTING.md +10 -0
- package/sandboxels-package/sandboxels-1.13.2/.github/FUNDING.yml +13 -0
- package/sandboxels-package/sandboxels-1.13.2/.github/SUPPORT.md +9 -0
- package/sandboxels-package/sandboxels-1.13.2/404.html +74 -0
- package/sandboxels-package/sandboxels-1.13.2/CITATION.cff +42 -0
- package/sandboxels-package/sandboxels-1.13.2/CNAME +1 -0
- package/sandboxels-package/sandboxels-1.13.2/README.md +47 -0
- package/sandboxels-package/sandboxels-1.13.2/SECURITY.md +9 -0
- package/sandboxels-package/sandboxels-1.13.2/ad.html +73 -0
- package/sandboxels-package/sandboxels-1.13.2/aff.json +3 -0
- package/sandboxels-package/sandboxels-1.13.2/archive/first-version.html +234 -0
- package/sandboxels-package/sandboxels-1.13.2/archive/second-version.html +1293 -0
- package/sandboxels-package/sandboxels-1.13.2/archive/third-version.html +2242 -0
- package/sandboxels-package/sandboxels-1.13.2/archive.txt +231 -0
- package/sandboxels-package/sandboxels-1.13.2/backgrounds/License.txt +1 -0
- package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_dark.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_grass.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_pink.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_purple.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/backgrounds/sky_warm.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/changelog.html +3362 -0
- package/sandboxels-package/sandboxels-1.13.2/changelog.txt +3096 -0
- package/sandboxels-package/sandboxels-1.13.2/controls.html +191 -0
- package/sandboxels-package/sandboxels-1.13.2/controls.txt +65 -0
- package/sandboxels-package/sandboxels-1.13.2/education-use.html +109 -0
- package/sandboxels-package/sandboxels-1.13.2/feed.rss +30 -0
- package/sandboxels-package/sandboxels-1.13.2/feedback.html +89 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/PressStart2P-License-OFL.txt +93 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/PressStart2P-Regular.ttf +0 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/VT323-License-OFL.txt +93 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/VT323-Regular.ttf +0 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/Vietnamese_Pixel.ttf +0 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-ja.ttf +0 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-ko.ttf +0 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-latin.ttf +0 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-zh_hans.ttf +0 -0
- package/sandboxels-package/sandboxels-1.13.2/fonts/fusion-pixel-12px-monospaced-zh_hant.ttf +0 -0
- package/sandboxels-package/sandboxels-1.13.2/help.html +122 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/80x15.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/88x31.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/android-chrome-192x192.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/android-chrome-384x384.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-114x114-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-114x114.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-120x120-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-120x120.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-144x144-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-144x144.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-152x152-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-152x152.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-180x180-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-180x180.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-57x57-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-57x57.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-60x60-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-60x60.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-72x72-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-72x72.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-76x76-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-76x76.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon-precomposed.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/apple-touch-icon.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/browserconfig.xml +9 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/card.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/cover-3840x1240px-text.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/cover-3840x1240px.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/cover-3840x1240px.webp +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/cover.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/favicon-16x16.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/favicon-32x32.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/favicon.ico +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/icon-hd.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/icon.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/index.html +196 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/modulator.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/mstile-150x150.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/original-logo-recreated-pixel.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/promo1.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/promo2.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/promo3.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/promo4.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/safari-pinned-tab.svg +107 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/site.webmanifest +20 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/tall.webp +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/wallpaper-old.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/wallpaper.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/wallpaper.webp +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/wordmark-black.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/icons/wordmark-white.png +0 -0
- package/sandboxels-package/sandboxels-1.13.2/index.html +21523 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/README.txt +5 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/af.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/ar.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/ar_sy.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/bn.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/ca.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/cs.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/da.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/de.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/el.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/en.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/en_au.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/en_ca.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/en_gb.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/es.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/et.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/fi.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/fil.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/fr.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/gen.js +21 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/he.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/hu.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/id.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/it.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/ja.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/ko.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/la.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/ne.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/nl.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/no.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/pl.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/pt.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/pt_br.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/qha.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/qvp.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/ro.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/ru.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/sr.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/sv.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/template.json +677 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/th.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/tok.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/tok_old.json +543 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/tr.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/uk.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/vi.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/xem.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/zh_cn.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/lang/zh_hant.json +1 -0
- package/sandboxels-package/sandboxels-1.13.2/license.txt +48 -0
- package/sandboxels-package/sandboxels-1.13.2/lite.html +1599 -0
- package/sandboxels-package/sandboxels-1.13.2/manifest.json +33 -0
- package/sandboxels-package/sandboxels-1.13.2/media.html +134 -0
- package/sandboxels-package/sandboxels-1.13.2/mobile-use.html +110 -0
- package/sandboxels-package/sandboxels-1.13.2/mod-list.html +535 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/1.10example.js +118 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/10kelements.js +172 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/3pms_mod.js +144 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/AnonymousWorldgenLibrary.js +55 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Batteries.js +288 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/BlueStuff.js +681 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/CandyCanes.js +15 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/CandyCorn.js +8 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/CherrySoda.js +77 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/EasterEggs.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ExtraMachines.js +2338 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/FoodFoodFood.js +114 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Gemstones.js +80 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/GrapeSoda.js +141 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Humanitize.js +959 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Inators.js +108 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/IreThings.js +169 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Lab.js +397 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/LimesAdditions.js +401 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/MarkusFoodMod.js +334 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Mucho_frio_y_Calor.js +16 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Natural_disasters.js +207 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Neutronium Mod.js +1228 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/PRNGworldgenlib.js +526 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Quicksand_one.js +1355 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/RF_transmitter_receiver.js +62 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Random_quicksands.js +932 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Science_mod.js +1791 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Shroomboxels.js +71 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/SuperASAX_Funny_Mod.js +297 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Temperature+.js +47 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Thread.js +180 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/UAMM.js +502 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Ultra_Steel.js +61 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/UwUify.js +87 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/VCR_OSD_MONO.ttf +0 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/Vegan.js +255 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/WhisperingTheory.js +213 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/aChefsDream.js +8159 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/aChefsDream2.js +815 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/aChefsDream_beta.js +12 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/aScientistsWish.js +1195 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/a_bundle_of_tests.js +417 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/a_mod_by_alice.js +46043 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/acid_and_shapes.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/adaceythings.js +343 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/adjustablepixelsize.js +28 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/advanced_colonies.js +146 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/advancedbugs.js +37 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/aircrafts.js +260 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/alchem.js +372 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/alchemy.js +69 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/alcohol.js +113 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/alkahest.js +33 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/alkali_metal.js +308 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/all_around_fillers.js +73 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/all_stain.js +7 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/allliquids.js +24 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/amogus.js +69 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/anmm.js +566 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ants.js +137 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/apioforms_pre.js +238 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/applestuff.js +80 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/asciiboxels.js +231 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/aussieAdditions.js +123 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/baby.js +65 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/background_changer.js +59 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bacteria_mod.js +121 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bananas.js +543 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/barf_mod.js +42 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/barista.js +209 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bere.js +85 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/betterMenuScreens.js +279 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/betterModManager.js +174 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/betterSettings.js +304 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/betterStats.js +55 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/better_smooth_water.js +6 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/betterelec.js +51 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bettergraygoo.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bettermetalscrap.js +37 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bf.js +394 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bfdi.js +145 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bigger_star_spawners.js +198 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/biology.js +8694 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bioooze_and_pyrogens.js +264 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/black_hole.js +43 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/blocks.js +164 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/boiling_things.js +540 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bojithekings_mod.js +377 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/boompaste.js +76 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/borders.js +76 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/bouncing_balls.js +703 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/broken_mod_test.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/building.js +154 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/buildingreplicator.js +210 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/c_fighter_jet.js +449 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cannibal_cooking.js +620 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cash_n_more.js +58 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cat.js +100 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cells.js +376 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/chalcopyrite.js +124 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/chalk.js +499 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/change.js +58 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/changePixelDebug.js +9 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/changeTempReactionParameter.js +73 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/chaos.js +32 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/charsonsmodbeta.js +494 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/charsonsmoduno.js +2116 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/chem.js +7877 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/chemFormula.js +44 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/chemFormulas.json +549 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cherries.js +543 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/chess.js +1463 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/children.js +14 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/circuitcore.js +1914 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/circuitcore_displays.js +157 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/citybuilding.js +193 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/classic_explosives.js +62 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/classic_textures.js +196 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/clf3.js +86 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/clone_liquid.js +22 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/clouds.js +103 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cmur.js +5195 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/code_library.js +1827 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/coffee.js +228 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cold_liquid_explosion.js +20 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cold_opposites.js +66 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/coldblooded.js +729 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/collab_mod.js +253 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/colonies.js +574 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/colorLED.js +38 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/color_everything.js +3 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/color_tools.js +297 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/colored_lightbulbs.js +44 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/combustion.js +416 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/community_desserts.js +829 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/content.js +131 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/controllable_pixel.js +75 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/controllable_pixel_test.js +161 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/conveyance.js +95 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cooked_apple.js +26 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cookie_clicker.js +943 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cookingnstuff.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cool_tools.js +35 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/copy_canvas.js +9 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/copypaste.js +100 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/coresbyp.js +90 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cpt_alt.js +241 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/crimson.js +424 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cs_expanded.js +31 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cubesstuff.js +3329 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/currency.js +246 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cursed_shader_by_jayd.js +90 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cursor.js +3 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/cursor_shapes.js +149 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/customBackground.js +45 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/customexplosion.js +110 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/customtemptools.js +50 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/dalgonacandy.js +41 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/datawire.js +238 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/date_test.js +268 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/death_count.js +35 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/debris.js +75 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/debrisable.js +1136 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/debugRework.js +169 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/delete_all_of_element.js +17 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/deneme.js +70 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/dependency_test.js +13 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/descriptions.js +17 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/devsnacks.js +193 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/devtests.js +278 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/discord_port.js +36 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/doElectricity changes.js +55 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/dogs.js +85 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/doom.js +935 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/doomsday.js +56 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/drawPixels_change_test.js +39 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/dried_food.js +38 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/drill.js +261 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/drills.js +760 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/easysurvival.js +917 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/edible_everything.js +7 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/editTools.js +608 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/eklegems.js +1313 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/electricityTest.js +42 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/elem3.js +352316 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/elementEraser.js +40 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/element_UI.js +140 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/elementreplacer.js +12 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/elementsManager.js +1212 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/empty.js +7 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/evenmoretemptools.js +42 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/example_mod.js +89 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/example_mod_old.js +84 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/exoplanet.js +220 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/explodeAtPlus.js +138 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/explosionsound.js +19 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/extra_element_info.js +79 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/extrasaveslots.js +42 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fans.js +204 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fantastic_creatures.js +198 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fantasy_elements.js +800 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fast_lightmap.js +339 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fey_and_more.js +1678 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fill_script.js +42 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/find.js +115 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fine_tuned_cloner.js +121 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fire_extinguisher.js +128 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fire_mod.js +565 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fire_slime.js +68 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fishin.js +519 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fission.js +68 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fission_physics.js +86 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fiveys_stuff.js +119 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/flesh_infection.js +645 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/flipflop.js +36 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/flowers_and_forests.js +468 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/flying_fish.js +49 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/food_mods.js +15 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/foodgalore +100 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fools+.js +299 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fools.js +99 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fools24.js +842 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fools25.js +350 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fossils.js +676 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fractals.js +156 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/franklin.js +44 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/freeTPS.js +19 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fueled_generators.js +131 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/funny elements 2022-11-15.js +84 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/funny_liquid.js +618 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/funny_liquid_2.js +322 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/funny_liquid_3.js +254 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/funny_solid.js +163 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/funnynames.js +320 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/fwibblen.js +69 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/gambling.js +94 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/gameOfLife.js +83 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/garn47.js +325 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/gasdecay.js +31 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/generative_mods.js +2479 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/generator_prompt.js +166 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/genetics.js +4038 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/glenn_gases.js +411 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/glow.js +130 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/gradient_background_support.js +21 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/graphite.js +460 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/grav_mudstones.js +382 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/gravity.js +40 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/gravity_test.js +51 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/greenitemsandmore.js +183 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/guided_rocket.js +106 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/halogen.js +384 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/haseulite.js +1673 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/heatglow.js +74 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/heatshield.js +30 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/hexagon.js +45 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/hidden_ground.js +42 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/hideandshowtools.js +18 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/human_edit.js +725 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/human_friendly_design.js +899 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/humans.js +203 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/hydroid.js +224 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/icb.js +32 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/iean.js +135 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/immune.js +199 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/incinerators.js +29 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/industry.js +308 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/infLiqLight.js +8 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/injector.js +450 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/insane_random_events.js +123 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/invertscroll.js +8 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/invisible_things.js +83 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/iocalfaeus_clones.js +100 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/jaydsfunctions.js +187 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/jaydsmods.js +89 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/jaydstuff.js +783 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/junction.js +50 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ketchup_mod.js +526 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/kopalsBar.js +175 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/kopalstuff.js +541 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/lactose_intolerance_and_celiac.js +18 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/laetium.js +328 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/lattice_filler.js +29 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/lemonade.js +71 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/libhooktick.js +49 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/libpacman-v1.js +61 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/libpixeltracking.js +29 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/library_test.js +5 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/life_eater.js +169 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/light.js +218 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/lighting_test.js +79 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/lightmap.js +382 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/limewater.js +75 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/liquid_energy.js +294 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/liquid_mixing.js +184 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/liquid_void.js +29 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/littlejohnny.js +72 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/lizard_mod.js +91 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/logicgates.js +482 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/lone_urea.js +69 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/lost_souls.js +177 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/lye.js +34 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/machines.js +293 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/manyMoreThemes.js +67 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mars.js +473 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/maxColorOffset.js +54 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/maze.js +71 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/meat_rockets.js +70 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/memelists.js +17 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/metals.js +791 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/minecraft.js +818 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/minesweeper.js +100 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/miscellaneous_elements.js +278 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/miscible_psoup_and_birthpool.js +7 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mix.js +65 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mixture.js +714 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mixtureII.js +440 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mjsstuff.js +233 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mobile_keybinds.js +33 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mobile_shift.js +336 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mobs.js +5147 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mod_for_mnem.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/modlangs.js +53 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/moreViews.js +473 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/more_art_states.js +89 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/more_breaking.js +189 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/more_disasters.js +497 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/more_gold.js +115 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/morebombs.js +1143 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/morechemistry.js +1764 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/morefoodsmod.js +154 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/moreliquids.js +138 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/morepowders.js +335 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/moretools.js +68 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/moretrees.js +490 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mossstuff.js +2301 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mouthwash.js +23 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/move_tools.js +71 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/moveable_cubes.js +258 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/moving_pixels.js +179 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mush_infection.js +321 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/musicalfruit.js +4 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mustard.js +48 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/mystic.js +274 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nastystuff.js +57 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nature_Mod.js +1384 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nekonicos_stuff.js +1651 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nested_for_reaction_example.js +19 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nettysaddon.js +48 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/neutronium_compressor.js +416 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nicer_flame.js +48 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nirmod.js +296 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nitroglycerin.js +54 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/no_blood.js +23 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/no_radiation_events.js +3 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/no_random_grbs.js +9 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/no_scroll.js +5 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/noblegas.js +215 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nocancer.js +9 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nocancer2.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/noconfirm.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nograssgrow.js +6 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/noita.js +4895 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/noita_demake.js +430 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nopixellimit.js +2 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/note_block.js +97 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/note_block_advanced.js +628 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nousersthings.js +4081 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nuclear.js +300 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/nv7.js +35013 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/obsidian.js +51 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/occlusion.js +149 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ocean.js +130 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ochem_prerelease.js +774 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/oldTooltip.js +23 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/oldleds.js +20 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/onTryMoveInto.js +85 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/onecolor.js +146 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/orchidslibrary.js +70 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ores.js +232 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/organism.js +915 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/oxide.theme.js +46 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/page_color.js +35 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/paint_event.js +17 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/periodic_and_more.js +64 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/peta.js +214 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/petal_dye.js +40 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/pixelResizeTool.js +18 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/pizzasstuff.js +2338 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/place_all_elements.js +30 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/placuchtestthing.js +17 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/planet.js +270 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/planet_cracker.js +81 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/plants.js +1616 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/plastic.js +93 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/portal.js +120 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/potato_chips.js +44 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/prairie.js +200 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/precisionDrawing.js +58 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/pressure.js +223 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/pressure_sensitive.js +20 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/prideflags.js +307 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/primordial_birthpool.js +38 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/prompt.js +1215 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/prop and prompt variables.js +16 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/prop.js +466 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/pullers.js +479 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/purple_guys_mod.js +3635 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/pushers.js +287 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/radioactive.js +135 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/rainbow_cursor.js +12 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/rainbow_tests.js +348 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/rainsmod.js +412 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/random_elems.js +463 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/random_everything.js +7 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/random_fixes.js +42 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/random_liquids.js +220 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/random_rocks.js +164 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/random_things.js +69 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/randomelements.js +200 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/randomness.js +730 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/randomness_but_tick.js +1257 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/randomness_but_tool.js +26 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ray_cloner.js +150 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/rays++.js +60 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/rays.js +464 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/reactor_supplies_and_others.js +88 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/real_light.js +754 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/replace.js +79 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/replace_all.js +45 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/reverse_time.js +421 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/rich_grain.js +54 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/rising_powders.js +3 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/rock_paper_scissors.js +32 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/roseyiede.js +363 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/rpg.js +1342 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ru_expanded.js +25 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/runAfterAutogen and onload restructure.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/runAfterAutogen2.js +56 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/sandboxels.js +2501 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/saturnsstuff.js +729 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/save_loading.js +520 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/sbmixup.js +1439 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/sbstuff.js +1865 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/scenexe.js +770 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/schematics.js +214 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/scp.js +7831 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/selective_paint.js +60 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/sensitive.js +20 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/shade.js +46 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/shader_by_jayd.js +168 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/shipstuff.js +198 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/singleColor.js +1 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/single_humans.js +147 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/sky.js +141 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/slag_fix.js +25 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/smooth_water.js +6 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/solid_rock.js +74 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/solidcolor.js +146 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/solubility.js +287 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/some_tf_liquids.js +358 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/souls.js +163 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/soups.js +104 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/spaceship.js +138 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/special_property_library.js +155 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/sponge_edit.js +76 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/sports_beta.js +69 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/spouts.js +715 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/spring.js +283 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/stainless_steel.js +126 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/star_wars.js +70 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/state_voids.js +347 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/static.js +182 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/stickyslime.js +3 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/stickystuff.js +59 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/stormlib.js +99 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/stripe_paint.js +110 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/structure_test.js +755 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/sturdierpowders.js +595 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/subspace.js +46 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/survival.js +499 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/survivalhack.js +500 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/sus.js +92 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/switches.js +53 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/talismanadditions.js +124 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/tech.js +282 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/test.js +8 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/test_2.js +399 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/testmod.js +7 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/text.js +681 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/texture_pack_by_jayd.js +116 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/texturepack.js +94 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/the_ground.js +3 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/the_ground_og.js +2570 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/the_snail.js +63 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/themostrandomstuff.js +523 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/thermal_conduit.js +157 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/thiquovite.js +1745 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ticking_temp_stuff.js +494 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/time.js +7 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/toms_stuff.js +308 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/tool_pixel_behavior.js +792 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/tooltip.js +32 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/toothpaste.js +154 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/tpt.js +89 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/triggerable_random_powders.js +68 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/troll.js +170 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/true_flashbang.js +520 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/ultimadrink.js +3191 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/uncook.js +51 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/unhide.js +10 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/variety_mod.js +727 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/velocity.js +139 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/velocity2.js +209 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/video.js +125 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/vinegar.js +17 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/volcanic_expansion.js +94 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/war.js +51 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/war_crimes.js +131 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/waterspout.js +26 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/weAllScreamFor.js +218 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/weapons.js +1286 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/wheel_fix.js +19 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/wifi.js +162 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/wifi_draw.js +87 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/wine.js +8 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/wirelike_test.js +681 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/worldEdit.js +441 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/worldEdit.ts +569 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/world_gen_test.js +315 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/worldgen_test.js +173 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/worldgenlibrary.js +164 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/x_dependent_change_test.js +34 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/yumcherries.js +543 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/zonneschijn7.js +6 -0
- package/sandboxels-package/sandboxels-1.13.2/mods/zoom.js +322 -0
- package/sandboxels-package/sandboxels-1.13.2/offline-use.html +103 -0
- package/sandboxels-package/sandboxels-1.13.2/offline.html +1 -0
- package/sandboxels-package/sandboxels-1.13.2/presskit.html +165 -0
- package/sandboxels-package/sandboxels-1.13.2/promo.html +13 -0
- package/sandboxels-package/sandboxels-1.13.2/scripts/im2elements/code.go +116 -0
- package/sandboxels-package/sandboxels-1.13.2/scripts/im2elements/go.mod +5 -0
- package/sandboxels-package/sandboxels-1.13.2/scripts/im2elements/go.sum +2 -0
- package/sandboxels-package/sandboxels-1.13.2/scripts/im2elements/main.go +58 -0
- package/sandboxels-package/sandboxels-1.13.2/scripts/perlin.js +165 -0
- package/sandboxels-package/sandboxels-1.13.2/service-worker.js +16 -0
- package/sandboxels-package/sandboxels-1.13.2/sitemap.txt +13 -0
- package/sandboxels-package/sandboxels-1.13.2/style.css +1105 -0
- package/sandboxels-package/sandboxels-1.13.2/template.html +86 -0
- package/sandboxels-package/sandboxels-1.13.2/tips.html +147 -0
- package/sandboxels-package/sandboxels-1.13.2/translate.html +105 -0
- package/README.md +0 -3
|
@@ -0,0 +1,1827 @@
|
|
|
1
|
+
libraryLoaded = true;
|
|
2
|
+
this.libraryLoaded = true;
|
|
3
|
+
window.libraryLoaded = true;
|
|
4
|
+
|
|
5
|
+
//URL
|
|
6
|
+
|
|
7
|
+
urlParams = new URLSearchParams(window.location.search);
|
|
8
|
+
|
|
9
|
+
libraryLoaded = true;
|
|
10
|
+
this.libraryLoaded = true;
|
|
11
|
+
window.libraryLoaded = true;
|
|
12
|
+
|
|
13
|
+
//Objects
|
|
14
|
+
|
|
15
|
+
//getKeyByValue code by SO UncleLaz: https://stackoverflow.com/questions/9907419/how-to-get-a-key-in-a-javascript-object-by-its-value
|
|
16
|
+
//CC-BY-SA-4.0
|
|
17
|
+
function getKeyByValue(object, value) {
|
|
18
|
+
return Object.keys(object).find(key => object[key] === value);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
libraryLoaded = true;
|
|
22
|
+
this.libraryLoaded = true;
|
|
23
|
+
window.libraryLoaded = true;
|
|
24
|
+
|
|
25
|
+
//RNG
|
|
26
|
+
|
|
27
|
+
//Random integer from 0 to n
|
|
28
|
+
function randomIntegerFromZeroToValue(value) {
|
|
29
|
+
var absoluteValuePlusOne = Math.abs(value) + 1;
|
|
30
|
+
if(value >= 0) { //Positive case
|
|
31
|
+
return Math.floor(Math.random() * absoluteValuePlusOne)
|
|
32
|
+
} else { //Negative case: flip sign
|
|
33
|
+
return 0 - Math.floor(Math.random() * absoluteValuePlusOne)
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//Random thing from array
|
|
38
|
+
function randomChoice(array) {
|
|
39
|
+
if(array.length === 0) { throw new Error(`The array ${array} is empty`) };
|
|
40
|
+
var length = array.length;
|
|
41
|
+
var randomIndex = randomIntegerFromZeroToValue(length - 1);
|
|
42
|
+
return array[randomIndex];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//Random integer from m to n
|
|
46
|
+
function randomIntegerBetweenTwoValues(min,max) {
|
|
47
|
+
if(min > max) {
|
|
48
|
+
var temp = max; //the need of a temporary space has always annoyed me
|
|
49
|
+
max = min;
|
|
50
|
+
min = temp;
|
|
51
|
+
};
|
|
52
|
+
return Math.floor(Math.random() * (max - min + 1)) + min
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
//cyrb128 idk where this comes from but it was in the same thread
|
|
56
|
+
function cyrb128(str) {
|
|
57
|
+
let h1 = 1779033703, h2 = 3144134277,
|
|
58
|
+
h3 = 1013904242, h4 = 2773480762;
|
|
59
|
+
for (let i = 0, k; i < str.length; i++) {
|
|
60
|
+
k = str.charCodeAt(i);
|
|
61
|
+
h1 = h2 ^ Math.imul(h1 ^ k, 597399067);
|
|
62
|
+
h2 = h3 ^ Math.imul(h2 ^ k, 2869860233);
|
|
63
|
+
h3 = h4 ^ Math.imul(h3 ^ k, 951274213);
|
|
64
|
+
h4 = h1 ^ Math.imul(h4 ^ k, 2716044179);
|
|
65
|
+
}
|
|
66
|
+
h1 = Math.imul(h3 ^ (h1 >>> 18), 597399067);
|
|
67
|
+
h2 = Math.imul(h4 ^ (h2 >>> 22), 2869860233);
|
|
68
|
+
h3 = Math.imul(h1 ^ (h3 >>> 17), 951274213);
|
|
69
|
+
h4 = Math.imul(h2 ^ (h4 >>> 19), 2716044179);
|
|
70
|
+
return [(h1^h2^h3^h4)>>>0, (h2^h1)>>>0, (h3^h1)>>>0, (h4^h1)>>>0];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function mulberry32(a) { //Mulberry32 implemented in JS from StackOverflow, https://gist.github.com/tommyettinger/46a874533244883189143505d203312c
|
|
74
|
+
return function() {
|
|
75
|
+
var t = a += 0x6D2B79F5;
|
|
76
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
77
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
78
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
79
|
+
}
|
|
80
|
+
} //returns random function seeded with a
|
|
81
|
+
|
|
82
|
+
//Seeded randbetween
|
|
83
|
+
function seededRandBetween(min,max,randomFunction) {
|
|
84
|
+
if(min > max) {
|
|
85
|
+
var temp = max;
|
|
86
|
+
max = min;
|
|
87
|
+
min = temp;
|
|
88
|
+
};
|
|
89
|
+
return Math.floor(randomFunction() * (max - min + 1)) + min
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
libraryLoaded = true;
|
|
93
|
+
this.libraryLoaded = true;
|
|
94
|
+
window.libraryLoaded = true;
|
|
95
|
+
|
|
96
|
+
//Arrays
|
|
97
|
+
|
|
98
|
+
//Shallow array comparer by SO Tim Down: https://stackoverflow.com/a/10260204
|
|
99
|
+
//CC-BY-SA-3.0
|
|
100
|
+
function arraysIdentical(arr1, arr2) {
|
|
101
|
+
var i = arr1.length;
|
|
102
|
+
if (i !== arr2.length) {
|
|
103
|
+
return false;
|
|
104
|
+
};
|
|
105
|
+
while (i--) {
|
|
106
|
+
if (arr1[i] !== arr2[i]) {
|
|
107
|
+
return false;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
return true;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
function indexOf(arr, val, comparer) {
|
|
114
|
+
for (var i = 0, len = arr.length; i < len; ++i) {
|
|
115
|
+
if ( i in arr && comparer(arr[i], val) ) {
|
|
116
|
+
return i;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
return -1;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
function averageNumericArray(array) {
|
|
123
|
+
var total = array.reduce(addTwoNumbers,0)
|
|
124
|
+
return total / array.length
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
function sumNumericArray(array) { //Sum of array numbers
|
|
128
|
+
return array.reduce((partialSum, a) => partialSum + a, 0);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
function pad_array(arr,len,fill) { //https://stackoverflow.com/a/38851957
|
|
132
|
+
//console.log("Padding array");
|
|
133
|
+
return arr.concat(Array(len).fill(fill)).slice(0,len);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
//Function to check if an array includes a given array by SO Johnny Tisdale: https://stackoverflow.com/a/60922255
|
|
137
|
+
//CC-BY-SA-4.0
|
|
138
|
+
function includesArray(parentArray, testArray) {
|
|
139
|
+
for (let i = 0; i < parentArray.length; i++) {
|
|
140
|
+
if (parentArray[i].every(function(value, index) { return value === testArray[index]})) {
|
|
141
|
+
return true;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
return false;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
function addArraysInPairs(array1,array2,fill=0) { //e.g. [1,2,3] + [10,0,-1] = [11,2,2]
|
|
148
|
+
//console.log("Adding in pairs: " + array1 + " and " + array2 + ".");
|
|
149
|
+
if(array1.length > array2.length) { //zero-padding
|
|
150
|
+
array2 = pad_array(array2,array1.length,fill); //if a1 is longer, pad a2 to a1's length
|
|
151
|
+
} else if(array2.length > array1.length) {
|
|
152
|
+
array1 = pad_array(array1,array2.length,fill); //if a2 is longer, pad a1 to a2's length
|
|
153
|
+
};
|
|
154
|
+
var tempArray = [];
|
|
155
|
+
for(z = 0; z < array1.length; z++) {
|
|
156
|
+
//console.log("Forming output values (" + array1[z] + " + " + array2[z] + ")");
|
|
157
|
+
tempArray[z] = array1[z] + array2[z];
|
|
158
|
+
//console.log("Sum" + tempArray[z]);
|
|
159
|
+
};
|
|
160
|
+
//console.log("Added into " + tempArray + ".");
|
|
161
|
+
return tempArray;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
function tryJoin(stringOrArray,joiner) {
|
|
165
|
+
//console.log(`tryJoin: ${stringOrArray}`);
|
|
166
|
+
if(typeof(stringOrArray) === "string") {
|
|
167
|
+
//console.log("tryJoin: String");
|
|
168
|
+
return stringOrArray;
|
|
169
|
+
} else if(Array.isArray(stringOrArray)) {
|
|
170
|
+
//console.log("tryJoin: Array");
|
|
171
|
+
return stringOrArray.join(joiner);
|
|
172
|
+
} else {
|
|
173
|
+
throw new TypeError(`Unexpected type: ${typeof(stringOrArray)}`);
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
libraryLoaded = true;
|
|
178
|
+
this.libraryLoaded = true;
|
|
179
|
+
window.libraryLoaded = true;
|
|
180
|
+
|
|
181
|
+
//Checks
|
|
182
|
+
|
|
183
|
+
//Element exists in the elements object
|
|
184
|
+
function elementExists(elementName) {
|
|
185
|
+
return typeof(elements[elementName]) === "object";
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
//Has a given state
|
|
189
|
+
function isState(elementName,inputState) {
|
|
190
|
+
if(!elementExists(elementName)) {
|
|
191
|
+
throw new Error(`Element ${elementName} doesn't exist`);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
var infoState = elements[elementName].state;
|
|
195
|
+
|
|
196
|
+
if(infoState == undefined) { infoState = "undefined" };
|
|
197
|
+
|
|
198
|
+
if(inputState == undefined) { inputState = "undefined" };
|
|
199
|
+
if(inputState instanceof Array) {
|
|
200
|
+
var limit = 0;
|
|
201
|
+
while(inputState.includes(undefined) && limit < 3) {
|
|
202
|
+
inputState[inputState.indexOf(undefined)] = "undefined"
|
|
203
|
+
limit++;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
if(inputState instanceof Array) {
|
|
208
|
+
return inputState.includes(infoState);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
return infoState == inputState;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
//Check if pixel of given element exists at given location
|
|
215
|
+
function hasPixel(x,y,elementInput) {
|
|
216
|
+
if(isEmpty(x,y,true)) { //if empty, it can't have a pixel
|
|
217
|
+
return false;
|
|
218
|
+
} else {
|
|
219
|
+
if(elementInput.includes(",")) { //CSTA
|
|
220
|
+
elementInput = elementInput.split(",");
|
|
221
|
+
};
|
|
222
|
+
if(Array.isArray(elementInput)) { //if element list
|
|
223
|
+
for(i = 0; i < elementInput.length; i++) { if(!elementExists(elementInput[i])) { console.log(`hasPixel: Element "${elementInput[i]}" doesn't exist`) } };
|
|
224
|
+
return elementInput.includes(pixelMap[x][y].element);
|
|
225
|
+
} else { //if single element
|
|
226
|
+
if(!elementExists(elementInput)) { console.log(`hasPixel: Element "${elementInput}" doesn't exist`) };
|
|
227
|
+
return pixelMap[x][y].element === elementInput;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
//Is movable
|
|
233
|
+
var backupCategoryWhitelist = ["land","powders","weapons","food","life","corruption","states","fey","Fantastic Creatures","dyes","energy liquids","random liquids","random gases","random rocks"];
|
|
234
|
+
var backupElementWhitelist = ["mercury", "chalcopyrite_ore", "chalcopyrite_dust", "copper_concentrate", "fluxed_copper_concentrate", "unignited_pyrestone", "ignited_pyrestone", "everfire_dust", "extinguished_everfire_dust", "mistake", "polusium_oxide", "vaporized_polusium_oxide", "glowstone_dust", "redstone_dust", "soul_mud", "wet_soul_sand", "nitrogen_snow", "fusion_catalyst", "coal", "coal_coke", "blast_furnace_fuel", "molten_mythril"];
|
|
235
|
+
|
|
236
|
+
function commonMovableCriteria(name,shallowBlacklist=null) {
|
|
237
|
+
if(typeof(elements[name]) !== "object") {
|
|
238
|
+
throw new Error(`Nonexistent element ${name}`);
|
|
239
|
+
};
|
|
240
|
+
var info = elements[name];
|
|
241
|
+
//console.log(`${name} (${JSON.stringify(elements[name])})`);
|
|
242
|
+
if(typeof(info.state) === "undefined") {
|
|
243
|
+
var state = null;
|
|
244
|
+
} else {
|
|
245
|
+
var state = info.state;
|
|
246
|
+
};
|
|
247
|
+
if(typeof(info.category) === "undefined") {
|
|
248
|
+
var category = "other";
|
|
249
|
+
} else {
|
|
250
|
+
var category = info.category;
|
|
251
|
+
};
|
|
252
|
+
if(shallowBlacklist !== null && shallowBlacklist.includes(name)) {
|
|
253
|
+
return false;
|
|
254
|
+
};
|
|
255
|
+
if(elements[name].tool) {
|
|
256
|
+
return false;
|
|
257
|
+
};
|
|
258
|
+
if(elements[name].behavior && elements[name].behavior.toString() == elements.wall.behavior.toString() && !elements[name].tick) {
|
|
259
|
+
return false;
|
|
260
|
+
};
|
|
261
|
+
if(["liquid","gas"].includes(state)) {
|
|
262
|
+
return true;
|
|
263
|
+
};
|
|
264
|
+
if(info.movable) {
|
|
265
|
+
return true;
|
|
266
|
+
};
|
|
267
|
+
if(elements[name].behavior instanceof Array) {
|
|
268
|
+
var behaviorString = elements[name].behavior.toString();
|
|
269
|
+
return behaviorString.includes("M1") || behaviorString.includes("M2");
|
|
270
|
+
};
|
|
271
|
+
if(backupCategoryWhitelist.includes(category)) {
|
|
272
|
+
return true;
|
|
273
|
+
};
|
|
274
|
+
if(backupElementWhitelist.includes(name)) {
|
|
275
|
+
return true;
|
|
276
|
+
};
|
|
277
|
+
if(category.includes("mudstone")) {
|
|
278
|
+
return true;
|
|
279
|
+
};
|
|
280
|
+
return false;
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
libraryLoaded = true;
|
|
284
|
+
this.libraryLoaded = true;
|
|
285
|
+
window.libraryLoaded = true;
|
|
286
|
+
|
|
287
|
+
//Math(s)
|
|
288
|
+
|
|
289
|
+
//Base n logarithm from https://stackoverflow.com/a/3019290
|
|
290
|
+
function logN(number,base) { //Vulnerable to float issues
|
|
291
|
+
return Math.log(number) / Math.log(base);
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
//Distance between points
|
|
295
|
+
function pyth(xA,yA,xB,yB) {
|
|
296
|
+
var a = Math.abs(xB - xA);
|
|
297
|
+
var b = Math.abs(yB - yA);
|
|
298
|
+
var c = Math.sqrt(a**2 + b**2);
|
|
299
|
+
return c;
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
//Limit number to [min, max]
|
|
303
|
+
function bound(number,lowerBound,upperBound) {
|
|
304
|
+
return Math.min(upperBound,Math.max(lowerBound,number));
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
//Emergency color wrapper
|
|
308
|
+
rgbColorBound = function(color) {
|
|
309
|
+
return bound(color,0,255);
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
function addTwoNumbers(number1,number2) { //reducer
|
|
313
|
+
return number1 + number2
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
//Logistic curve
|
|
317
|
+
//x = real number
|
|
318
|
+
//L = maximum value
|
|
319
|
+
//x_0 = "the x value of the sigmoid midpoint" i.e. the x center of the bendy part
|
|
320
|
+
//k = steepness
|
|
321
|
+
function logisticCurve(x,L,k,x0) {
|
|
322
|
+
return L/( 1 + ( Math.E ** ( -k * (x - x0) ) ) );
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
// https://stackoverflow.com/questions/10756313/javascript-jquery-map-a-range-of-numbers-to-another-range-of-numbers
|
|
326
|
+
// Function from August Miller
|
|
327
|
+
//Map a range of numbers to another range of numbers
|
|
328
|
+
function scale (number, inMin, inMax, outMin, outMax) {
|
|
329
|
+
return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
libraryLoaded = true;
|
|
333
|
+
this.libraryLoaded = true;
|
|
334
|
+
window.libraryLoaded = true;
|
|
335
|
+
|
|
336
|
+
//Color
|
|
337
|
+
|
|
338
|
+
function rgbStringToUnvalidatedObject(string) { //turns rgb() to {r,g,b} with no bounds checking
|
|
339
|
+
//console.log("Splitting string into object");
|
|
340
|
+
string = string.split(",");
|
|
341
|
+
var red = parseFloat(string[0].substring(4));
|
|
342
|
+
var green = parseFloat(string[1]);
|
|
343
|
+
var blue = parseFloat(string[2].slice(0,-1));
|
|
344
|
+
//console.log("String split: outputs " + red + ", " + green + ", " + blue + ".");
|
|
345
|
+
return {r: red, g: green, b: blue};
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
function rgbStringToObject(string,doRounding=true,doBounding=true) { //turns rgb() to {r,g,b}
|
|
349
|
+
//console.log(`rgbStringToObject: ${string}`);
|
|
350
|
+
//console.log("Splitting string into object");
|
|
351
|
+
string = string.split(",");
|
|
352
|
+
if( (!string[0].startsWith("rgb(")) || (!string[2].endsWith(")")) ) {
|
|
353
|
+
throw new Error("Color must start with \"rgb(\" and end with \")\"");
|
|
354
|
+
};
|
|
355
|
+
var red = parseFloat(string[0].substring(4));
|
|
356
|
+
var green = parseFloat(string[1]);
|
|
357
|
+
var blue = parseFloat(string[2].slice(0,-1));
|
|
358
|
+
//console.log(`Colors loaded (${red}, ${green}, ${blue})`);
|
|
359
|
+
//NaN checking
|
|
360
|
+
var redNaN = isNaN(red);
|
|
361
|
+
var greenNaN = isNaN(green);
|
|
362
|
+
var blueNaN = isNaN(blue);
|
|
363
|
+
var NanErrorString = "One or more colors are NaN:"
|
|
364
|
+
if(redNaN) { NanErrorString += " red" };
|
|
365
|
+
if(greenNaN) { NanErrorString += " green" };
|
|
366
|
+
if(blueNaN) { NanErrorString += " blue" };
|
|
367
|
+
if(redNaN || greenNaN || blueNaN) { throw new Error(NanErrorString) };
|
|
368
|
+
if(doRounding) {
|
|
369
|
+
red = Math.round(red);
|
|
370
|
+
green = Math.round(green);
|
|
371
|
+
blue = Math.round(blue);
|
|
372
|
+
//console.log(`Colors rounded to (${red}, ${green}, ${blue})`);
|
|
373
|
+
};
|
|
374
|
+
if(doBounding) {
|
|
375
|
+
red = bound(red,0,255)
|
|
376
|
+
green = bound(green,0,255)
|
|
377
|
+
blue = bound(blue,0,255)
|
|
378
|
+
//console.log(`Colors bounded to (${red}, ${green}, ${blue})`);
|
|
379
|
+
};
|
|
380
|
+
//console.log("String split: outputs " + red + ", " + green + ", " + blue + ".");
|
|
381
|
+
return {r: red, g: green, b: blue};
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
function hslColorStringToObject(color) {
|
|
385
|
+
if(!color.startsWith("hsl(") || !color.endsWith(")")) {
|
|
386
|
+
throw new Error(`The color ${color} is not a valid hsl() color`)
|
|
387
|
+
};
|
|
388
|
+
var colorTempArray = color.split(",")
|
|
389
|
+
if(colorTempArray.length !== 3) {
|
|
390
|
+
throw new Error(`The color ${color} is not a valid hsl() color`)
|
|
391
|
+
};
|
|
392
|
+
if(!colorTempArray[1].endsWith("%")) { console.log(`hslColorStringToObject: Saturation in color ${color} was missing a %`); colorTempArray[1] += "%"; }
|
|
393
|
+
if(!colorTempArray[2].endsWith("%)")) { console.log(`hslColorStringToObject: Lightness in color ${color} was missing a %`); colorTempArray[2] = [colorTempArray[2].slice(0, colorTempArray[2].length - 1), "%", colorTempArray[2].slice(colorTempArray[2].length - 1)].join(''); }
|
|
394
|
+
var hue = parseFloat(colorTempArray[0].substring(4));
|
|
395
|
+
var saturation = parseFloat(colorTempArray[1].slice(0,-1))
|
|
396
|
+
var lightness = parseFloat(colorTempArray[2].slice(0,-2));
|
|
397
|
+
//NaN checking
|
|
398
|
+
var hueNaN,saturationNaN,lightnessNaN;
|
|
399
|
+
isNaN(hue) ? hueNaN = true : hueNaN = false;
|
|
400
|
+
isNaN(saturation) ? saturationNaN = true : saturationNaN = false;
|
|
401
|
+
isNaN(lightness) ? lightnessNaN = true : lightnessNaN = false;
|
|
402
|
+
var NanErrorString = "One or more colors are NaN:"
|
|
403
|
+
if(hueNaN) { NanErrorString += " hue" };
|
|
404
|
+
if(saturationNaN) { NanErrorString += " saturation" };
|
|
405
|
+
if(lightnessNaN) { NanErrorString += " lightness" };
|
|
406
|
+
if(hueNaN || saturationNaN || lightnessNaN) { throw new Error(NanErrorString) };
|
|
407
|
+
return {h: hue, s: saturation, l: lightness};
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
function rgbToHex(color) {
|
|
411
|
+
//console.log(`rgbToHex called on ${typeof(color) === "object" ? JSON.stringify(color) : color}`);
|
|
412
|
+
if(typeof(color) == "object") { //Expects object like "{r: 172, g: 11, b: 34}"
|
|
413
|
+
var red = color.r;
|
|
414
|
+
var green = color.g;
|
|
415
|
+
var blue = color.b;
|
|
416
|
+
//console.log(`Colors loaded (${red}, ${green}, ${blue})`);
|
|
417
|
+
red = Math.round(red);
|
|
418
|
+
green = Math.round(green);
|
|
419
|
+
blue = Math.round(blue);
|
|
420
|
+
//console.log(`Colors rounded to (${red}, ${green}, ${blue})`);
|
|
421
|
+
red = bound(red,0,255)
|
|
422
|
+
green = bound(green,0,255)
|
|
423
|
+
blue = bound(blue,0,255)
|
|
424
|
+
//console.log(`Colors bounded to (${red}, ${green}, ${blue})`);
|
|
425
|
+
red = red.toString(16);
|
|
426
|
+
green = green.toString(16);
|
|
427
|
+
blue = blue.toString(16);
|
|
428
|
+
//console.log(`Colors converted to (0x${red}, 0x${green}, 0x${blue})`);
|
|
429
|
+
//console.log("Padding R");
|
|
430
|
+
while(red.length < 2) {
|
|
431
|
+
red = "0" + red;
|
|
432
|
+
};
|
|
433
|
+
//console.log("Padding G");
|
|
434
|
+
while(green.length < 2) {
|
|
435
|
+
green = "0" + green;
|
|
436
|
+
};
|
|
437
|
+
//console.log("Padding B");
|
|
438
|
+
while(blue.length < 2) {
|
|
439
|
+
blue = "0" + blue;
|
|
440
|
+
};
|
|
441
|
+
//console.log(`Colors padded to (0x${red}, 0x${green}, 0x${blue}), concatenating...`);
|
|
442
|
+
return "#" + red + green + blue;
|
|
443
|
+
} else if(typeof(color) == "string") { //Expects string like "rgb(20,137,4)". Also doesn't round properly for some reason...
|
|
444
|
+
//console.log("Splitting string")
|
|
445
|
+
color = rgbStringToUnvalidatedObject(color);
|
|
446
|
+
red = color.r;
|
|
447
|
+
green = color.g;
|
|
448
|
+
blue = color.b;
|
|
449
|
+
//console.log(`Colors loaded (${red}, ${green}, ${blue})`);
|
|
450
|
+
red = Math.round(red);
|
|
451
|
+
green = Math.round(green);
|
|
452
|
+
blue = Math.round(blue);
|
|
453
|
+
//console.log(`Colors rounded to (${red}, ${green}, ${blue})`);
|
|
454
|
+
red = bound(red,0,255)
|
|
455
|
+
green = bound(green,0,255)
|
|
456
|
+
blue = bound(blue,0,255)
|
|
457
|
+
//console.log(`Colors bounded to (${red}, ${green}, ${blue})`);
|
|
458
|
+
red = red.toString(16);
|
|
459
|
+
green = green.toString(16);
|
|
460
|
+
blue = blue.toString(16);
|
|
461
|
+
//console.log(`Colors converted to (0x${red}, 0x${green}, 0x${blue})`);
|
|
462
|
+
//console.log("Padding R");
|
|
463
|
+
while(red.length < 2) {
|
|
464
|
+
red = "0" + red;
|
|
465
|
+
};
|
|
466
|
+
//console.log("Padding G");
|
|
467
|
+
while(green.length < 2) {
|
|
468
|
+
green = "0" + green;
|
|
469
|
+
};
|
|
470
|
+
//console.log("Padding B");
|
|
471
|
+
while(blue.length < 2) {
|
|
472
|
+
blue = "0" + blue;
|
|
473
|
+
};
|
|
474
|
+
//console.log(`Colors padded to (0x${red}, 0x${green}, 0x${blue}), concatenating...`);
|
|
475
|
+
return "#" + red + green + blue;
|
|
476
|
+
} else {
|
|
477
|
+
throw new Error(`Received invalid color: ${color}`);
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
function linearBlendTwoColorObjects(color1,color2,weight1=0.5) { /*third argument is for color1 and expects a float from 0
|
|
482
|
+
to 1, where 0 means "all color2" and 1 means "all color1"*/
|
|
483
|
+
var w1 = Math.min(Math.max(weight1,0),1);
|
|
484
|
+
var red1 = color1.r;
|
|
485
|
+
var green1 = color1.g;
|
|
486
|
+
var blue1 = color1.b;
|
|
487
|
+
var red2 = color2.r;
|
|
488
|
+
var green2 = color2.g;
|
|
489
|
+
var blue2 = color2.b;
|
|
490
|
+
var red3 = (red1 * w1) + (red2 * (1 - w1));
|
|
491
|
+
var green3 = (green1 * w1) + (green2 * (1 - w1));
|
|
492
|
+
var blue3 = (blue1 * w1) + (blue2 * (1 - w1));
|
|
493
|
+
return {r: red3, g: green3, b: blue3};
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
function lightenColor(color,offset,outputType="rgb") {
|
|
497
|
+
if(typeof(color) === "string") {
|
|
498
|
+
if(color.length < 10) {
|
|
499
|
+
//console.log(`detected as hex: ${color}`);
|
|
500
|
+
//catch missing octothorpes
|
|
501
|
+
if(!color.startsWith("#")) {
|
|
502
|
+
color = "#" + color;
|
|
503
|
+
};
|
|
504
|
+
//console.log(`octothorpe checked: ${color}`);
|
|
505
|
+
|
|
506
|
+
offset = parseFloat(offset);
|
|
507
|
+
if(isNaN(offset)) {
|
|
508
|
+
throw new Error("Offset is NaN");
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
color = hexToRGB(color);
|
|
512
|
+
if(color === null) {
|
|
513
|
+
throw new Error("hexToRGB(color) was null (maybe it's an invalid hex triplet?)");
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
//console.log("converted color: " + JSON.stringify(color));
|
|
517
|
+
var red = color.r + offset;
|
|
518
|
+
var green = color.g + offset;
|
|
519
|
+
var blue = color.b + offset;
|
|
520
|
+
//console.log(`altered color: rgb(${red},${green},${blue})`);
|
|
521
|
+
|
|
522
|
+
//rounding and bounding
|
|
523
|
+
red = Math.round(red);
|
|
524
|
+
green = Math.round(green);
|
|
525
|
+
blue = Math.round(blue);
|
|
526
|
+
//console.log(`rounded color: rgb(${red},${green},${blue})`);
|
|
527
|
+
red = bound(red,0,255)
|
|
528
|
+
green = bound(green,0,255)
|
|
529
|
+
blue = bound(blue,0,255)
|
|
530
|
+
//console.log(`bounded color: rgb(${red},${green},${blue})`);
|
|
531
|
+
|
|
532
|
+
color = {r: red, g: green, b: blue};
|
|
533
|
+
|
|
534
|
+
switch(outputType.toLowerCase()) {
|
|
535
|
+
case "rgb":
|
|
536
|
+
return `rgb(${red},${green},${blue})`;
|
|
537
|
+
break;
|
|
538
|
+
case "hex":
|
|
539
|
+
return rgbToHex(color);
|
|
540
|
+
break;
|
|
541
|
+
case "json":
|
|
542
|
+
return color;
|
|
543
|
+
break;
|
|
544
|
+
default:
|
|
545
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\"");
|
|
546
|
+
};
|
|
547
|
+
} else {
|
|
548
|
+
if(color.startsWith("rgb(")) {
|
|
549
|
+
color = convertColorFormats(color,"json"); //object conversion
|
|
550
|
+
//console.log(`color converted to object: ${JSON.stringify(color)}`);
|
|
551
|
+
|
|
552
|
+
offset = parseFloat(offset);
|
|
553
|
+
if(isNaN(offset)) {
|
|
554
|
+
throw new Error("Offset is NaN");
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
var red = color.r + offset;
|
|
558
|
+
var green = color.g + offset;
|
|
559
|
+
var blue = color.b + offset;
|
|
560
|
+
//console.log(`altered color: rgb(${red},${green},${blue})`);
|
|
561
|
+
|
|
562
|
+
//rounding and bounding
|
|
563
|
+
red = Math.round(red);
|
|
564
|
+
green = Math.round(green);
|
|
565
|
+
blue = Math.round(blue);
|
|
566
|
+
//console.log(`rounded color: rgb(${red},${green},${blue})`);
|
|
567
|
+
red = bound(red,0,255)
|
|
568
|
+
green = bound(green,0,255)
|
|
569
|
+
blue = bound(blue,0,255)
|
|
570
|
+
//console.log(`bounded color: rgb(${red},${green},${blue})`);
|
|
571
|
+
|
|
572
|
+
color = {r: red, g: green, b: blue};
|
|
573
|
+
|
|
574
|
+
switch(outputType.toLowerCase()) {
|
|
575
|
+
case "rgb":
|
|
576
|
+
return `rgb(${red},${green},${blue})`;
|
|
577
|
+
break;
|
|
578
|
+
case "hex":
|
|
579
|
+
return rgbToHex(color);
|
|
580
|
+
break;
|
|
581
|
+
case "json":
|
|
582
|
+
return color;
|
|
583
|
+
break;
|
|
584
|
+
default:
|
|
585
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\"");
|
|
586
|
+
};
|
|
587
|
+
} /*else if(color.startsWith("hsl")) {
|
|
588
|
+
throw new Error("HSL is not implemented yet");
|
|
589
|
+
}*/ else {
|
|
590
|
+
throw new Error('Color must be of the type "rgb(red,green,blue)"'/* or "hsl(hue,saturation%,luminance%)"*/);
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
} else if(typeof(color) === "object") {
|
|
594
|
+
if(typeof(color.r) === "undefined" || typeof(color.g) === "undefined" || typeof(color.b) === "undefined") {
|
|
595
|
+
throw new Error("Color must be of the form {r: red, g: green, b: blue}");
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
//console.log("received color: " + JSON.stringify(color));
|
|
599
|
+
var red = color.r + offset;
|
|
600
|
+
var green = color.g + offset;
|
|
601
|
+
var blue = color.b + offset;
|
|
602
|
+
//console.log(`altered color: rgb(${red},${green},${blue})`);
|
|
603
|
+
|
|
604
|
+
//rounding and bounding
|
|
605
|
+
red = Math.round(red);
|
|
606
|
+
green = Math.round(green);
|
|
607
|
+
blue = Math.round(blue);
|
|
608
|
+
//console.log(`rounded color: rgb(${red},${green},${blue})`);
|
|
609
|
+
red = bound(red,0,255)
|
|
610
|
+
green = bound(green,0,255)
|
|
611
|
+
blue = bound(blue,0,255)
|
|
612
|
+
//console.log(`bounded color: rgb(${red},${green},${blue})`);
|
|
613
|
+
|
|
614
|
+
color = {r: red, g: green, b: blue};
|
|
615
|
+
|
|
616
|
+
switch(outputType.toLowerCase()) {
|
|
617
|
+
case "rgb":
|
|
618
|
+
return `rgb(${red},${green},${blue})`;
|
|
619
|
+
break;
|
|
620
|
+
case "hex":
|
|
621
|
+
return rgbToHex(color);
|
|
622
|
+
break;
|
|
623
|
+
case "json":
|
|
624
|
+
return color;
|
|
625
|
+
break;
|
|
626
|
+
default:
|
|
627
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\"");
|
|
628
|
+
};
|
|
629
|
+
};
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
function rgbObjectToString(color) {
|
|
633
|
+
if(typeof(color) !== "object") {
|
|
634
|
+
throw new Error("Input color is not an object");
|
|
635
|
+
};
|
|
636
|
+
var red = color.r;
|
|
637
|
+
var green = color.g;
|
|
638
|
+
var blue = color.b;
|
|
639
|
+
//console.log(`Colors loaded (${red}, ${green}, ${blue})`);
|
|
640
|
+
red = Math.round(red);
|
|
641
|
+
green = Math.round(green);
|
|
642
|
+
blue = Math.round(blue);
|
|
643
|
+
//console.log(`Colors rounded to (${red}, ${green}, ${blue})`);
|
|
644
|
+
red = bound(red,0,255)
|
|
645
|
+
green = bound(green,0,255)
|
|
646
|
+
blue = bound(blue,0,255)
|
|
647
|
+
//console.log(`Colors bounded to (${red}, ${green}, ${blue})`);
|
|
648
|
+
return `rgb(${red},${green},${blue})`
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
function convertColorFormats(color,outputType="rgb") { //Hex triplet and object to rgb(), while rgb() is untouched
|
|
652
|
+
if(typeof(color) === "undefined") {
|
|
653
|
+
//console.log("Warning: An element has an undefined color. Unfortunately, due to how the code is structured, I can't say which one.");
|
|
654
|
+
//color = "#FF00FF";
|
|
655
|
+
throw new Error("Color is undefined!");
|
|
656
|
+
};
|
|
657
|
+
//console.log("Logged color for convertColorFormats: " + color);
|
|
658
|
+
if(typeof(color) === "string") {
|
|
659
|
+
if(typeof(color) === "string" && color.length < 10) {
|
|
660
|
+
//console.log(`detected as hex: ${color}`);
|
|
661
|
+
//catch missing octothorpes
|
|
662
|
+
if(!color.startsWith("#")) {
|
|
663
|
+
color = "#" + color;
|
|
664
|
+
};
|
|
665
|
+
//console.log(`octothorpe checked: ${color}`);
|
|
666
|
+
|
|
667
|
+
color = hexToRGB(color);
|
|
668
|
+
if(color === null) {
|
|
669
|
+
throw new Error("hexToRGB(color) was null (maybe it's an invalid hex triplet?)");
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
switch(outputType.toLowerCase()) {
|
|
673
|
+
case "rgb":
|
|
674
|
+
return `rgb(${color.r},${color.g},${color.b})`;
|
|
675
|
+
break;
|
|
676
|
+
case "hex":
|
|
677
|
+
return rgbToHex(color);
|
|
678
|
+
break;
|
|
679
|
+
case "json":
|
|
680
|
+
return color;
|
|
681
|
+
break;
|
|
682
|
+
case "array":
|
|
683
|
+
return [color.r, color.g, color.b];
|
|
684
|
+
break;
|
|
685
|
+
default:
|
|
686
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\", or \"array\"");
|
|
687
|
+
};
|
|
688
|
+
} else {
|
|
689
|
+
if(typeof(color) === "string" && color.startsWith("rgb(")) {
|
|
690
|
+
//console.log(`convertColorFormats: calling rgbStringToObject on color ${color}`);
|
|
691
|
+
color = rgbStringToObject(color,true,false);
|
|
692
|
+
switch(outputType.toLowerCase()) {
|
|
693
|
+
case "rgb":
|
|
694
|
+
if(typeof(color) === "string") { color = rgbStringToObject(color) };
|
|
695
|
+
return `rgb(${color.r},${color.g},${color.b})`;
|
|
696
|
+
break;
|
|
697
|
+
case "hex":
|
|
698
|
+
return rgbToHex(color);
|
|
699
|
+
break;
|
|
700
|
+
case "json":
|
|
701
|
+
return color;
|
|
702
|
+
break;
|
|
703
|
+
case "array":
|
|
704
|
+
return [color.r, color.g, color.b];
|
|
705
|
+
break;
|
|
706
|
+
default:
|
|
707
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\", or \"array\"");
|
|
708
|
+
};
|
|
709
|
+
} else {
|
|
710
|
+
throw new Error('Color must be of the type "rgb(red,green,blue)"');
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
} else if(typeof(color) === "object") {
|
|
714
|
+
switch(outputType.toLowerCase()) {
|
|
715
|
+
case "rgb":
|
|
716
|
+
return `rgb(${color.r},${color.g},${color.b})`;
|
|
717
|
+
break;
|
|
718
|
+
case "hex":
|
|
719
|
+
return rgbToHex(color);
|
|
720
|
+
break;
|
|
721
|
+
case "json":
|
|
722
|
+
return color;
|
|
723
|
+
break;
|
|
724
|
+
case "array":
|
|
725
|
+
return [color.r, color.g, color.b];
|
|
726
|
+
break;
|
|
727
|
+
default:
|
|
728
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\", or \"array\"");
|
|
729
|
+
};
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
function rgbHexCatcher(color) {
|
|
734
|
+
return convertColorFormats(color,"rgb");
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
function averageColorObjects(color1,color2,weight1=0.5) { //misnomer, actually a linear interpolation but it's too late to rename that
|
|
739
|
+
//third argument is for color1 and expects a float from 0 to 1, where 0 means "all color2" and 1 means "all color1"
|
|
740
|
+
//(backwards from how it should work)
|
|
741
|
+
var w1 = Math.min(Math.max(weight1,0),1)
|
|
742
|
+
var red1 = color1.r
|
|
743
|
+
var green1 = color1.g
|
|
744
|
+
var blue1 = color1.b
|
|
745
|
+
var red2 = color2.r
|
|
746
|
+
var green2 = color2.g
|
|
747
|
+
var blue2 = color2.b
|
|
748
|
+
var red3 = (red1 * w1) + (red2 * (1 - w1))
|
|
749
|
+
var green3 = (green1 * w1) + (green2 * (1 - w1))
|
|
750
|
+
var blue3 = (blue1 * w1) + (blue2 * (1 - w1))
|
|
751
|
+
return {r: red3, g: green3, b: blue3}
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
function lerpColors(color1,color2,outputType="rgb",weight1=0.5) {
|
|
755
|
+
color1 = convertColorFormats(color1,"json");
|
|
756
|
+
color2 = convertColorFormats(color2,"json");
|
|
757
|
+
theColor = averageColorObjects(color1,color2,weight1);
|
|
758
|
+
return convertColorFormats(theColor,outputType);
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
function multiplyColors(color1,color2,outputType="rgb") {
|
|
762
|
+
//normalize rgb()/hex by turning any hex into rgb() and then rgb()s to {r,g,b}
|
|
763
|
+
if(typeof(color1) !== "object") {
|
|
764
|
+
color1 = convertColorFormats(color1,"json");
|
|
765
|
+
};
|
|
766
|
+
if(typeof(color2) !== "object") {
|
|
767
|
+
color2 = convertColorFormats(color2,"json");
|
|
768
|
+
};
|
|
769
|
+
var finalR = Math.round(color1.r * (color2.r/255));
|
|
770
|
+
var finalG = Math.round(color1.g * (color2.g/255));
|
|
771
|
+
var finalB = Math.round(color1.b * (color2.b/255));
|
|
772
|
+
var finalColor = {r: finalR, g: finalG, b: finalB};
|
|
773
|
+
switch(outputType.toLowerCase()) {
|
|
774
|
+
case "rgb":
|
|
775
|
+
return `rgb(${finalColor.r},${finalColor.g},${finalColor.b})`;
|
|
776
|
+
break;
|
|
777
|
+
case "hex":
|
|
778
|
+
return rgbToHex(finalColor);
|
|
779
|
+
break;
|
|
780
|
+
case "json":
|
|
781
|
+
return finalColor;
|
|
782
|
+
break;
|
|
783
|
+
default:
|
|
784
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\"");
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
function divideColors(color1,color2,outputType="rgb") { //color2 is the divisor and color1 the dividend (base/original color)
|
|
789
|
+
//normalize rgb()/hex by turning any hex into rgb() and then rgb()s to {r,g,b}
|
|
790
|
+
if(typeof(color1) !== "object") {
|
|
791
|
+
color1 = convertColorFormats(color1,"json");
|
|
792
|
+
};
|
|
793
|
+
if(typeof(color2) !== "object") {
|
|
794
|
+
color2 = convertColorFormats(color2,"json");
|
|
795
|
+
};
|
|
796
|
+
var finalR = bound(Math.round(255 / (color2.r / color1.r)),0,255);
|
|
797
|
+
var finalG = bound(Math.round(255 / (color2.g / color1.g)),0,255);
|
|
798
|
+
var finalB = bound(Math.round(255 / (color2.b / color1.b)),0,255);
|
|
799
|
+
if(isNaN(finalR)) { finalR = 255 };
|
|
800
|
+
if(isNaN(finalG)) { finalG = 255 };
|
|
801
|
+
if(isNaN(finalB)) { finalB = 255 };
|
|
802
|
+
var finalColor = {r: finalR, g: finalG, b: finalB};
|
|
803
|
+
switch(outputType.toLowerCase()) {
|
|
804
|
+
case "rgb":
|
|
805
|
+
return `rgb(${finalColor.r},${finalColor.g},${finalColor.b})`;
|
|
806
|
+
break;
|
|
807
|
+
case "hex":
|
|
808
|
+
return rgbToHex(finalColor);
|
|
809
|
+
break;
|
|
810
|
+
case "json":
|
|
811
|
+
return finalColor;
|
|
812
|
+
break;
|
|
813
|
+
default:
|
|
814
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\"");
|
|
815
|
+
};
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
function addColors(color1,color2,outputType="rgb") {
|
|
819
|
+
//normalize rgb()/hex by turning any hex into rgb() and then rgb()s to {r,g,b}
|
|
820
|
+
if(typeof(color1) !== "object") {
|
|
821
|
+
color1 = convertColorFormats(color1,"json");
|
|
822
|
+
};
|
|
823
|
+
if(typeof(color2) !== "object") {
|
|
824
|
+
color2 = convertColorFormats(color2,"json");
|
|
825
|
+
};
|
|
826
|
+
var finalR = bound(Math.round(color1.r + color2.r),0,255)
|
|
827
|
+
var finalG = bound(Math.round(color1.g + color2.g),0,255)
|
|
828
|
+
var finalB = bound(Math.round(color1.b + color2.b),0,255)
|
|
829
|
+
var finalColor = {r: finalR, g: finalG, b: finalB};
|
|
830
|
+
switch(outputType.toLowerCase()) {
|
|
831
|
+
case "rgb":
|
|
832
|
+
return `rgb(${finalColor.r},${finalColor.g},${finalColor.b})`;
|
|
833
|
+
break;
|
|
834
|
+
case "hex":
|
|
835
|
+
return rgbToHex(finalColor);
|
|
836
|
+
break;
|
|
837
|
+
case "json":
|
|
838
|
+
return finalColor;
|
|
839
|
+
break;
|
|
840
|
+
default:
|
|
841
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\"");
|
|
842
|
+
};
|
|
843
|
+
};
|
|
844
|
+
|
|
845
|
+
function subtractColors(color1,color2,outputType="rgb") {
|
|
846
|
+
//normalize rgb()/hex by turning any hex into rgb() and then rgb()s to {r,g,b}
|
|
847
|
+
if(typeof(color1) !== "object") {
|
|
848
|
+
color1 = convertColorFormats(color1,"json");
|
|
849
|
+
};
|
|
850
|
+
if(typeof(color2) !== "object") {
|
|
851
|
+
color2 = convertColorFormats(color2,"json");
|
|
852
|
+
};
|
|
853
|
+
var finalR = bound(Math.round(color1.r - color2.r),0,255)
|
|
854
|
+
var finalG = bound(Math.round(color1.g - color2.g),0,255)
|
|
855
|
+
var finalB = bound(Math.round(color1.b - color2.b),0,255)
|
|
856
|
+
var finalColor = {r: finalR, g: finalG, b: finalB};
|
|
857
|
+
switch(outputType.toLowerCase()) {
|
|
858
|
+
case "rgb":
|
|
859
|
+
return `rgb(${finalColor.r},${finalColor.g},${finalColor.b})`;
|
|
860
|
+
break;
|
|
861
|
+
case "hex":
|
|
862
|
+
return rgbToHex(finalColor);
|
|
863
|
+
break;
|
|
864
|
+
case "json":
|
|
865
|
+
return finalColor;
|
|
866
|
+
break;
|
|
867
|
+
default:
|
|
868
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"json\"");
|
|
869
|
+
};
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
function averageRgbPrefixedColorArray(colorArray,returnObject=false) { //array of rgb()s to single rgb() of average color
|
|
873
|
+
//averageRgbPrefixedColorArray(["rgb(255,0,0)", "rgb(0,0,0)", "rgb(0,0,255)"]);
|
|
874
|
+
//console.log("Averaging started");
|
|
875
|
+
var reds = [];
|
|
876
|
+
var greens = [];
|
|
877
|
+
var blues = [];
|
|
878
|
+
for(k = 0; k < colorArray.length; k++) {
|
|
879
|
+
//console.log("Average function: Executing catcher on " + colorArray);
|
|
880
|
+
var color = convertColorFormats(colorArray[k]);
|
|
881
|
+
//console.log("Logged color for aRPCA: " + color);
|
|
882
|
+
color = color.split(",");
|
|
883
|
+
var red = parseFloat(color[0].substring(4));
|
|
884
|
+
reds.push(red)
|
|
885
|
+
var green = parseFloat(color[1]);
|
|
886
|
+
greens.push(green)
|
|
887
|
+
var blue = parseFloat(color[2].slice(0,-1));
|
|
888
|
+
blues.push(blue)
|
|
889
|
+
};
|
|
890
|
+
redAverage = Math.round(averageNumericArray(reds));
|
|
891
|
+
greenAverage = Math.round(averageNumericArray(greens));
|
|
892
|
+
blueAverage = Math.round(averageNumericArray(blues));
|
|
893
|
+
var output;
|
|
894
|
+
returnObject ? output = {r: redAverage, g: greenAverage, b: blueAverage} : output = `rgb(${redAverage},${greenAverage},${blueAverage})`;
|
|
895
|
+
//console.log("Averaging finished, product: " + output);
|
|
896
|
+
return output;
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
//https://stackoverflow.com/questions/46432335/hex-to-hsl-convert-javascript
|
|
900
|
+
function rgbStringToHSL(rgb,outputType="array") { //Originally a hex-to-HSL function, edited to take RGB and spit out an array
|
|
901
|
+
//console.log("HSLing some RGBs");
|
|
902
|
+
var result = rgbStringToUnvalidatedObject(rgb);
|
|
903
|
+
|
|
904
|
+
var r = result.r;
|
|
905
|
+
var g = result.g;
|
|
906
|
+
var b = result.b;
|
|
907
|
+
|
|
908
|
+
r /= 255, g /= 255, b /= 255;
|
|
909
|
+
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
910
|
+
var h, s, l = (max + min) / 2;
|
|
911
|
+
|
|
912
|
+
if(max == min){
|
|
913
|
+
h = s = 0; // achromatic
|
|
914
|
+
} else {
|
|
915
|
+
var d = max - min;
|
|
916
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
917
|
+
switch(max) {
|
|
918
|
+
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
|
|
919
|
+
case g: h = (b - r) / d + 2; break;
|
|
920
|
+
case b: h = (r - g) / d + 4; break;
|
|
921
|
+
}
|
|
922
|
+
h /= 6;
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
s = s*100;
|
|
926
|
+
s = Math.round(s);
|
|
927
|
+
l = l*100;
|
|
928
|
+
l = Math.round(l);
|
|
929
|
+
h = Math.round(360*h);
|
|
930
|
+
|
|
931
|
+
//var colorInHSL = 'hsl(' + h + ', ' + s + '%, ' + l + '%)';
|
|
932
|
+
//Edit to return an array
|
|
933
|
+
switch(outputType.toLowerCase()) {
|
|
934
|
+
case "array":
|
|
935
|
+
return [h,s,l];
|
|
936
|
+
break;
|
|
937
|
+
case "hsl":
|
|
938
|
+
return `hsl(${h},${s}%,${l}%)`;
|
|
939
|
+
break;
|
|
940
|
+
case "json":
|
|
941
|
+
return {h: h, s: s, l: l};
|
|
942
|
+
default:
|
|
943
|
+
throw new Error("outputType must be \"array\", \"hsl\", or \"json\"");
|
|
944
|
+
break;
|
|
945
|
+
};
|
|
946
|
+
//console.log("HSL output "+ colorInHSL + ".");
|
|
947
|
+
|
|
948
|
+
};
|
|
949
|
+
|
|
950
|
+
function normalizeColorToHslObject(color,arrayType=null) {
|
|
951
|
+
var ambiguousArrayError = "changeSaturation can't tell if the array input is supposed to be RGB or HSL. Please use an \"arrayType\" argument of \"rgb\" or \"hsl\".";
|
|
952
|
+
var isHsl = false;
|
|
953
|
+
if(Array.isArray(color)) {
|
|
954
|
+
if(arrayType === null) {
|
|
955
|
+
throw new Error(ambiguousArrayError);
|
|
956
|
+
} else if(arrayType === "rgb") {
|
|
957
|
+
color = `rgb(${color[0]},${color[1]},${color[2]})`;
|
|
958
|
+
color = rgbStringToHSL(color,"json"); //rgb arr to hsl obj
|
|
959
|
+
} else if(arrayType === "hsl") {
|
|
960
|
+
color = {h: color[0], s: color[1], l: color[2]}; //hsl arr to hsl obj
|
|
961
|
+
} else {
|
|
962
|
+
throw new Error(ambiguousArrayError);
|
|
963
|
+
};
|
|
964
|
+
} else {
|
|
965
|
+
//by this point, any array cases would have been handled, leaving just hex (rgb), json rgb, json hsl, string rgb, and string hsl
|
|
966
|
+
if(typeof(color) === "string") {
|
|
967
|
+
if(color.length < 10) { //detect hex: assume hex triplet if too short to be a well-formed rgb()
|
|
968
|
+
if(!color.startsWith("#")) {
|
|
969
|
+
color = "#" + color; //catch missing #
|
|
970
|
+
};
|
|
971
|
+
isHsl = false;
|
|
972
|
+
};
|
|
973
|
+
if(color.startsWith("rgb(")) { //detect rgb(): self-explanatory
|
|
974
|
+
isHsl = false;
|
|
975
|
+
};
|
|
976
|
+
if(color.startsWith("hsl(")) { //detect hsl(): self-explanatory
|
|
977
|
+
isHsl = true;
|
|
978
|
+
};
|
|
979
|
+
} else if(typeof(color) === "object") {
|
|
980
|
+
if(typeof(color.r) !== "undefined") { //detect {r,g,b}: check for r key
|
|
981
|
+
isHsl = false;
|
|
982
|
+
};
|
|
983
|
+
if(typeof(color.h) !== "undefined") { //detect {h,s,l}: check for h key
|
|
984
|
+
isHsl = true;
|
|
985
|
+
};
|
|
986
|
+
};
|
|
987
|
+
if(!isHsl) {
|
|
988
|
+
color = convertColorFormats(color,"rgb"); //make any RGBs rgb()
|
|
989
|
+
color = rgbStringToHSL(color,"json"); //make that rgb() an {h,s,l}
|
|
990
|
+
} else { //by this point, it would have to either be a string or an object
|
|
991
|
+
if(typeof(color) === "string") { //if it's a string
|
|
992
|
+
color = hslColorStringToObject(color) //now it's an object
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
};
|
|
996
|
+
return color;
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
function convertHslObjects(color,outputType="rgb") {
|
|
1000
|
+
switch(outputType.toLowerCase()) {
|
|
1001
|
+
//RGB cases
|
|
1002
|
+
case "rgb":
|
|
1003
|
+
color = hexToRGB(hslToHex(...Object.values(color))); //hsl to hex, hex to rgb_json, and rgb_json to rgb()
|
|
1004
|
+
return `rgb(${color.r},${color.g},${color.b})`;
|
|
1005
|
+
break;
|
|
1006
|
+
case "hex":
|
|
1007
|
+
color = hslToHex(...Object.values(color)); //hsl to hex
|
|
1008
|
+
return color;
|
|
1009
|
+
break;
|
|
1010
|
+
case "rgbjson":
|
|
1011
|
+
case "rgb-json":
|
|
1012
|
+
case "rgb_json":
|
|
1013
|
+
color = hexToRGB(hslToHex(...Object.values(color))); //hsl to hex and hex to rgb_json
|
|
1014
|
+
return color;
|
|
1015
|
+
break;
|
|
1016
|
+
case "rgbarray":
|
|
1017
|
+
case "rgb-array":
|
|
1018
|
+
case "rgb_array":
|
|
1019
|
+
color = hexToRGB(hslToHex(...Object.values(color))); //hsl to hex, hex to rgb_json, and rgb_json to rgb_array
|
|
1020
|
+
return [color.r, color.g, color.b];
|
|
1021
|
+
break;
|
|
1022
|
+
//HSL cases
|
|
1023
|
+
case "hsl":
|
|
1024
|
+
//note: color was previously converted to {h, s, l}
|
|
1025
|
+
return `hsl(${color.h},${color.s}%,${color.l}%)`;
|
|
1026
|
+
break;
|
|
1027
|
+
case "hsljson":
|
|
1028
|
+
case "hsl-json":
|
|
1029
|
+
case "hsl_json":
|
|
1030
|
+
return color;
|
|
1031
|
+
break;
|
|
1032
|
+
case "hslarray":
|
|
1033
|
+
case "hsl-array":
|
|
1034
|
+
case "hsl_array":
|
|
1035
|
+
return [color.h, color.s, color.l];
|
|
1036
|
+
break;
|
|
1037
|
+
default:
|
|
1038
|
+
throw new Error("outputType must be \"rgb\", \"hex\", \"rgb_json\", \"rgb_array\", \"hsl\", \"hsl_json\", or \"hsl_array\"");
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
function changeSaturation(color,saturationChange,operationType="add",outputType="rgb",arrayType=null) {
|
|
1043
|
+
color = normalizeColorToHslObject(color,arrayType);
|
|
1044
|
+
//only {h,s,l} should exist now
|
|
1045
|
+
|
|
1046
|
+
//Math
|
|
1047
|
+
switch(operationType.toLowerCase()) {
|
|
1048
|
+
case "+":
|
|
1049
|
+
case "add":
|
|
1050
|
+
color.s += saturationChange;
|
|
1051
|
+
break;
|
|
1052
|
+
case "-":
|
|
1053
|
+
case "subtract":
|
|
1054
|
+
color.s -= saturationChange;
|
|
1055
|
+
break;
|
|
1056
|
+
case "*":
|
|
1057
|
+
case "x":
|
|
1058
|
+
case "×":
|
|
1059
|
+
case "multiply":
|
|
1060
|
+
color.s *= saturationChange;
|
|
1061
|
+
break;
|
|
1062
|
+
case "/":
|
|
1063
|
+
case "÷":
|
|
1064
|
+
case "divide":
|
|
1065
|
+
color.s /= saturationChange;
|
|
1066
|
+
break;
|
|
1067
|
+
case "=":
|
|
1068
|
+
case "set":
|
|
1069
|
+
color.s = saturationChange;
|
|
1070
|
+
break;
|
|
1071
|
+
case ">":
|
|
1072
|
+
case ">=":
|
|
1073
|
+
case "min": //lower-bounds the color
|
|
1074
|
+
color.s = Math.max(color.s,saturationChange); //math.max to bound it to the higher of the input number or the existing color
|
|
1075
|
+
break;
|
|
1076
|
+
case "<":
|
|
1077
|
+
case "<=":
|
|
1078
|
+
case "max": //upper-bounds the color
|
|
1079
|
+
color.s = Math.min(color.s,saturationChange); //math.min to bound it to the lower of the input number or the existing color
|
|
1080
|
+
break;
|
|
1081
|
+
default:
|
|
1082
|
+
throw new Error("Operation must be \"add\", \"subtract\", \"multiply\", \"divide\", \"set\", \"min\", or \"max\"");
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1085
|
+
color.h = Math.round(color.h % 360);
|
|
1086
|
+
color.s = Math.round(bound(color.s,0,100));
|
|
1087
|
+
color.l = Math.round(bound(color.l,0,100));
|
|
1088
|
+
|
|
1089
|
+
return convertHslObjects(color,outputType)
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
function changeLuminance(color,luminanceChange,operationType="add",outputType="rgb",arrayType=null) {
|
|
1093
|
+
color = normalizeColorToHslObject(color,arrayType);
|
|
1094
|
+
//only {h,s,l} should exist now
|
|
1095
|
+
|
|
1096
|
+
//Math
|
|
1097
|
+
switch(operationType.toLowerCase()) {
|
|
1098
|
+
case "+":
|
|
1099
|
+
case "add":
|
|
1100
|
+
color.l += luminanceChange;
|
|
1101
|
+
break;
|
|
1102
|
+
case "-":
|
|
1103
|
+
case "subtract":
|
|
1104
|
+
color.l -= luminanceChange;
|
|
1105
|
+
break;
|
|
1106
|
+
case "*":
|
|
1107
|
+
case "x":
|
|
1108
|
+
case "×":
|
|
1109
|
+
case "multiply":
|
|
1110
|
+
color.l *= luminanceChange;
|
|
1111
|
+
break;
|
|
1112
|
+
case "/":
|
|
1113
|
+
case "÷":
|
|
1114
|
+
case "divide":
|
|
1115
|
+
color.l /= luminanceChange;
|
|
1116
|
+
break;
|
|
1117
|
+
case "=":
|
|
1118
|
+
case "set":
|
|
1119
|
+
color.l = luminanceChange;
|
|
1120
|
+
break;
|
|
1121
|
+
case ">":
|
|
1122
|
+
case ">=":
|
|
1123
|
+
case "min":
|
|
1124
|
+
color.l = Math.max(color.l,luminanceChange);
|
|
1125
|
+
break;
|
|
1126
|
+
case "<":
|
|
1127
|
+
case "<=":
|
|
1128
|
+
case "max":
|
|
1129
|
+
color.l = Math.min(color.l,luminanceChange);
|
|
1130
|
+
break;
|
|
1131
|
+
default:
|
|
1132
|
+
throw new Error("Operation must be \"add\", \"subtract\", \"multiply\", \"divide\", \"set\", \"min\", or \"max\"");
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
color.h = Math.round(color.h % 360);
|
|
1136
|
+
color.s = Math.round(bound(color.s,0,100));
|
|
1137
|
+
color.l = Math.round(bound(color.l,0,100));
|
|
1138
|
+
|
|
1139
|
+
return convertHslObjects(color,outputType);
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1142
|
+
function changeHue(color,hueChange,operationType="add",outputType="rgb",arrayType=null) {
|
|
1143
|
+
color = normalizeColorToHslObject(color,arrayType);
|
|
1144
|
+
//only {h,s,l} should exist now
|
|
1145
|
+
|
|
1146
|
+
//Math
|
|
1147
|
+
switch(operationType.toLowerCase()) {
|
|
1148
|
+
case "+":
|
|
1149
|
+
case "add":
|
|
1150
|
+
color.h += hueChange;
|
|
1151
|
+
break;
|
|
1152
|
+
case "-":
|
|
1153
|
+
case "subtract":
|
|
1154
|
+
color.h -= hueChange;
|
|
1155
|
+
break;
|
|
1156
|
+
case "*":
|
|
1157
|
+
case "x":
|
|
1158
|
+
case "×":
|
|
1159
|
+
case "multiply":
|
|
1160
|
+
color.h *= hueChange;
|
|
1161
|
+
break;
|
|
1162
|
+
case "/":
|
|
1163
|
+
case "÷":
|
|
1164
|
+
case "divide":
|
|
1165
|
+
color.h /= hueChange;
|
|
1166
|
+
break;
|
|
1167
|
+
case "=":
|
|
1168
|
+
case "set":
|
|
1169
|
+
color.h = hueChange;
|
|
1170
|
+
break;
|
|
1171
|
+
case ">":
|
|
1172
|
+
case ">=":
|
|
1173
|
+
case "min":
|
|
1174
|
+
color.h = Math.max(color.h,hueChange);
|
|
1175
|
+
break;
|
|
1176
|
+
case "<":
|
|
1177
|
+
case "<=":
|
|
1178
|
+
case "max":
|
|
1179
|
+
color.h = Math.min(color.h,hueChange);
|
|
1180
|
+
break;
|
|
1181
|
+
default:
|
|
1182
|
+
throw new Error("Operation must be \"add\", \"subtract\", \"multiply\", \"divide\", \"set\", \"min\", or \"max\"");
|
|
1183
|
+
};
|
|
1184
|
+
|
|
1185
|
+
color.h = Math.round(color.h % 360);
|
|
1186
|
+
color.s = Math.round(bound(color.s,0,100));
|
|
1187
|
+
color.l = Math.round(bound(color.l,0,100));
|
|
1188
|
+
|
|
1189
|
+
return convertHslObjects(color,outputType);
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
function colorToHsl(color,outputType="rgb") {
|
|
1193
|
+
color = convertColorFormats(color,"rgb");
|
|
1194
|
+
color = rgbStringToHSL(color,outputType);
|
|
1195
|
+
return color;
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
//https://stackoverflow.com/questions/36721830/convert-hsl-to-rgb-and-hex
|
|
1199
|
+
function hslToHex(h, s, l) { //h, s, l params to hex triplet
|
|
1200
|
+
//console.log(`Hexing some HSLs (the HSLs are ${h},${s},${l})`)
|
|
1201
|
+
s = bound(s,0,100); //limit to 0-100
|
|
1202
|
+
l = bound(l,0,100);
|
|
1203
|
+
l /= 100;
|
|
1204
|
+
var a = s * Math.min(l, 1 - l) / 100;
|
|
1205
|
+
var f = n => {
|
|
1206
|
+
var k = (n + h / 30) % 12;
|
|
1207
|
+
var color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
1208
|
+
return Math.round(255 * color).toString(16).padStart(2, '0'); // convert to Hex and prefix "0" if needed
|
|
1209
|
+
};
|
|
1210
|
+
//console.log(`Hexed to #${f(0)}${f(8)}${f(4)}`)
|
|
1211
|
+
return `#${f(0)}${f(8)}${f(4)}`;
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
libraryLoaded = true;
|
|
1215
|
+
this.libraryLoaded = true;
|
|
1216
|
+
window.libraryLoaded = true;
|
|
1217
|
+
|
|
1218
|
+
//Pixels
|
|
1219
|
+
|
|
1220
|
+
function exposedToAir(pixel) {
|
|
1221
|
+
return (isEmpty(pixel.x+1,pixel.y) || isEmpty(pixel.x-1,pixel.y) || isEmpty(pixel.x,pixel.y+1) || isEmpty(pixel.x,pixel.y-1));
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1224
|
+
function tryTarnish(pixel,element,chance) {
|
|
1225
|
+
if(exposedToAir(pixel)) {
|
|
1226
|
+
if(Array.isArray(element)) {
|
|
1227
|
+
if(Math.random() < chance) {
|
|
1228
|
+
changePixel(pixel,randomChoice(element));
|
|
1229
|
+
};
|
|
1230
|
+
} else {
|
|
1231
|
+
if(Math.random() < chance) {
|
|
1232
|
+
changePixel(pixel,element);
|
|
1233
|
+
};
|
|
1234
|
+
};
|
|
1235
|
+
};
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
//Try to create a pixel, return true if it could be created and false if it couldn't
|
|
1239
|
+
function tryCreatePixel(elementInput,x,y) {
|
|
1240
|
+
//array handling
|
|
1241
|
+
if(elementInput.includes(",")) { //CSTA
|
|
1242
|
+
elementInput = elementInput.split(",");
|
|
1243
|
+
};
|
|
1244
|
+
if(Array.isArray(elementInput)) { //if element list
|
|
1245
|
+
elementInput = elementInput.filter(function(e) {
|
|
1246
|
+
return elementExists(e);
|
|
1247
|
+
});
|
|
1248
|
+
if(elementInput.length === 0) { throw new Error("elementInput has no existing elements") };
|
|
1249
|
+
elementInput = randomChoice(elementInput);
|
|
1250
|
+
};
|
|
1251
|
+
|
|
1252
|
+
//existence check
|
|
1253
|
+
if(!elementExists(elementInput)) {
|
|
1254
|
+
throw new Error("Element " + elementInput + " doesn't exist!");
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
//actual creation check
|
|
1258
|
+
if(isEmpty(x,y)) {
|
|
1259
|
+
createPixel(elementInput,x,y);
|
|
1260
|
+
return true;
|
|
1261
|
+
} else {
|
|
1262
|
+
return false;
|
|
1263
|
+
};
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1266
|
+
function tryCreatePixelReturn(elementInput,x,y) {
|
|
1267
|
+
//array handling
|
|
1268
|
+
if(elementInput.includes(",")) { //CSTA
|
|
1269
|
+
elementInput = elementInput.split(",");
|
|
1270
|
+
};
|
|
1271
|
+
if(Array.isArray(elementInput)) { //if element list
|
|
1272
|
+
elementInput = elementInput.filter(function(e) {
|
|
1273
|
+
return elementExists(e);
|
|
1274
|
+
});
|
|
1275
|
+
if(elementInput.length === 0) { throw new Error("elementInput has no existing elements") };
|
|
1276
|
+
elementInput = randomChoice(elementInput);
|
|
1277
|
+
};
|
|
1278
|
+
|
|
1279
|
+
//existence check
|
|
1280
|
+
if(!elementExists(elementInput)) {
|
|
1281
|
+
throw new Error("Element " + elementInput + " doesn't exist!");
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
//actual creation check
|
|
1285
|
+
if(isEmpty(x,y)) {
|
|
1286
|
+
return createPixelReturn(elementInput,x,y);
|
|
1287
|
+
} else {
|
|
1288
|
+
return false;
|
|
1289
|
+
};
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
function createPixelReturn(element,x,y) { //sugar
|
|
1293
|
+
var newPixel = new Pixel(x, y, element);
|
|
1294
|
+
currentPixels.push(newPixel);
|
|
1295
|
+
checkUnlock(element);
|
|
1296
|
+
return newPixel;
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
function changePixelReturn(pixel,element,changetemp=true) {
|
|
1300
|
+
pixel.element = element;
|
|
1301
|
+
pixel.color = pixelColorPick(pixel);
|
|
1302
|
+
pixel.start = pixelTicks;
|
|
1303
|
+
var elementInfo = elements[element];
|
|
1304
|
+
if (elementInfo.burning == true) {
|
|
1305
|
+
pixel.burning = true;
|
|
1306
|
+
pixel.burnStart = pixelTicks;
|
|
1307
|
+
}
|
|
1308
|
+
else if (pixel.burning && !elementInfo.burn) {
|
|
1309
|
+
delete pixel.burning;
|
|
1310
|
+
delete pixel.burnStart;
|
|
1311
|
+
}
|
|
1312
|
+
delete pixel.origColor; // remove stain
|
|
1313
|
+
if (pixel.r && !elementInfo.rotatable) {
|
|
1314
|
+
delete pixel.r;
|
|
1315
|
+
}
|
|
1316
|
+
if (pixel.flipX && !elementInfo.flippableX) {
|
|
1317
|
+
delete pixel.flipX;
|
|
1318
|
+
}
|
|
1319
|
+
if (pixel.flipY && !elementInfo.flippableY) {
|
|
1320
|
+
delete pixel.flipY;
|
|
1321
|
+
}
|
|
1322
|
+
// If elementInfo.flippableX, set it to true or false randomly
|
|
1323
|
+
if (elementInfo.flipX !== undefined) { pixel.flipX = elementInfo.flipX }
|
|
1324
|
+
else if (elementInfo.flippableX) {
|
|
1325
|
+
pixel.flipX = Math.random() >= 0.5;
|
|
1326
|
+
}
|
|
1327
|
+
// If elementInfo.flippableY, set it to true or false randomly
|
|
1328
|
+
if (elementInfo.flipY !== undefined) { pixel.flipY = elementInfo.flipY }
|
|
1329
|
+
else if (elementInfo.flippableY) {
|
|
1330
|
+
pixel.flipY = Math.random() >= 0.5;
|
|
1331
|
+
}
|
|
1332
|
+
if (elementInfo.temp != undefined && changetemp) {
|
|
1333
|
+
pixel.temp = elementInfo.temp;
|
|
1334
|
+
pixelTempCheck(pixel)
|
|
1335
|
+
}
|
|
1336
|
+
// If elementInfo.properties, set each key to its value
|
|
1337
|
+
if (elementInfo.properties !== undefined) {
|
|
1338
|
+
for (var key in elementInfo.properties) {
|
|
1339
|
+
// If it is an array or object, make a copy of it
|
|
1340
|
+
if (typeof elementInfo.properties[key] == "object") {
|
|
1341
|
+
pixel[key] = JSON.parse(JSON.stringify(elementInfo.properties[key]));
|
|
1342
|
+
}
|
|
1343
|
+
else {
|
|
1344
|
+
pixel[key] = elementInfo.properties[key];
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
checkUnlock(element);
|
|
1349
|
+
return pixel;
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
function storeFirstTouchingElement(pixel,propertyName,copyTemp=true,spread=true) {
|
|
1353
|
+
var info = elements[pixel.element];
|
|
1354
|
+
if(pixel[propertyName]) {
|
|
1355
|
+
return false;
|
|
1356
|
+
};
|
|
1357
|
+
for(i = 0; i < adjacentCoords.length; i++) {
|
|
1358
|
+
var newCoords = {x: pixel.x+adjacentCoords[i][0], y: pixel.y+adjacentCoords[i][1]};
|
|
1359
|
+
|
|
1360
|
+
if (!isEmpty(newCoords.x,newCoords.y,true)) {
|
|
1361
|
+
newPixel = pixelMap[newCoords.x][newCoords.y];
|
|
1362
|
+
if (info.ignore && info.ignore.indexOf(newPixel.element) !== -1) {
|
|
1363
|
+
continue;
|
|
1364
|
+
};
|
|
1365
|
+
if (newPixel.element != pixel.element && newPixel.element != "wire") {
|
|
1366
|
+
pixel[propertyName] = newPixel.element;
|
|
1367
|
+
if(copyTemp) { pixel.temp = newPixel.temp };
|
|
1368
|
+
return newPixel.element;
|
|
1369
|
+
}
|
|
1370
|
+
else if (newPixel[propertyName] && spread) {
|
|
1371
|
+
pixel[propertyName] = newPixel[propertyName];
|
|
1372
|
+
pixel.temp = newPixel.temp;
|
|
1373
|
+
return newPixel[propertyName];
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
};
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
function breakPixel(pixel,changetemp=false) {
|
|
1380
|
+
var info = elements[pixel.element];
|
|
1381
|
+
if(typeof(info.breakInto) === "undefined") {
|
|
1382
|
+
return false;
|
|
1383
|
+
};
|
|
1384
|
+
var breakIntoElement = info.breakInto;
|
|
1385
|
+
if(Array.isArray(breakIntoElement)) {
|
|
1386
|
+
breakIntoElement = breakIntoElement[Math.floor(Math.random() * breakIntoElement.length)]
|
|
1387
|
+
};
|
|
1388
|
+
var result = breakIntoElement;
|
|
1389
|
+
// change the pixel to the result
|
|
1390
|
+
if (result === null) {
|
|
1391
|
+
deletePixel(pixel.x,pixel.y);
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
if (elements[pixel.element].breakIntoColor) {
|
|
1395
|
+
var oldelement = pixel.element;
|
|
1396
|
+
changePixel(pixel,result,changetemp);
|
|
1397
|
+
pixel.color = pixelColorPick(pixel, elements[oldelement].breakIntoColor);
|
|
1398
|
+
}
|
|
1399
|
+
else {
|
|
1400
|
+
changePixel(pixel,result,changetemp);
|
|
1401
|
+
}
|
|
1402
|
+
};
|
|
1403
|
+
|
|
1404
|
+
function tryBreak(pixel,changetemp=false,defaultBreakIntoDust=false) {
|
|
1405
|
+
var info = elements[pixel.element];
|
|
1406
|
+
var hardness = defaultHardness;
|
|
1407
|
+
if(typeof(info.hardness) === "number") {
|
|
1408
|
+
hardness = info.hardness;
|
|
1409
|
+
};
|
|
1410
|
+
hardness = 1 - hardness; //invert hardness, so a hardness of 0 becomes a 100% chance and a hardness of 1 becomes a 0% chance
|
|
1411
|
+
if(Math.random() < hardness) {
|
|
1412
|
+
return breakPixel(pixel,changetemp=false,defaultBreakIntoDust=false);
|
|
1413
|
+
} else {
|
|
1414
|
+
return false;
|
|
1415
|
+
};
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
function reactionStealer(pixel,newPixel,reactionTarget) {
|
|
1419
|
+
if(!elements[reactionTarget]) {
|
|
1420
|
+
throw new Error(`No such element ${reactionTarget}!`);
|
|
1421
|
+
};
|
|
1422
|
+
if(typeof(newPixel) === "undefined") { //timing issue?
|
|
1423
|
+
return false;
|
|
1424
|
+
};
|
|
1425
|
+
var newElement = newPixel.element;
|
|
1426
|
+
var newInfo = elements[newElement];
|
|
1427
|
+
if(typeof(newInfo.reactions) === "undefined") {
|
|
1428
|
+
return false;
|
|
1429
|
+
};
|
|
1430
|
+
if(typeof(newInfo.reactions[reactionTarget]) === "undefined") {
|
|
1431
|
+
return false;
|
|
1432
|
+
};
|
|
1433
|
+
var pixel2 = pixel;
|
|
1434
|
+
var pixel1 = newPixel;
|
|
1435
|
+
var r = newInfo.reactions[reactionTarget];
|
|
1436
|
+
|
|
1437
|
+
if (r.setting && settings[r.setting]===0) {
|
|
1438
|
+
return false;
|
|
1439
|
+
}
|
|
1440
|
+
// r has the attribute "y" which is a range between two y values
|
|
1441
|
+
// r.y example: [10,30]
|
|
1442
|
+
// return false if y is defined and pixel1's y is not in the range
|
|
1443
|
+
if (r.tempMin !== undefined && pixel1.temp < r.tempMin) {
|
|
1444
|
+
return false;
|
|
1445
|
+
}
|
|
1446
|
+
if (r.tempMax !== undefined && pixel1.temp > r.tempMax) {
|
|
1447
|
+
return false;
|
|
1448
|
+
}
|
|
1449
|
+
if (r.charged && !pixel.charge) {
|
|
1450
|
+
return false;
|
|
1451
|
+
}
|
|
1452
|
+
if (r.chance !== undefined && Math.random() > r.chance) {
|
|
1453
|
+
return false;
|
|
1454
|
+
}
|
|
1455
|
+
if (r.y !== undefined && (pixel1.y < r.y[0] || pixel1.y > r.y[1])) {
|
|
1456
|
+
return false;
|
|
1457
|
+
}
|
|
1458
|
+
if (r.elem1 !== undefined) {
|
|
1459
|
+
// if r.elem1 is an array, set elem1 to a random element from the array, otherwise set it to r.elem1
|
|
1460
|
+
if (Array.isArray(r.elem1)) {
|
|
1461
|
+
var elem1 = r.elem1[Math.floor(Math.random() * r.elem1.length)];
|
|
1462
|
+
} else { var elem1 = r.elem1; }
|
|
1463
|
+
|
|
1464
|
+
if (elem1 == null) {
|
|
1465
|
+
deletePixel(pixel1.x,pixel1.y);
|
|
1466
|
+
}
|
|
1467
|
+
else {
|
|
1468
|
+
changePixel(pixel1,elem1);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
if (r.charge1) { pixel1.charge = r.charge1; }
|
|
1472
|
+
if (r.temp1) { pixel1.temp += r.temp1; pixelTempCheck(pixel1); }
|
|
1473
|
+
if (r.color1) { // if it's a list, use a random color from the list, else use the color1 attribute
|
|
1474
|
+
pixel1.color = pixelColorPick(pixel1, Array.isArray(r.color1) ? r.color1[Math.floor(Math.random() * r.color1.length)] : r.color1);
|
|
1475
|
+
}
|
|
1476
|
+
if (r.attr1) { // add each attribute to pixel1
|
|
1477
|
+
for (var key in r.attr1) {
|
|
1478
|
+
pixel1[key] = r.attr1[key];
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
if (r.elem2 !== undefined) {
|
|
1482
|
+
// if r.elem2 is an array, set elem2 to a random element from the array, otherwise set it to r.elem2
|
|
1483
|
+
if (Array.isArray(r.elem2)) {
|
|
1484
|
+
var elem2 = r.elem2[Math.floor(Math.random() * r.elem2.length)];
|
|
1485
|
+
} else { var elem2 = r.elem2; }
|
|
1486
|
+
|
|
1487
|
+
if (elem2 == null) {
|
|
1488
|
+
deletePixel(pixel2.x,pixel2.y);
|
|
1489
|
+
}
|
|
1490
|
+
else {
|
|
1491
|
+
changePixel(pixel2,elem2);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
if (r.charge2) { pixel2.charge = r.charge2; }
|
|
1495
|
+
if (r.temp2) { pixel2.temp += r.temp2; pixelTempCheck(pixel2); }
|
|
1496
|
+
if (r.color2) { // if it's a list, use a random color from the list, else use the color2 attribute
|
|
1497
|
+
pixel2.color = pixelColorPick(pixel2, Array.isArray(r.color2) ? r.color2[Math.floor(Math.random() * r.color2.length)] : r.color2);
|
|
1498
|
+
}
|
|
1499
|
+
if (r.attr2) { // add each attribute to pixel2
|
|
1500
|
+
for (var key in r.attr2) {
|
|
1501
|
+
pixel2[key] = r.attr2[key];
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
if (r.func) { r.func(pixel1,pixel2); }
|
|
1505
|
+
return r.elem1!==undefined || r.elem2!==undefined;
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1508
|
+
function spreadingProperty(pixel,propertyName,whitelist=null) {
|
|
1509
|
+
if(isNaN(pixel[propertyName])) {
|
|
1510
|
+
pixel[propertyName] = 0;
|
|
1511
|
+
};
|
|
1512
|
+
var randomNeighborOffset = adjacentCoords[Math.floor(Math.random() * adjacentCoords.length)];
|
|
1513
|
+
var rX = randomNeighborOffset[0];
|
|
1514
|
+
var rY = randomNeighborOffset[1];
|
|
1515
|
+
var rfX = pixel.x+rX;
|
|
1516
|
+
var rfY = pixel.y+rY;
|
|
1517
|
+
if(!isEmpty(rfX,rfY,true)) {
|
|
1518
|
+
if(!pixelMap[rfX]) {
|
|
1519
|
+
return false;
|
|
1520
|
+
};
|
|
1521
|
+
var rOtherPixel = pixelMap[rfX][rfY];
|
|
1522
|
+
var rOtherElement = rOtherPixel.element;
|
|
1523
|
+
if(whitelist === null || (whitelist !== null && whitelist.includes(rOtherElement))) {
|
|
1524
|
+
if(typeof(rOtherPixel) === "undefined" || isEmpty(rfX,rfY,true)) {
|
|
1525
|
+
return false;
|
|
1526
|
+
};
|
|
1527
|
+
if(isNaN(pixel[propertyName])) { //should include undefined
|
|
1528
|
+
pixel[propertyName] = 0;
|
|
1529
|
+
};
|
|
1530
|
+
var averageValue = (pixel[propertyName] + rOtherPixel[propertyName]) / 2;
|
|
1531
|
+
pixel[propertyName] = averageValue;
|
|
1532
|
+
rOtherPixel[propertyName] = averageValue;
|
|
1533
|
+
};
|
|
1534
|
+
};
|
|
1535
|
+
return true;
|
|
1536
|
+
};
|
|
1537
|
+
|
|
1538
|
+
function spreadingPropertyReturn(pixel,propertyName,whitelist=null) {
|
|
1539
|
+
if(isNaN(pixel[propertyName])) {
|
|
1540
|
+
pixel[propertyName] = 0;
|
|
1541
|
+
};
|
|
1542
|
+
var recipients = []; //will never be more than one but done with [] for forEach
|
|
1543
|
+
var randomNeighborOffset = adjacentCoords[Math.floor(Math.random() * adjacentCoords.length)];
|
|
1544
|
+
var rX = randomNeighborOffset[0];
|
|
1545
|
+
var rY = randomNeighborOffset[1];
|
|
1546
|
+
var rfX = pixel.x+rX;
|
|
1547
|
+
var rfY = pixel.y+rY;
|
|
1548
|
+
if(!isEmpty(rfX,rfY,true)) {
|
|
1549
|
+
if(!pixelMap[rfX]) {
|
|
1550
|
+
return [];
|
|
1551
|
+
};
|
|
1552
|
+
var rOtherPixel = pixelMap[rfX][rfY];
|
|
1553
|
+
var rOtherElement = rOtherPixel.element;
|
|
1554
|
+
if(whitelist === null || (whitelist !== null && whitelist.includes(rOtherElement))) {
|
|
1555
|
+
if(typeof(rOtherPixel) === "undefined" || isEmpty(rfX,rfY,true)) {
|
|
1556
|
+
return [];
|
|
1557
|
+
};
|
|
1558
|
+
if(isNaN(pixel[propertyName])) { //should include undefined
|
|
1559
|
+
pixel[propertyName] = 0;
|
|
1560
|
+
};
|
|
1561
|
+
var averageValue = (pixel[propertyName] + rOtherPixel[propertyName]) / 2;
|
|
1562
|
+
pixel[propertyName] = averageValue;
|
|
1563
|
+
rOtherPixel[propertyName] = averageValue;
|
|
1564
|
+
recipients.push(rOtherPixel);
|
|
1565
|
+
};
|
|
1566
|
+
};
|
|
1567
|
+
return recipients;
|
|
1568
|
+
};
|
|
1569
|
+
|
|
1570
|
+
function swapNumericPropertyValues(pixel1,pixel2,propertyName,whitelist=null) {
|
|
1571
|
+
if(!pixel1 || !pixel2) {
|
|
1572
|
+
return false;
|
|
1573
|
+
};
|
|
1574
|
+
if(isNaN(pixel1[propertyName])) {
|
|
1575
|
+
pixel1[propertyName] = 0;
|
|
1576
|
+
};
|
|
1577
|
+
if(isNaN(pixel2[propertyName])) {
|
|
1578
|
+
pixel2[propertyName] = 0;
|
|
1579
|
+
};
|
|
1580
|
+
if(whitelist === null || (whitelist !== null && whitelist.includes(pixel1.element) && whitelist.includes(pixel2.element))) {
|
|
1581
|
+
var temp1 = pixel1[propertyName];
|
|
1582
|
+
pixel1[propertyName] = pixel2[propertyName];
|
|
1583
|
+
pixel2[propertyName] = temp1;
|
|
1584
|
+
};
|
|
1585
|
+
return true;
|
|
1586
|
+
};
|
|
1587
|
+
|
|
1588
|
+
libraryLoaded = true;
|
|
1589
|
+
this.libraryLoaded = true;
|
|
1590
|
+
window.libraryLoaded = true;
|
|
1591
|
+
|
|
1592
|
+
//World
|
|
1593
|
+
|
|
1594
|
+
function breakCircle(x,y,radius,respectHardness=false,changeTemp=false,defaultBreakIntoDust=false) {
|
|
1595
|
+
var coords = circleCoords(x,y,radius);
|
|
1596
|
+
for(i = 0; i < coords.length; i++) {
|
|
1597
|
+
coordX = coords[i].x;
|
|
1598
|
+
coordY = coords[i].y;
|
|
1599
|
+
if(!isEmpty(coordX,coordY,true)) {
|
|
1600
|
+
var pixel = pixelMap[coordX][coordY];
|
|
1601
|
+
respectHardness ? tryBreak(pixel,changeTemp,defaultBreakIntoDust) : breakPixel(pixel,changeTemp,defaultBreakIntoDust);
|
|
1602
|
+
};
|
|
1603
|
+
};
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
function fillCircle(element,x,y,radius,overwrite=false) {
|
|
1607
|
+
var coords = circleCoords(x,y,radius);
|
|
1608
|
+
var newElement = element;
|
|
1609
|
+
if(Array.isArray(newElement)) {
|
|
1610
|
+
newElement = newElement[Math.floor(Math.random() * newElement.length)];
|
|
1611
|
+
};
|
|
1612
|
+
for(i = 0; i < coords.length; i++) {
|
|
1613
|
+
coordX = Math.round(coords[i].x);
|
|
1614
|
+
coordY = Math.round(coords[i].y);
|
|
1615
|
+
if(overwrite && !isEmpty(coordX,coordY,true)) {
|
|
1616
|
+
changePixel(pixelMap[coordX][coordY],element);
|
|
1617
|
+
};
|
|
1618
|
+
if(isEmpty(coordX,coordY,false)) {
|
|
1619
|
+
createPixel(element,coordX,coordY);
|
|
1620
|
+
};
|
|
1621
|
+
};
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1624
|
+
function fillCircleReturn(element,x,y,radius,overwrite=false) {
|
|
1625
|
+
//console.log("fcr");
|
|
1626
|
+
var pixels = [];
|
|
1627
|
+
//console.log("pixels initted");
|
|
1628
|
+
var coords = circleCoords(x,y,radius);
|
|
1629
|
+
//console.log("coords gotten");
|
|
1630
|
+
var newElement = element;
|
|
1631
|
+
//console.log("element processing");
|
|
1632
|
+
if(Array.isArray(newElement)) {
|
|
1633
|
+
newElement = newElement[Math.floor(Math.random() * newElement.length)];
|
|
1634
|
+
};
|
|
1635
|
+
//console.log("element processed");
|
|
1636
|
+
for(i = 0; i < coords.length; i++) {
|
|
1637
|
+
//console.log("iterator through spots: " + i);
|
|
1638
|
+
coordX = Math.round(coords[i].x);
|
|
1639
|
+
coordY = Math.round(coords[i].y);
|
|
1640
|
+
//console.log(`coord: (${coords[i].x},${coords[i].y})`);
|
|
1641
|
+
if(overwrite && !isEmpty(coordX,coordY,true)) {
|
|
1642
|
+
//console.log("replaced pixel");
|
|
1643
|
+
pixels.push(changePixelReturn(pixelMap[coordX][coordY],newElement));
|
|
1644
|
+
};
|
|
1645
|
+
if(isEmpty(coordX,coordY,false)) {
|
|
1646
|
+
//console.log("created pixel");
|
|
1647
|
+
pixels.push(createPixelReturn(newElement,coordX,coordY));
|
|
1648
|
+
};
|
|
1649
|
+
};
|
|
1650
|
+
//console.log("fcr finished");
|
|
1651
|
+
//console.log(pixels.map(x => x.element));
|
|
1652
|
+
return pixels;
|
|
1653
|
+
};
|
|
1654
|
+
|
|
1655
|
+
function isOpenAndOnSurface(x,y,includeBottomBound=true) {
|
|
1656
|
+
if(!isEmpty(x,y,false)) {
|
|
1657
|
+
return false;
|
|
1658
|
+
};
|
|
1659
|
+
if(y + 1 == height) {
|
|
1660
|
+
return includeBottomBound;
|
|
1661
|
+
};
|
|
1662
|
+
return !isEmpty(x,y+1,true);
|
|
1663
|
+
};
|
|
1664
|
+
|
|
1665
|
+
//Freeze pixel
|
|
1666
|
+
function freezePixel(pixel,changetemp=true) {
|
|
1667
|
+
var info = elements[pixel.element];
|
|
1668
|
+
var result = info.stateLow;
|
|
1669
|
+
if (!result) {
|
|
1670
|
+
return false
|
|
1671
|
+
};
|
|
1672
|
+
if(result instanceof Array) {
|
|
1673
|
+
result = result.filter(elementExists);
|
|
1674
|
+
if(result.length == 0) {
|
|
1675
|
+
return false;
|
|
1676
|
+
};
|
|
1677
|
+
} else {
|
|
1678
|
+
if(!(elementExists(result))) {
|
|
1679
|
+
return false;
|
|
1680
|
+
};
|
|
1681
|
+
};
|
|
1682
|
+
|
|
1683
|
+
while(result instanceof Array) {
|
|
1684
|
+
result = randomChoice(result);
|
|
1685
|
+
};
|
|
1686
|
+
|
|
1687
|
+
changePixel(pixel,result,changetemp);
|
|
1688
|
+
return true;
|
|
1689
|
+
};
|
|
1690
|
+
|
|
1691
|
+
libraryLoaded = true;
|
|
1692
|
+
this.libraryLoaded = true;
|
|
1693
|
+
window.libraryLoaded = true;
|
|
1694
|
+
|
|
1695
|
+
//Logic
|
|
1696
|
+
|
|
1697
|
+
function xor(c1,c2) {
|
|
1698
|
+
if(!!c1 && !c2) {
|
|
1699
|
+
return true;
|
|
1700
|
+
} else if(!c1 && !!c2) {
|
|
1701
|
+
return true;
|
|
1702
|
+
} else {
|
|
1703
|
+
return false;
|
|
1704
|
+
};
|
|
1705
|
+
};
|
|
1706
|
+
|
|
1707
|
+
libraryLoaded = true;
|
|
1708
|
+
this.libraryLoaded = true;
|
|
1709
|
+
window.libraryLoaded = true;
|
|
1710
|
+
|
|
1711
|
+
//currentPixels operations
|
|
1712
|
+
|
|
1713
|
+
function findInCurrentPixels(x,y) {
|
|
1714
|
+
var pixel = currentPixels.filter(function(pixelObject) {
|
|
1715
|
+
return pixelObject.x == x && pixelObject.y == y;
|
|
1716
|
+
});
|
|
1717
|
+
if(pixel.length <= 0) {
|
|
1718
|
+
return undefined;
|
|
1719
|
+
};
|
|
1720
|
+
if(pixel.length > 1) {
|
|
1721
|
+
pixel.length = 1;
|
|
1722
|
+
};
|
|
1723
|
+
pixel = pixel[0];
|
|
1724
|
+
return pixel;
|
|
1725
|
+
};
|
|
1726
|
+
|
|
1727
|
+
function filterCurrentPixels(filterFunction) {
|
|
1728
|
+
return currentPixels.filter(filterFunction);
|
|
1729
|
+
};
|
|
1730
|
+
|
|
1731
|
+
//Filter test functions
|
|
1732
|
+
|
|
1733
|
+
function _filterTest_xIsTwenty(pixel) {
|
|
1734
|
+
return pixel.x == 20;
|
|
1735
|
+
};
|
|
1736
|
+
|
|
1737
|
+
function _filterTest_tempIsOdd(pixel) {
|
|
1738
|
+
return Math.trunc(pixel.temp) % 2 == 1;
|
|
1739
|
+
};
|
|
1740
|
+
|
|
1741
|
+
function _filterTest_redRock(pixel) {
|
|
1742
|
+
if(typeof(convertColorFormats) === "undefined") {
|
|
1743
|
+
throw new Error("code_library.js is required!");
|
|
1744
|
+
};
|
|
1745
|
+
var color = rgbStringToHSL(convertColorFormats(pixel.color,"rgb"),"json");
|
|
1746
|
+
var isRed = ((color.h % 360) >= 350) || ((color.h % 360) <= 10);
|
|
1747
|
+
var isVivid = (color.s > 30);
|
|
1748
|
+
var isBright = (color.l > 20);
|
|
1749
|
+
return isRed && isVivid && isBright;
|
|
1750
|
+
};
|
|
1751
|
+
|
|
1752
|
+
//Ghost pixel repair function
|
|
1753
|
+
function rebuildCurrentPixels() {
|
|
1754
|
+
var currPix = []; //rebuild currentPixels from pixelMap to try to fix bug
|
|
1755
|
+
for(pmi = 0; pmi < pixelMap.length; pmi++) {
|
|
1756
|
+
var pixelMapPart = pixelMap[pmi];
|
|
1757
|
+
for(pmj = 0; pmj < pixelMapPart.length; pmj++) {
|
|
1758
|
+
var pixelMapUnit = pixelMapPart[pmj];
|
|
1759
|
+
if(typeof(pixelMapUnit) === "object") {
|
|
1760
|
+
if(pixelMapUnit !== null) {
|
|
1761
|
+
currPix.push(pixelMapUnit);
|
|
1762
|
+
};
|
|
1763
|
+
};
|
|
1764
|
+
};
|
|
1765
|
+
};
|
|
1766
|
+
currentPixels = currPix;
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
libraryLoaded = true;
|
|
1771
|
+
this.libraryLoaded = true;
|
|
1772
|
+
window.libraryLoaded = true;
|
|
1773
|
+
|
|
1774
|
+
//Sugar functions
|
|
1775
|
+
|
|
1776
|
+
function newElement(name="element_name",color="#FF00FF",otherProps={}) {
|
|
1777
|
+
elements[name] = {
|
|
1778
|
+
color: color,
|
|
1779
|
+
};
|
|
1780
|
+
for(property in otherProps) {
|
|
1781
|
+
elements[name][property] = otherProps[property];
|
|
1782
|
+
};
|
|
1783
|
+
return elements[name];
|
|
1784
|
+
};
|
|
1785
|
+
|
|
1786
|
+
libraryLoaded = true;
|
|
1787
|
+
this.libraryLoaded = true;
|
|
1788
|
+
window.libraryLoaded = true;
|
|
1789
|
+
|
|
1790
|
+
//Fixes
|
|
1791
|
+
|
|
1792
|
+
//fix -1-caused ghost pixels
|
|
1793
|
+
function deletePixel(x,y) {
|
|
1794
|
+
// remove pixelMap[x][y] from currentPixels
|
|
1795
|
+
var pixelIndex = currentPixels.indexOf(pixelMap[x][y]);
|
|
1796
|
+
if(pixelIndex !== -1) {
|
|
1797
|
+
currentPixels.splice(pixelIndex,1)
|
|
1798
|
+
};
|
|
1799
|
+
if (pixelMap[x][y]) {pixelMap[x][y].del = true}
|
|
1800
|
+
delete pixelMap[x][y];
|
|
1801
|
+
/*for (var i = 0; i < currentPixels.length; i++) {
|
|
1802
|
+
if (currentPixels[i].x == x && currentPixels[i].y == y) {
|
|
1803
|
+
currentPixels.splice(i, 1);
|
|
1804
|
+
break;
|
|
1805
|
+
}
|
|
1806
|
+
}*/
|
|
1807
|
+
/*if (id != null) {
|
|
1808
|
+
for (var i = 0; i < currentPixels.length; i++) {
|
|
1809
|
+
if (currentPixels[i].id == id) {
|
|
1810
|
+
currentPixels.splice(i, 1);
|
|
1811
|
+
return;
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
}*/
|
|
1815
|
+
};
|
|
1816
|
+
|
|
1817
|
+
libraryLoaded = true;
|
|
1818
|
+
this.libraryLoaded = true;
|
|
1819
|
+
window.libraryLoaded = true;
|
|
1820
|
+
|
|
1821
|
+
runAfterLoad(function() {
|
|
1822
|
+
if(!libraryLoaded) {
|
|
1823
|
+
libraryLoaded = true;
|
|
1824
|
+
this.libraryLoaded = true;
|
|
1825
|
+
window.libraryLoaded = true
|
|
1826
|
+
}
|
|
1827
|
+
})
|