Merge branch 'R74nCom:main' into main
This commit is contained in:
commit
465313ad00
|
|
@ -204,6 +204,7 @@
|
|||
<tr><td>jaydstuff.js</td><td>Adds various chemicals and compounds</td><td>Jayd</td></tr>
|
||||
<tr><td>laetium.js</td><td>Adds several fictional elements</td><td>Alice</td></tr>
|
||||
<tr><td>liquid_energy.js</td><td>Adds liquid versions of the elements in the Energy category</td><td>Alice</td></tr>
|
||||
<tr><td>liquid_mixing.js</td><td>Allows liquids to mix colors dynamically</td><td>Nekonico</td></tr>
|
||||
<tr><td>lye.js</td><td>Adds lye</td><td>BatteRaquette58</td></tr>
|
||||
<tr><td>mars.js</td><td>Adds some things from Mars with 2 minerals to smelt.</td><td>charcoal_afterlife</td></tr>
|
||||
<tr><td>metals.js</td><td>Adds several metals</td><td>Alice</td></tr>
|
||||
|
|
@ -342,14 +343,15 @@
|
|||
<tr><td>haseulite.js</td><td>Adds Loona-related materials with various properties</td><td>Alice</td></tr>
|
||||
<tr><td>lactose_intolerance_and_celiac.js</td><td>Makes humans explode on contact with milk, wheat, bread, or toast</td><td>Nubo318</td></tr>
|
||||
<tr><td>lattice_filler.js</td><td>Adds a combination of lattice and filler and adds a destructive variant</td><td>Suss</td></tr>
|
||||
<tr><td>liquid_mixing.js</td><td>Allows liquids to mix colors dynamically</td><td>Nekonico</td></tr>
|
||||
<tr><td>lone_urea.js</td><td>Adds urea without the rest of the piss mod</td><td>Alice</td></tr>
|
||||
<tr><td>maze.js</td><td>Adds a solvable maze generator</td><td>ggod</td></tr>
|
||||
<tr><td>memelists.js</td><td>Makes it so you must select elements through a list at the bottom of the page.<br>We like lists</td><td>mollthecoder</td></tr>
|
||||
<tr><td>minecraft.js</td><td>Adds several things from Minecraft</td><td>StellarX20, nousernamefound</td></tr>
|
||||
<tr><td>minesweeper.js</td><td>A subpar implementation of Minesweeper</td><td>Alice</td></tr>
|
||||
<tr><td>musicalfruit.js</td><td>Humans get gas from eating Beans</td><td>mollthecoder</td></tr>
|
||||
<tr><td>nekonicos_stuff.js</td><td>Some random stuff like graphite and oobleck.</td><td>Nekonico</td></tr>
|
||||
<tr><td>prideflags.js</td><td>Adds some pride flags to the game.</td><td>Adora</td></tr>
|
||||
<tr><td>nekonicos_stuff.js</td><td>Some random stuff like graphite, oobleck, and red ice</td><td>Nekonico</td></tr>
|
||||
<tr><td>prideflags.js</td><td>Adds some pride flags to the game</td><td>Adora</td></tr>
|
||||
<tr><td>random_elems.js</td><td>Curated randomly generated elements</td><td>Alice</td></tr>
|
||||
<tr><td>random_liquids.js</td><td>Randomly generates liquids on game load</td><td>Alice</td></tr>
|
||||
<tr><td>sbmixup.js</td><td>Adds silly elements from a <a href="https://R74n.com/mix/" target="_blank">Mix-Up!</a> game</td><td>stefanblox</td>
|
||||
|
|
@ -369,6 +371,7 @@
|
|||
<tr><td>invisible_dye.js</td><td>Adds elements like Dye and Spray Paint that take the color of the background</td><td>Alice</td></tr>
|
||||
<tr><td>invisible_wall.js</td><td>Adds an element like Wall that takes the color of the background</td><td>Alice</td></tr>
|
||||
<tr><td>lightmap.js</td><td>Makes light sources glow</td><td>RedBirdly</td></tr>
|
||||
<tr><td>liquid_mixing.js</td><td>Allows liquids to mix colors dynamically</td><td>Nekonico</td></tr>
|
||||
<tr><td>moreViews.js</td><td>Many new rendering modes</td><td>ggod</td></tr>
|
||||
<tr><td>nicer_flame.js</td><td>Makes fire visually pleasing</td><td>RedBirdly</td></tr>
|
||||
<tr><td>occlusion.js</td><td>Adds realistic shadows (similar to Terraria's lighting)</td><td>RedBirdly</td></tr>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ elements.rf_transmitter = {
|
|||
// RF Receiver Element
|
||||
elements.rf_receiver = {
|
||||
color: "#142c47",
|
||||
category: "Machines",
|
||||
category: "machines",
|
||||
behaviors: behaviors.WALL,
|
||||
tempHigh: 250,
|
||||
stateHigh: "dirt",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,186 @@
|
|||
// By Nekonico!
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
for (var element in elements) {
|
||||
if (elements[element].state === "liquid" && elements[element].behavior !== behaviors.MOLTEN) {
|
||||
elements[element].renderer = function(pixel, ctx) { // this part used nouseramefounds code, props to him!
|
||||
if (!pixel.rSeed){pixel.rSeed = [Math.random(), Math.random(), Math.random(), Math.random()]}
|
||||
if (typeof pixel.color == "object"){
|
||||
let selectedColor = pixel.color[Math.floor(pixel.rSeed[1]*elements[pixel.element].color.length)]
|
||||
let rgb = {
|
||||
r: parseInt(selectedColor.match(/\d+/g)[0]),
|
||||
g: parseInt(selectedColor.match(/\d+/g)[1]),
|
||||
b: parseInt(selectedColor.match(/\d+/g)[2])
|
||||
}
|
||||
for (let c in rgb){
|
||||
rgb[c] += Math.floor(pixel.rSeed[0] * (pixel.rSeed[2] > 0.5 ? -1 : 1) * pixel.rSeed[3] * 15);
|
||||
rgb[c] = Math.max(0, Math.min(255, rgb[c]));
|
||||
}
|
||||
if (elements[pixel.element].glow || elements[pixel.element].isGas){
|
||||
drawPlus(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y, 1);
|
||||
} else {
|
||||
drawSquare(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y);
|
||||
}
|
||||
} else {
|
||||
let rgb = {
|
||||
r: parseInt(pixel.color.match(/\d+/g)[0]),
|
||||
g: parseInt(pixel.color.match(/\d+/g)[1]),
|
||||
b: parseInt(pixel.color.match(/\d+/g)[2])
|
||||
}
|
||||
for (let c in rgb){
|
||||
rgb[c] += Math.floor(pixel.rSeed[0] * (pixel.rSeed[2] > 0.5 ? -1 : 1) * pixel.rSeed[3] * 15);
|
||||
rgb[c] = Math.max(0, Math.min(255, rgb[c]));
|
||||
}
|
||||
if (elements[pixel.element].glow || elements[pixel.element].isGas){
|
||||
drawPlus(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y, 1);
|
||||
} else {
|
||||
drawSquare(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (elements[element].id === elements.cement.id || elements[element].id === elements.beans.id || elements[element].id === elements.algae.id || elements[element].id === elements.cellulose.id) {
|
||||
elements[element].miscible = false
|
||||
}
|
||||
if (elements[element].id === elements.midas_touch.id || elements[element].id === elements.cement.id || elements[element].id === elements.beans.id || elements[element].id === elements.algae.id || elements[element].id === elements.cellulose.id || elements[element].id === elements.primordial_soup.id || elements[element].id === elements.cyanide.id || elements[element].id === elements.poison.id || elements[element].id === elements.antidote.id || elements[element].id === elements.mercury.id || elements[element].id === elements.liquid_oxygen.id || elements[element].id === elements.liquid_nitrogen.id) {
|
||||
elements[element].soluble = false
|
||||
}
|
||||
if (elements[element].id === elements.midas_touch.id || elements[element].id === elements.molasses.id || elements[element].id === elements.grease.id || elements[element].id === elements.oil.id || elements[element].id === elements.lamp_oil.id || elements[element].id === elements.nut_oil.id|| elements[element].id === elements.honey.id || elements[element].id === elements.sap.id || elements[element].id === elements.caramel.id) {
|
||||
elements[element].polar = 2
|
||||
}
|
||||
else if (elements[element].id === elements.soap.id) {
|
||||
elements[element].polar = 3
|
||||
}
|
||||
else {
|
||||
elements[element].polar = 1
|
||||
}
|
||||
if (elements[element].stain === undefined || !elements[element].stain) {
|
||||
elements[element].stain = 0.000000001
|
||||
elements[element].mixstain = 0.3
|
||||
}
|
||||
else if (elements[element].stain < 0.66 && elements[element].stain > -0.249 && (elements[element].mixstain === undefined || !elements[element].mixstain)) {
|
||||
elements[element].mixstain = (elements[element].stain + 0.25)
|
||||
}
|
||||
else if (elements[element].stain < 0.66 && elements[element].stain > -0.35 && (elements[element].mixstain === undefined || !elements[element].mixstain)) {
|
||||
elements[element].mixstain = (Math.abs(elements[element].stain) - 0.1)
|
||||
}
|
||||
else if (elements[element].stain < 0.66 && elements[element].stain < -0.35 && (elements[element].mixstain === undefined || !elements[element].mixstain)) {
|
||||
elements[element].mixstain = 0.1
|
||||
}
|
||||
else if (elements[element].stain < 0.66 && elements[element].stain < -0.249 && (elements[element].mixstain === undefined || !elements[element].mixstain)) {
|
||||
elements[element].mixstain = 0.125
|
||||
}
|
||||
else {
|
||||
elements[element].mixstain = (0.66)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
doStaining = function(pixel) {
|
||||
if (settings.stain===0) { return }
|
||||
var stain = elements[pixel.element].stain;
|
||||
var mixstain = elements[pixel.element].mixstain;
|
||||
if (stain > 0) {
|
||||
var newColor = pixel.color.match(/\d+/g);
|
||||
}
|
||||
else {
|
||||
var newColor = null;
|
||||
}
|
||||
if (mixstain > 0) {
|
||||
var mixnewColor = pixel.color.match(/\d+/g);
|
||||
}
|
||||
else {
|
||||
var mixnewColor = null;
|
||||
}
|
||||
|
||||
for (var i = 0; i < adjacentCoords.length; i++) {
|
||||
var x = pixel.x+adjacentCoords[i][0];
|
||||
var y = pixel.y+adjacentCoords[i][1];
|
||||
if (!isEmpty(x,y,true)) {
|
||||
var newPixel = pixelMap[x][y];
|
||||
if (elements[pixel.element].ignore && elements[pixel.element].ignore.indexOf(newPixel.element) !== -1) {
|
||||
continue;
|
||||
}
|
||||
if ((elements[newPixel.element].id !== elements[pixel.element].id || elements[newPixel.element].stainSelf) && (solidStates[elements[newPixel.element].state] || elements[newPixel.element].id === elements[pixel.element].id)) {
|
||||
if (Math.random() < Math.abs(stain)) {
|
||||
if (stain < 0) {
|
||||
if (newPixel.origColor) {
|
||||
newColor = newPixel.origColor;
|
||||
}
|
||||
else { continue; }
|
||||
}
|
||||
else if (!newPixel.origColor) {
|
||||
newPixel.origColor = newPixel.color.match(/\d+/g);
|
||||
}
|
||||
// if newPixel.color doesn't start with rgb, continue
|
||||
if (!newPixel.color.match(/^rgb/)) { continue; }
|
||||
// parse rgb color string of newPixel rgb(r,g,b)
|
||||
var rgb = newPixel.color.match(/\d+/g);
|
||||
if (elements[pixel.element].stainSelf && elements[newPixel.element].id === elements[pixel.element].id) {
|
||||
// if rgb and newColor are the same, continue
|
||||
if (rgb[0] === newColor[0] && rgb[1] === newColor[1] && rgb[2] === newColor[2]) { continue; }
|
||||
var avg = [];
|
||||
for (var j = 0; j < rgb.length; j++) {
|
||||
avg[j] = Math.round((rgb[j]*(1-Math.abs(stain))) + (newColor[j]*Math.abs(stain)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// get the average of rgb and newColor, more intense as stain reaches 1
|
||||
var avg = [];
|
||||
for (var j = 0; j < rgb.length; j++) {
|
||||
avg[j] = Math.floor((rgb[j]*(1-Math.abs(stain))) + (newColor[j]*Math.abs(stain)));
|
||||
}
|
||||
}
|
||||
// set newPixel color to avg
|
||||
newPixel.color = "rgb("+avg.join(",")+")";
|
||||
}
|
||||
}
|
||||
if ((elements[newPixel.element].id === elements[pixel.element].id || elements[newPixel.element].state === "liquid") && elements[pixel.element].state === "liquid" && elements[pixel.element].miscible !== false && elements[newPixel.element].miscible !== false) {
|
||||
if (mixstain === undefined || !mixstain) {
|
||||
var mixstain = 0.5
|
||||
}
|
||||
if (Math.random() < mixstain) {
|
||||
if (elements[newPixel.element].polar === elements[pixel.element].polar || elements[newPixel.element].polar === 3) {
|
||||
if (!newPixel.origColor) {
|
||||
newPixel.origColor = newPixel.color.match(/\d+/g);
|
||||
}
|
||||
// if newPixel.color doesn't start with rgb, continue
|
||||
if (!newPixel.color.match(/^rgb/)) { continue; }
|
||||
// parse rgb color string of newPixel rgb(r,g,b)
|
||||
var rgb = newPixel.color.match(/\d+/g);
|
||||
if (elements[newPixel.element].id === elements[pixel.element].id) {
|
||||
// if rgb and newColor are the same, continue
|
||||
if (rgb[0] === mixnewColor[0] && rgb[1] === mixnewColor[1] && rgb[2] === mixnewColor[2]) { continue; }
|
||||
var avg = [];
|
||||
for (var j = 0; j < rgb.length; j++) {
|
||||
avg[j] = Math.round((rgb[j]*(1- mixstain)) + (mixnewColor[j] * mixstain));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// get the average of rgb and newColor, more intense as stain reaches 1
|
||||
var avg = [];
|
||||
for (var j = 0; j < rgb.length; j++) {
|
||||
avg[j] = Math.floor((rgb[j]*(1- mixstain)) + (mixnewColor[j] * mixstain));
|
||||
}
|
||||
}
|
||||
if (Math.random() > 0.9 && elements[newPixel.element].soluble === true && elements[pixel.element].soluble === true && newPixel.color === pixel.color && elements[newPixel.element].density > (elements[pixel.element].density - 20) && elements[newPixel.element].density < (elements[pixel.element].density + 40) && elements[pixel.element].density > (elements[newPixel.element].density - 20) && elements[pixel.element].density < (elements[newPixel.element].density + 40) ) {
|
||||
if (elements[newPixel.element].density < elements[pixel.element].density) {
|
||||
newPixel.element = pixel.element
|
||||
}
|
||||
else if (elements[newPixel.element].density > elements[pixel.element].density) {
|
||||
pixel.element = newPixel.element
|
||||
}
|
||||
else if (elements[newPixel.element].density == elements[pixel.element].density) {
|
||||
newPixel.element = pixel.element
|
||||
}
|
||||
}
|
||||
// set newPixel color to avg
|
||||
newPixel.color = "rgb("+avg.join(",")+")";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// By Nekonico!
|
||||
|
|
@ -3918,12 +3918,58 @@ elements.sign = {
|
|||
},
|
||||
movable: false
|
||||
}
|
||||
elements.e_sign = {
|
||||
color: "#f3ff88",
|
||||
darkText: true,
|
||||
category: "special",
|
||||
movable: false,
|
||||
onSelect: () => {
|
||||
let signi = prompt("What text should the sign display?", signInput||"Hello World!")
|
||||
signInput = signi;
|
||||
},
|
||||
renderer: function(pixel, ctx){
|
||||
if (!pixel.sign){pixel.sign=signInput}
|
||||
},
|
||||
conduct: 1
|
||||
}
|
||||
renderPostPixel(function(ctx){
|
||||
for (pixel of currentPixels){
|
||||
if (pixel.element == "sign" && pixel.sign){
|
||||
if ((pixel.element == "sign") && pixel.sign){
|
||||
ctx.font = `12pt Arial`
|
||||
ctx.fillStyle = pixel.color;
|
||||
ctx.fillText(pixel.sign, canvasCoord(pixel.x), canvasCoord(pixel.y))
|
||||
} else if (pixel.element == "e_sign" && pixel.sign){
|
||||
if (pixel.charge || pixel.chargeCD){
|
||||
ctx.font = `12pt Arial`
|
||||
ctx.fillStyle = pixel.color;
|
||||
ctx.fillText(pixel.sign, canvasCoord(pixel.x), canvasCoord(pixel.y))
|
||||
} else {
|
||||
drawSquare(ctx, pixel.color, pixel.x, pixel.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
let machinemodName = "nousersthings.js"
|
||||
elements.mod_dectector = {
|
||||
color: "#54681d",
|
||||
behavior: behaviors.WALL,
|
||||
category: "machines",
|
||||
movable: false,
|
||||
excludeRandom: true,
|
||||
onSelect: () => {
|
||||
let newMod = prompt("What mod should this machine detect?", "nousersthings.js"||modName)
|
||||
machinemodName = newMod
|
||||
},
|
||||
tick: (pixel) => {
|
||||
if (!pixel.mod){pixel.mod = machinemodName}
|
||||
if (enabledMods.includes("mods/" + pixel.mod)){
|
||||
for (let i = 0; i < adjacentCoords.length; i++){
|
||||
let x = adjacentCoords[i][0] + pixel.x;
|
||||
let y = adjacentCoords[i][1] + pixel.y;
|
||||
if (!isEmpty(x, y, true) && elements[pixelMap[x][y].element].conduct){
|
||||
pixelMap[x][y].charge = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue