Merge branch 'R74nCom:main' into main

This commit is contained in:
JustAGenericUsername 2024-07-02 12:21:27 -04:00 committed by GitHub
commit bc8bfaae6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 1919 additions and 737 deletions

View File

@ -14726,13 +14726,13 @@ behaviorRules = {
stats += "<span id='stat-burning' class='stat'>Burning</span>"; stats += "<span id='stat-burning' class='stat'>Burning</span>";
} }
if (elements[currentPixel.element].hoverStat) { if (elements[currentPixel.element].hoverStat) {
stats += "<span id='stat-hover' class='stat'>"+elements[currentPixel.element].hoverStat(currentPixel)+"</span>"; stats += "<span id='stat-hover' class='stat'>"+elements[currentPixel.element].hoverStat(currentPixel).replaceAll("<","&lt;")+"</span>";
} }
else if (currentPixel.clone) { else if (currentPixel.clone) {
stats += "<span id='stat-clone' class='stat'>"+currentPixel.clone.toUpperCase()+"</span>"; stats += "<span id='stat-clone' class='stat'>"+currentPixel.clone.toUpperCase().replaceAll("<","&lt;")+"</span>";
} }
else if (currentPixel.con && currentPixel.con.element) { else if (currentPixel.con && currentPixel.con.element) {
stats += "<span id='stat-clone' class='stat'>"+currentPixel.con.element.toUpperCase()+"</span>"; stats += "<span id='stat-clone' class='stat'>"+currentPixel.con.element.toUpperCase().replaceAll("<","&lt;")+"</span>";
} }
} }
} }
@ -16459,7 +16459,7 @@ window.onload = function() {
<div id="categoryControls"></div> <div id="categoryControls"></div>
<div id="elementControls"></div> <div id="elementControls"></div>
</div> </div>
<div id="extraInfo"><small><a href="https://sandboxels.r74n.com/changelog" id="changelogButton" target="_blank">Changelog</a><a href="https://sandboxels.R74n.com/feedback" target="_blank" style="color:lime;">Feedback</a><a href="https://sandboxels.wiki.gg/" target="_blank" id="wikiButton" title="Official Sandboxels Wiki - wiki.gg" style="color:white;">Wiki</a><a id="moreSocial" href="https://twitter.com/R74nCom" rel="me" target="_blank">Twitter</a><a href="https://discord.gg/ejUc6YPQuS" target="_blank" style="color:#2f60ff;">Discord</a><span id="install-button" style="display:none">&nbsp;<a onclick="deferredPrompt.prompt(); return false" href="#" style="text-shadow: 0px 2px 10px #ff00ff; cursor:pointer">Install Offline</a></span><!--<br><br><a style="color:lime" target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLSf8pVMSdC6oSnBSaTpzjPQa8Ef-vxG_eXL99UITnMSQtJFTJA/viewform?usp=sf_link">FILL OUT THE CENSUS<span style="color:red">(NEW)</span></a>--></small></div> <div id="extraInfo"><small><a href="https://sandboxels.r74n.com/changelog" id="changelogButton" target="_blank">Changelog</a><a href="https://sandboxels.R74n.com/feedback" target="_blank" style="color:lime;">Feedback</a><a href="https://sandboxels.wiki.gg/" target="_blank" id="wikiButton" title="Official Sandboxels Wiki - wiki.gg" style="color:white;">Wiki</a><a id="moreSocial" href="https://twitter.com/R74nCom" rel="me" target="_blank">Twitter</a><a href="https://discord.gg/ejUc6YPQuS" target="_blank" style="color:#2f60ff;">Discord</a><span id="install-button" style="display:none">&nbsp;<a onclick="deferredPrompt.prompt(); return false" href="#" style="text-shadow: 0px 2px 10px #ff00ff; cursor:pointer">Install Offline</a></span><br><br><a style="color:lime" target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLSeYMbngtbBHZ7hkz8jpbHl7TiAItqukrhtntKgAHjH30fY08A/viewform?usp=sf_link">FILL OUT THE CENSUS<span style="color:red">(NEW)</span></a></small></div>
<script> <script>
// version check // version check
if (!settings["lastversion"] || settings["lastversion"]!==currentversion) { if (!settings["lastversion"] || settings["lastversion"]!==currentversion) {

View File

@ -336,4 +336,245 @@ elements.rad_cleaner = {
"rad_snow": {elem2: "snow"}, "rad_snow": {elem2: "snow"},
"rad_rock": {elem2: "rock"}, "rad_rock": {elem2: "rock"},
} }
};
elements.rad_meat = {
behavior: behaviors.STURDYPOWDER,
category: "food",
state: "solid",
density: 1500,
color: ["#e8fc03","#f0b446","#92f046"],
tempHigh: 120,
stateHigh: ["rotten_meat","fallout"],
tempLow:-12,
stateLow: ["frozen_meat","radiation"],
reactions: {
"water": {elem2: "radiated_water", chance:0.4},
"salt_water": { elem2: "radiated_water" },
}
};
elements.lemon = {
behavior: behaviors.POWDER,
category: "food",
state: "powder",
density: 800,
color: ["#f9f934", "#f1ee20",],
tempHigh: 90,
stateHigh: "hot_lemon",
tempLow: -2,
stateLow: "wrinkled_lemon",
burn: 120,
burntime: 600,
burnInto: "ash",
breakInto: [ "lemon_water", "lemon_zest", ],
reactions: {
"water": { elem2: "lemon_water", chance:0.2},
"salt_water": { elem2: [ "lemon_water", "water",] },
"dirty_water": { elem1: "rotten_lemon", },
"soda": { elem2: "lemon_soda", },
"head": { elem1: "saliva", chance:0.75},
"milk": { elem2: "lemon_milk", },
"tea": { elem2: "lemon_tea", },
"poison": { elem2: "rotten_lemon", },
}
};
elements.hot_lemon = {
behavior: behaviors.POWDER,
state: "powder",
category: "food",
hidden: true,
density: 820,
color: ["#8a6d1e","#70661a",],
hidden: true,
temp: 90,
tempHigh: 200,
stateHigh: "fire",
tempLow: 30,
stateLow: "wrinkled_lemon",
burn: 120,
burntime: 600,
burnInto: "ash",
reactions: {
"water": { elem2: "lemon_water", },
}
};
elements.leather = {
behavior: behaviors.SUPPORTPOWDER,
color: ["#3f261d","#664f40",],
state: "powder",
category: "powders",
tempHigh: 200,
stateHigh: "fire",
breakInto: "dust",
burn: 20,
burntime: 200,
burnInto: "ash",
};
elements.wrinkled_lemon = {
behavior: behaviors.POWDER,
color: ["#999543","#a6a03a",],
state: "powder",
category: "food",
tempHigh: 90,
stateHigh: "hot_lemon",
hidden: true,
burn: 120,
burntime: 600,
burnInto: "ash",
reactions: {
"water": { elem2: "lemon_water", chance: 0.2,
}
}
};
elements.coolant = {
color: "#0eebeb",
behavior: [
"XX|CO:4|XX",
"CO:4|HT:1|CO:4",
"XX|CO:4|XX",
],
category: "liquids",
state: "liquid",
insulate: true,
density: 1000,
darkText: false,
tempHigh: 500,
hidden: true,
stateHigh: "steam",
};
elements.arkycite = {
color: "#46ab63",
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 997,
darkText: false,
tempHigh: 400,
hidden: true,
burn: 40,
stateHigh: "fire",
burntime: 500,
};
elements.lemon_water = {
color: ["#faec52","#faee69",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 900,
tempHigh: 100,
stateHigh: ["steam","fragrance",],
hidden: true,
tempLow: -10,
stateLow: "lemon_ice",
reactions: {
"balloon": { elem2: "helium", chance: 0.5, },
"head": { elem1: "saliva", chance: 0.2, },
}
};
elements.lemon_zest = {
color: ["#ded254","#ccc03d",],
behavior: behaviors.POWDER,
category: "trashes",
state: "powder",
density: 1000,
hidden: true,
tempHigh: 350,
stateHigh: "fire",
breakInto: "lemon_water",
burn: 60,
burntime: 200,
burnInto: "smoke"
};
elements.saliva = {
color: ["#a6f5f0","#b6f0ec",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 1280,
tempHigh: 105,
stateHigh: ["steam","fragrance"],
tempLow: -5,
stateHigh: "saliva_ice",
reactions: {
"water": { elem1: null, chance: 0.5, elem2: "dirty_water", chance: 0.5,
}
}
};
elements.lemon_milk = {
color: ["#f5f2c4","#f7f4b2",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 1002,
tempHigh: 500,
stateHigh: "smoke",
tempLow: -2,
stateLow: "frozen_yogurt",
stateLowColor: ["#f5f3cb","#f7f5bc"],
reactions: {
"bacteria": { elem1: "yogurt", },
}
};
elements.lemon_soda = {
color: ["#f5c842","#edcc68",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 1240,
tempHigh: 140,
stateHigh: ["carbon_dioxide", "smoke",],
reactions: {
"poison": { elem1: null, }
}
};
elements.saliva_ice = {
color: ["#97fcfb","#bcf7f6",],
behavior: behaviors.SOLID,
category: "states",
state: "solid",
density: 1300,
tempHigh: 5,
stateHigh: "saliva",
};
elements.lemon_tea = {
color: ["#dec85b","#edd351",],
behavior: behaviors.LIQUID,
category: "liquids",
state: "liquid",
density: 1580,
tempHigh: 280,
stateHigh: ["fragrance","smoke","smoke",],
tempLow: -2,
stateLowColor: ["#e8cf8b","#f0dca5",],
stateLow: "tea_ice",
reactions: {
"sugar": { elem2: null, },
}
};
elements.rotten_lemon = {
color: ["#e3f283","#cdcf6b"],
behavior: behaviors.POWDER,
category: "food",
state: "powder",
density: 1890,
tempHigh: 200,
stateHigh: ["stench","ash",],
reactions: {
"water": { elem2: "dirty_water" },
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -19,8 +19,40 @@ function getRandomElement(arr) {
return arr[Math.floor(Math.random() * arr.length)]; return arr[Math.floor(Math.random() * arr.length)];
} }
function rgbToArray(rgbString) { if (!rgbToArray) {
return rgbString.slice(4, -1).split(',').map(val => parseInt(val.trim())); function rgbToArray(colorString) {
if (typeof colorString !== 'string') {
console.error('Invalid colorString:', colorString);
return null;
}
if (colorString.startsWith('rgb')) {
// Handle RGB format
return colorString.slice(4, -1).split(',').map(val => parseInt(val.trim()));
} else if (colorString.startsWith('#')) {
// Handle HEX format
let hex = colorString.slice(1);
// Handle shorthand hex (e.g., #03F)
if (hex.length === 3) {
hex = hex.split('').map(char => char + char).join('');
}
if (hex.length !== 6) {
console.error('Invalid hex color:', colorString);
return null;
}
const r = parseInt(hex.slice(0, 2), 16);
const g = parseInt(hex.slice(2, 4), 16);
const b = parseInt(hex.slice(4, 6), 16);
return [r, g, b];
} else {
console.error('Invalid color format:', colorString);
return null;
}
}
} }
function scaleList(numbers, scale) { function scaleList(numbers, scale) {
@ -290,6 +322,12 @@ radioactiveElements.forEach(element => {
window.addEventListener('load', () => initializeLightmap(width, height)); window.addEventListener('load', () => initializeLightmap(width, height));
var originalResizeCanvas = resizeCanvas;
resizeCanvas = function(newHeight, newWidth, newPixelSize, clear) {
originalResizeCanvas(newHeight, newWidth, newPixelSize, clear);
initializeLightmap(newHeight, newWidth);
};
var originalTick = tick; var originalTick = tick;
tick = function() { tick = function() {
originalTick(); originalTick();

View File

@ -26,22 +26,20 @@ elements.ketchup.stateLow = "frozen_ketchup";
elements.ketchup.tempHigh = 100; elements.ketchup.tempHigh = 100;
elements.ketchup.stateHigh = "ketchup_gas"; elements.ketchup.stateHigh = "ketchup_gas";
elements.ketchup.density = 1092; elements.ketchup.density = 1092;
elements.ketchup.reactions = { elements.ketchup.reactions ??= {};
"mayonnaise": { "elem1": null, "elem2": "fry_sauce" }, elements.ketchup.reactions.mayonnaise = { "elem1": null, "elem2": "fry_sauce" };
"plague": { "elem1": "poisoned_ketchup", "elem2": null}, elements.ketchup.reactions.plague = { "elem1": "poisoned_ketchup", "elem2": null};
"infection": { "elem1": "poisoned_ketchup", "elem2": null}, elements.ketchup.reactions.infection = { "elem1": "poisoned_ketchup", "elem2": null};
"fallout": { "elem1": "poisoned_ketchup", "chance":25}, elements.ketchup.reactions.fallout = { "elem1": "poisoned_ketchup", "chance":25};
"gloomwind": { "elem1": "poisoned_ketchup", "elem2": null}, elements.ketchup.reactions.gloomwind = { "elem1": "poisoned_ketchup", "elem2": null};
};
// making ketchup dirty // making ketchup dirty
elements.dirt.reactions = { elements.dirt.reactions ??= {};
"ketchup": { "elem1": null, "elem2": "dirty_ketchup", "oneway":true}, elements.dirt.reactions.ketchup = { "elem1": null, "elem2": "dirty_ketchup", "oneway":true};
}; elements.ash.reactions ??= {};
elements.ash.reactions.ketchup = { "elem1": null, "elem2": "dirty_ketchup", "oneway":true}, elements.ash.reactions.ketchup = { "elem1": null, "elem2": "dirty_ketchup", "oneway":true};
elements.dust.reactions = { elements.dust.reactions ??= {};
"ketchup": { "elem1": null, "elem2": "dirty_ketchup", "oneway":true}, elements.dust.reactions.ketchup = { "elem1": null, "elem2": "dirty_ketchup", "oneway":true};
};
// pyrocumulus reactions // pyrocumulus reactions
elements.smoke.reactions.ketchup_cloud = { "elem1": "pyrocumulus", "chance":0.08, "y":[0,15], "setting":"clouds" }, elements.smoke.reactions.ketchup_cloud = { "elem1": "pyrocumulus", "chance":0.08, "y":[0,15], "setting":"clouds" },
@ -430,23 +428,8 @@ runAfterLoad(function() {
]; ];
// ketchup fairy reaction // ketchup fairy reaction
elements.fairy.reactions = { elements.fairy.reactions ??= {};
"fire": { "elem1": "fire_fairy"}, elements.fairy.reactions.ketchup = { "elem1": "ketchup_fairy"};
"magma": { "elem1": "fire_fairy"},
"snow": { "elem1": "ice_fairy"},
"ice": { "elem1": "ice_fairy"},
"petal": { "elem1": "nature_fairy"},
"dirt": { "elem1": "earth_fairy"},
"mud": { "elem1": "earth_fairy"},
"raincloud": { "elem1": "rain_fairy"},
"electric": { "elem1": "thunder_fairy"},
"little_star": { "elem1": "stellar_fairy"},
"moonrock": { "elem1": "lunar_fairy"},
"liquid_light": { "elem1": "light_fairy"},
"mushroom_cap": { "elem1": "mushroom_fairy"},
"magic": { "elem1": "magic_fairy"},
"ketchup": { "elem1": "ketchup_fairy"},
};
// f&m only elements // f&m only elements
elements.ketchup_fairy = { elements.ketchup_fairy = {

View File

@ -19,8 +19,40 @@ function getRandomElement(arr) {
return arr[Math.floor(Math.random() * arr.length)]; return arr[Math.floor(Math.random() * arr.length)];
} }
function rgbToArray(rgbString) { if (!rgbToArray) {
return rgbString.slice(4, -1).split(',').map(val => parseInt(val.trim())); function rgbToArray(colorString) {
if (typeof colorString !== 'string') {
console.error('Invalid colorString:', colorString);
return null;
}
if (colorString.startsWith('rgb')) {
// Handle RGB format
return colorString.slice(4, -1).split(',').map(val => parseInt(val.trim()));
} else if (colorString.startsWith('#')) {
// Handle HEX format
let hex = colorString.slice(1);
// Handle shorthand hex (e.g., #03F)
if (hex.length === 3) {
hex = hex.split('').map(char => char + char).join('');
}
if (hex.length !== 6) {
console.error('Invalid hex color:', colorString);
return null;
}
const r = parseInt(hex.slice(0, 2), 16);
const g = parseInt(hex.slice(2, 4), 16);
const b = parseInt(hex.slice(4, 6), 16);
return [r, g, b];
} else {
console.error('Invalid color format:', colorString);
return null;
}
}
} }
function scaleList(numbers, scale) { function scaleList(numbers, scale) {
@ -288,7 +320,15 @@ radioactiveElements.forEach(element => {
elements[element].tick = glowRadiationColor; elements[element].tick = glowRadiationColor;
}); });
window.addEventListener('load', () => initializeLightmap(width, height)); window.addEventListener('load', () => {
initializeLightmap(width, height);
var originalResizeCanvas = resizeCanvas;
resizeCanvas = function(newHeight, newWidth, newPixelSize, clear) {
originalResizeCanvas(newHeight, newWidth, newPixelSize, clear);
initializeLightmap(newHeight, newWidth);
};
});
var originalTick = tick; var originalTick = tick;
tick = function() { tick = function() {

View File

@ -70,8 +70,8 @@ function drawLinks() {
} }
var originalDrawPixels2 = drawPixels; var originalDrawPixels2 = drawPixels;
drawPixels = function() { drawPixels = function(forceTick=false) {
originalDrawPixels2(); originalDrawPixels2(forceTick);
updateLogicLists(); updateLogicLists();
drawLinks(); drawLinks();
}; };