Merge branch 'R74nCom:main' into main
This commit is contained in:
commit
422effffa8
|
|
@ -136,6 +136,7 @@
|
|||
<tr><td>evenmoretemptools.js</td><td>Adds different temperature-modifying tools (±350/tick, NaN, and Infinity)</td><td>Alice</td></tr>
|
||||
<tr><td>extra_element_info.js</td><td>Adds descriptions to various vanilla elements. Used to provide the functionality that desc now does before it was added to vanilla</td><td>Melecie</td></tr>
|
||||
<tr><td>find.js</td><td>Adds a find mode that highlights a chosen element as pulsating red and yellow <a href="https://github.com/R74nCom/sandboxels/commit/de0dc088ab4d928c77587b9d0e3a7d7663e3f94a">(read commit description)</a></td><td>Alice</td></tr>
|
||||
<tr><td>jaydsfunctions.js</td><td>Adds extra tools</td><td>Jayd</td></tr>
|
||||
<tr><td>insane_random_events.js</td><td>Massively buffs random events</td><td>Alice</td></tr>
|
||||
<tr><td>invertscroll.js</td><td>Inverts the scroll wheel for adjusting brush size</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>mobile_shift.js</td><td>Adds a button for shift on mobile</td><td>SquareScreamYT</td></tr>
|
||||
|
|
@ -221,7 +222,7 @@
|
|||
<tr><td>more_breaking.js</td><td>Allows for breaking more elements in explosions</td><td>Alice</td></tr>
|
||||
<tr><td>rays.js</td><td>Adds more Ray types</td><td>Alice</td></tr>
|
||||
<tr><td>rays++.js</td><td>Adds a couple more rays</td><td>uptzik</td></tr>
|
||||
<tr><td>weapons.js</td><td>Adds some extra weapons</td><td>Jayd</td></tr>
|
||||
<tr><td>weapons.js</td><td>Adds varieties of different weapons </td><td>Jayd</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Food & Cooking</td></tr><!---->
|
||||
<tr><td>aChefsDream.js</td><td>Adds more foods, animals, tools and many other cooking related items. Updates can be found in <a href="https://www.youtube.com/watch?v=pQFTtlNPODQ&list=PLWHqGb75vC8o7CLv-pMoVb56JL9BY9F0t">this YouTube Playlist</a></td><td>SquareScreamYT</td></tr>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,397 @@
|
|||
elements.lab = {
|
||||
color: "#ff0000",
|
||||
behaviorOn: behaviors.WALL,
|
||||
behavior: [
|
||||
"CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wire|CR:wire|CR:wire|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall",
|
||||
"CR:wall|DL|XX|XX|XX|XX|XX|CR:e_cr|CR:wall|CR:sensor|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:glass|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:glass|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|CR:wall|CR:wall|CR:wall|XX|CR:wall|CR:wall|CR:wall|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|CR:wall|CR:wall|CR:wire|xx|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:ecloner|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|CR:wall|CR:wall|CR:wire|CR:wall|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:glass|XX|XX|CR:sensor|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:glass|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|CR:wall|XX|CR:wall|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:player|CR:player_2|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|XX|XX|XX|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|XX|CR:wall|CR:wall|CR:wall|XX|CR:wall|CR:wall|CR:wall|CR:wall|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|CR:wire|CR:wall|CR:wire|CR:wall|CR:wire|CR:wall|CR:wire|CR:wall|XX|XX|XX|CR:wall|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|CR:wire|CR:wire|CR:wire|CR:wire|CR:wire|CR:wire|CR:wire|CR:wall|XX|XX|XX|CR:wall|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|CR:wall|CR:wall|CR:wall|CR:wire|CR:wall|CR:wall|CR:wall|CR:wire|CR:sensor|XX|XX|CR:wall|XX|XX|XX|XX|CR:wall|XX|XX|XX|XX|XX|CR:wall",
|
||||
"CR:wall|CR:wall|CR:wall|CR:wall|CR:wire|CR:wire|CR:wire|CR:wire|CR:wire|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall|CR:wall",
|
||||
],
|
||||
category: "lab",
|
||||
state: "solid",
|
||||
};
|
||||
elements.e_cr = {
|
||||
name: "e-cr",
|
||||
color: "#dddd00",
|
||||
behavior: behaviors.WALL,
|
||||
behaviorOn: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|CR:human|XX"
|
||||
],
|
||||
tick: function(pixel) {
|
||||
if (pixel.create) { return }
|
||||
for (var i = 0; i < adjacentCoords.length; i++) {
|
||||
var coords = adjacentCoords[i];
|
||||
var x = pixel.x + coords[0];
|
||||
var y = pixel.y + coords[1];
|
||||
if (!isEmpty(x,y,true)) {
|
||||
pixel.temp = pixelMap[x][y].temp;
|
||||
if (pixelMap[x][y].create) { pixel.create = pixelMap[x][y].create; break }
|
||||
var element = pixelMap[x][y].element;
|
||||
if (element === pixel.element || elements[pixel.element].ignore.indexOf(element) !== -1) { continue }
|
||||
pixel.create = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
ignore: ["cloner","slow_cloner","clone_powder","floating_cloner","wire","ewall","wire","sensor","battery"],
|
||||
category:"machines",
|
||||
insulate:true,
|
||||
darkText: true,
|
||||
conduct: 1,
|
||||
hardness: 1,
|
||||
movable: false
|
||||
}
|
||||
var libraryMod = "mods/code_library.js";
|
||||
|
||||
if(enabledMods.includes(libraryMod)) {
|
||||
sussyKey = null;
|
||||
isShift = false;
|
||||
isAlt = false;
|
||||
|
||||
document.addEventListener("keydown", function(modifierDownListener) {
|
||||
// User presses shift
|
||||
if (modifierDownListener.keyCode == 16) {
|
||||
isShift = true;
|
||||
}
|
||||
// User presses alt
|
||||
if (modifierDownListener.keyCode == 18) {
|
||||
isAlt = true;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("keyup", function(modifierUpListener) {
|
||||
// User releases shift
|
||||
if (modifierUpListener.keyCode == 16) {
|
||||
isShift = false;
|
||||
}
|
||||
// User releases alt
|
||||
if (modifierUpListener.keyCode == 18) {
|
||||
isAlt = false;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("keyup", function(sussyListener) {
|
||||
switch (sussyListener.keyCode) {
|
||||
case 87:
|
||||
sussyKey = "W";
|
||||
break;
|
||||
case 65:
|
||||
sussyKey = "A";
|
||||
break;
|
||||
case 83:
|
||||
sussyKey = "S";
|
||||
break;
|
||||
case 68:
|
||||
sussyKey = "D";
|
||||
break;
|
||||
case 81:
|
||||
sussyKey = "Q";
|
||||
break;
|
||||
case 88:
|
||||
sussyKey = "X";
|
||||
break;
|
||||
case 90:
|
||||
sussyKey = "Z";
|
||||
break;
|
||||
case 86:
|
||||
sussyKey = "V";
|
||||
break;
|
||||
};
|
||||
});
|
||||
|
||||
function controllablePixelTryCreatePixelNullCheck(element,x,y) {
|
||||
if(!elements[element]) { //catch the null
|
||||
return false;
|
||||
};
|
||||
if(isEmpty(x,y)) {
|
||||
tryCreatePixel(element,x,y);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
elements.player = {
|
||||
color: "#FFFFFF",
|
||||
colorOn: "#FFFF00",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
density: 2000,
|
||||
maxSize: 1,
|
||||
conduct: 1,
|
||||
hardness: 1,
|
||||
tick: function(pixel) {
|
||||
var xx = pixel.x;
|
||||
var yy = pixel.y;
|
||||
userElement = currentElement;
|
||||
if(userElement === pixel.element) {
|
||||
userElement = null;
|
||||
};
|
||||
if(isShift && !isAlt) {
|
||||
sussyKey === "Z" ? pixel.color = "rgb(255,191,127)" : pixel.color = "rgb(255,127,127)";
|
||||
}
|
||||
if(isAlt && !isShift) {
|
||||
sussyKey === "Z" ? pixel.color = "rgb(191,255,127)" : pixel.color = "rgb(127,255,127)";
|
||||
}
|
||||
if(isAlt && isShift) {
|
||||
sussyKey === "Z" ? pixel.color = "rgb(255,255,0)" : pixel.color = "rgb(255,255,127)";
|
||||
}
|
||||
if(!isAlt && !isShift) {
|
||||
sussyKey === "Z" ? pixel.color = "rgb(255,255,191)" : pixel.color = "rgb(255,255,255)";
|
||||
}
|
||||
if(sussyKey !== null) {
|
||||
switch (sussyKey) {
|
||||
case "W":
|
||||
isAlt ? controllablePixelTryCreatePixelNullCheck(userElement,xx,yy-1) : tryMove(pixel,xx,yy-1);
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "A":
|
||||
isAlt ? controllablePixelTryCreatePixelNullCheck(userElement,xx-1,yy) : tryMove(pixel,xx-1,yy);
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "S":
|
||||
isAlt ? controllablePixelTryCreatePixelNullCheck(userElement,xx,yy+1) : tryMove(pixel,xx,yy+1);
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "D":
|
||||
tryMove(pixel,xx+1,yy);
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "V": //Alt+D is something else in some browsers.
|
||||
if(isAlt) {
|
||||
controllablePixelTryCreatePixelNullCheck(userElement,xx+1,yy);
|
||||
};
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "X":
|
||||
explodeAt(xx,yy,5)
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "Z":
|
||||
if (!pixel.charge && !pixel.chargeCD && !isEmpty(pixel.x,pixel.y,true)) {
|
||||
pixel.charge = 1;
|
||||
}
|
||||
if(!isShift === 0) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "Q": //Use if a key gets stuck
|
||||
sussyKey = null;
|
||||
isShift = null;
|
||||
isAlt = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
} else {
|
||||
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
|
||||
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
|
||||
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
|
||||
};
|
||||
|
||||
|
||||
var libraryMod = "mods/code_library.js";
|
||||
|
||||
if(enabledMods.includes(libraryMod)) {
|
||||
sussyKey = null;
|
||||
isShift = false;
|
||||
isAlt = false;
|
||||
|
||||
document.addEventListener("keydown", function(modifierDownListener) {
|
||||
// User presses shift
|
||||
if (modifierDownListener.keyCode == 16) {
|
||||
isShift = true;
|
||||
}
|
||||
// User presses alt
|
||||
if (modifierDownListener.keyCode == 18) {
|
||||
isAlt = true;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("keyup", function(modifierUpListener) {
|
||||
// User releases shift
|
||||
if (modifierUpListener.keyCode == 16) {
|
||||
isShift = false;
|
||||
}
|
||||
// User releases alt
|
||||
if (modifierUpListener.keyCode == 18) {
|
||||
isAlt = false;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("keyup", function(sussyListener) {
|
||||
switch (sussyListener.keyCode) {
|
||||
case 84:
|
||||
sussyKey = "T";
|
||||
break;
|
||||
case 70:
|
||||
sussyKey = "F";
|
||||
break;
|
||||
case 72:
|
||||
sussyKey = "H";
|
||||
break;
|
||||
case 71:
|
||||
sussyKey = "G";
|
||||
break;
|
||||
case 81:
|
||||
sussyKey = "Q";
|
||||
break;
|
||||
case 88:
|
||||
sussyKey = "X";
|
||||
break;
|
||||
case 90:
|
||||
sussyKey = "Z";
|
||||
break;
|
||||
case 86:
|
||||
sussyKey = "V";
|
||||
break;
|
||||
};
|
||||
});
|
||||
|
||||
function controllablePixelTryCreatePixelNullCheck(element,x,y) {
|
||||
if(!elements[element]) { //catch the null
|
||||
return false;
|
||||
};
|
||||
if(isEmpty(x,y)) {
|
||||
tryCreatePixel(element,x,y);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
elements.player_2 = {
|
||||
color: "#FFFFFF",
|
||||
colorOn: "#FFFF00",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
density: 2000,
|
||||
maxSize: 1,
|
||||
conduct: 1,
|
||||
hardness: 1,
|
||||
tick: function(pixel) {
|
||||
var xx = pixel.x;
|
||||
var yy = pixel.y;
|
||||
userElement = currentElement;
|
||||
if(userElement === pixel.element) {
|
||||
userElement = null;
|
||||
};
|
||||
if(isShift && !isAlt) {
|
||||
sussyKey === "Z" ? pixel.color = "rgb(255,191,127)" : pixel.color = "rgb(255,127,127)";
|
||||
}
|
||||
if(isAlt && !isShift) {
|
||||
sussyKey === "Z" ? pixel.color = "rgb(191,255,127)" : pixel.color = "rgb(127,255,127)";
|
||||
}
|
||||
if(isAlt && isShift) {
|
||||
sussyKey === "Z" ? pixel.color = "rgb(255,255,0)" : pixel.color = "rgb(255,255,127)";
|
||||
}
|
||||
if(!isAlt && !isShift) {
|
||||
sussyKey === "Z" ? pixel.color = "rgb(255,255,191)" : pixel.color = "rgb(255,255,255)";
|
||||
}
|
||||
if(sussyKey !== null) {
|
||||
switch (sussyKey) {
|
||||
case "T":
|
||||
isAlt ? controllablePixelTryCreatePixelNullCheck(userElement,xx,yy-1) : tryMove(pixel,xx,yy-1);
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "F":
|
||||
isAlt ? controllablePixelTryCreatePixelNullCheck(userElement,xx-1,yy) : tryMove(pixel,xx-1,yy);
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "G":
|
||||
isAlt ? controllablePixelTryCreatePixelNullCheck(userElement,xx,yy+1) : tryMove(pixel,xx,yy+1);
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "H":
|
||||
tryMove(pixel,xx+1,yy);
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "V": //Alt+D is something else in some browsers.
|
||||
if(isAlt) {
|
||||
controllablePixelTryCreatePixelNullCheck(userElement,xx+1,yy);
|
||||
};
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "X":
|
||||
explodeAt(xx,yy,5)
|
||||
if(!isShift) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "Z":
|
||||
if (!pixel.charge && !pixel.chargeCD && !isEmpty(pixel.x,pixel.y,true)) {
|
||||
pixel.charge = 1;
|
||||
}
|
||||
if(!isShift === 0) {
|
||||
sussyKey = null;
|
||||
}
|
||||
break;
|
||||
case "Q": //Use if a key gets stuck
|
||||
sussyKey = null;
|
||||
isShift = null;
|
||||
isAlt = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
} else {
|
||||
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
|
||||
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
|
||||
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
|
||||
};
|
||||
|
||||
|
||||
|
||||
// i know it looks messy but it works
|
||||
|
||||
// if u dont belive me test it but place it in the center of the canvas
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
//mod made by imilkflamingos
|
||||
|
||||
|
||||
function countNeighbors(pixel,target){
|
||||
var targeted = 0;
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y, true)) {
|
||||
var otherPixel = pixelMap[x][y];
|
||||
if (otherPixel.element == target){
|
||||
targeted = targeted + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
return targeted;
|
||||
}
|
||||
|
||||
//made by Fioushemastor
|
||||
function getDistance(x1, y1, x2, y2) {
|
||||
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
|
||||
}
|
||||
|
||||
function getNearestPixel( posX,posY, targetElement) {
|
||||
let nearestPixel
|
||||
let minDistance = Infinity
|
||||
|
||||
//the stuff
|
||||
for (let index in pixelMap) {
|
||||
for (let pixel of pixelMap[index]) {
|
||||
if (pixel == undefined) continue;
|
||||
if (pixel.element == targetElement) {
|
||||
let distance = getDistance(pixel.x, pixel.y, posX, posY);
|
||||
if (distance < minDistance) {
|
||||
minDistance = distance;
|
||||
nearestPixel = pixel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nearestPixel
|
||||
}
|
||||
// Rest made me
|
||||
|
||||
function getRandomInt (min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
function createEarthQuakeRand() {
|
||||
const chance = Math.random();
|
||||
if ( chance <= 0.005 ) {
|
||||
var randY = getRandomInt(60,85)
|
||||
var randX = getRandomInt(1,163)
|
||||
if(isEmpty(randX,randY)) {
|
||||
createPixel('earthquake',randX,randY)
|
||||
}
|
||||
else {
|
||||
changePixel(pixelMap[randX][randY],'earthquake')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function createTsunamiRand(){
|
||||
var randX = getRandomInt(1,163)
|
||||
const ClosestPixel = getNearestPixel(randX,25,'water')
|
||||
if(ClosestPixel) {
|
||||
var neighbors = countNeighbors(ClosestPixel,'water')
|
||||
if (isEmpty(ClosestPixel.x,ClosestPixel.y-1)) {
|
||||
const chance = Math.random();
|
||||
if ( chance <= 0.001 && countNeighbors(ClosestPixel,'water') >= 3) {
|
||||
createPixel('tsunami',ClosestPixel.x,ClosestPixel.y-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function createWildFireRand(){
|
||||
var randX = getRandomInt(1,163)
|
||||
const ClosestPixel = getNearestPixel(randX,25,'plant')
|
||||
if(ClosestPixel) {
|
||||
if (!isEmpty(ClosestPixel.x,ClosestPixel.y)) {
|
||||
const chance = Math.random();
|
||||
if ( chance <= 0.0005) {
|
||||
ClosestPixel.burning = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function createMetorShower(){
|
||||
|
||||
}
|
||||
|
||||
function createCloud(pixel, type) {
|
||||
for (let i = 0; i < 70; i++) {
|
||||
if(isEmpty(pixel.x-i,pixel.y) ) {
|
||||
createPixel(type,pixel.x-i,pixel.y, );
|
||||
}
|
||||
if(isEmpty(pixel.x+i,pixel.y) ) {
|
||||
createPixel(type,pixel.x+i,pixel.y, );
|
||||
}
|
||||
if(isEmpty(pixel.x-i,pixel.y-1) ) {
|
||||
createPixel(type,pixel.x-i,pixel.y-1, );
|
||||
}
|
||||
if(isEmpty(pixel.x+i,pixel.y-1) ) {
|
||||
createPixel(type,pixel.x+i,pixel.y-1, );
|
||||
}
|
||||
if(isEmpty(pixel.x-i,pixel.y+1) ) {
|
||||
createPixel(type,pixel.x-i,pixel.y+1, );
|
||||
}
|
||||
if(isEmpty(pixel.x+i,pixel.y+1) ) {
|
||||
createPixel(type,pixel.x+i,pixel.y+1, );
|
||||
}
|
||||
i+1
|
||||
}
|
||||
}
|
||||
|
||||
elements.Test_Element = {
|
||||
hidden: true,
|
||||
color: "#ff0000",
|
||||
conduct: 0.1,
|
||||
category:"test",
|
||||
behavior: behaviors.WALL,
|
||||
|
||||
onSelect: function(pixel){},
|
||||
tick: function(pixel) {
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
elements.Diaster_Spawner = {
|
||||
maxSize : 1,
|
||||
color: ["#8D8D8C", "#666666"],
|
||||
category: "land",
|
||||
behavior: behaviors.WALL,
|
||||
properties : {
|
||||
age: 0,
|
||||
|
||||
},
|
||||
tick : function(pixel) {
|
||||
const num = getRandomInt(1,3)
|
||||
if (num == 1) {
|
||||
createCloud(pixel, 'rain_cloud')
|
||||
} else if(num == 2){
|
||||
createCloud(pixel, 'thunder_cloud')
|
||||
} else {
|
||||
createCloud(pixel, 'tornado_cloud')
|
||||
}
|
||||
|
||||
if(pixel.age > 100) {
|
||||
changePixel(pixel,"cloud");
|
||||
}
|
||||
pixel.age++
|
||||
doDefaults(pixel);
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
elements.tornado_cloud = {
|
||||
color: ["#8D8D8C", "#666666"],
|
||||
category: "land",
|
||||
state : 'gas',
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|DL%0.0001|M1%2.5 AND BO",
|
||||
"XX|XX|XX",
|
||||
],
|
||||
tick : function(pixel) {
|
||||
const chance = Math.random();
|
||||
|
||||
if ( chance <= 0.00001) {
|
||||
if(isEmpty(pixel.x,pixel.y+1)) {
|
||||
changePixel(pixel,"tornado")
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
density: 0.4,
|
||||
ignoreAir: true,
|
||||
conduct: 0.03
|
||||
};
|
||||
|
||||
|
||||
|
||||
function createCloudRand() {
|
||||
const chance = Math.random();
|
||||
var randY = getRandomInt(7,19)
|
||||
if(chance <= 0.001) {
|
||||
if( isEmpty(83,randY)){
|
||||
createPixel('Diaster_Spawner',83,randY)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function runEvents(){
|
||||
if(!paused) {
|
||||
createEarthQuakeRand();
|
||||
createTsunamiRand();
|
||||
createCloudRand();
|
||||
createWildFireRand();
|
||||
}
|
||||
}
|
||||
|
||||
runAfterLoad(function() {
|
||||
RunSimInterval = window.setInterval(runEvents, 75);
|
||||
});
|
||||
|
|
@ -59,7 +59,7 @@ elements.mangrove_mud = {
|
|||
density: 1089,
|
||||
stain: 0.25
|
||||
};
|
||||
peat_slurry = {
|
||||
elements.peat_slurry = {
|
||||
color: "#556B2F",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
|
|
@ -92,7 +92,7 @@ elements.fen_mud = {
|
|||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1550,
|
||||
density: 1450,
|
||||
stain: 0.28
|
||||
};
|
||||
elements.swamp_sludge = {
|
||||
|
|
@ -479,7 +479,7 @@ elements.mud = {
|
|||
density: 1000,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.quicksand = {
|
||||
elements.quicksand_mud = {
|
||||
color: "#DAA520",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 1750,
|
||||
|
|
@ -505,7 +505,7 @@ elements.sandy_mud = {
|
|||
};
|
||||
elements.sticky_quicksand = {
|
||||
color: "#DAA520",
|
||||
behavior:elements.sap.behavior,
|
||||
behavior: elements.sap.behavior,
|
||||
viscosity: 1700,
|
||||
tempHigh: 65,
|
||||
stateHigh: "liquid",
|
||||
|
|
@ -515,3 +515,592 @@ elements.sticky_quicksand = {
|
|||
density: 1100,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.fluff_mud = {
|
||||
color: "#964B00",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 40,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1300,
|
||||
stain: 0.2
|
||||
};
|
||||
elements.bog = {
|
||||
color: "#556B2F",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 45,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1400,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.mire = {
|
||||
color: "#2E8B57",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 50,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1500,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.oobleck = {
|
||||
color: "#008000",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 25,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1600,
|
||||
stain: 0.15
|
||||
};
|
||||
elements.spiderwebs = {
|
||||
color: "#D3D3D3",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 20,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1700,
|
||||
stain: 0.1
|
||||
};
|
||||
|
||||
elements.silt_quicksand = {
|
||||
color: "#DAA520",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 68,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1500,
|
||||
stain: 0.15
|
||||
};
|
||||
elements.syrupy_mud = {
|
||||
color: "#8B4513",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 65,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1550,
|
||||
stain: 0.2
|
||||
};
|
||||
elements.quagmire_mud = {
|
||||
color: "#A0522D",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 60,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1600,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.bog_quicksand = {
|
||||
color: "#556B2F",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 62,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1650,
|
||||
stain: 0.2
|
||||
};
|
||||
elements.sludge_mud = {
|
||||
color: "#2E8B57",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 58,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1700,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.squishy_slime = {
|
||||
color: "#FF4500",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 15000,
|
||||
tempHigh: 20,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1600,
|
||||
stain: 0.1
|
||||
};
|
||||
elements.sparkling_slime = {
|
||||
color: "#FFD700",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 12000,
|
||||
tempHigh: 25,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1650,
|
||||
stain: 0.15
|
||||
};
|
||||
elements.glittery_slime = {
|
||||
color: "#B0E0E6",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 25000,
|
||||
tempHigh: 10,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1750,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.swirling_slime = {
|
||||
color: "#9370DB",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 18000,
|
||||
tempHigh: 5,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1800,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.fizzling_slime = {
|
||||
color: "#00FFFF",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 15000,
|
||||
tempHigh: -5,
|
||||
stateHigh: "liquid",
|
||||
tempLow: -10,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1900,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.crackling_slime = {
|
||||
color: "#FF6347",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 20000,
|
||||
tempHigh: -10,
|
||||
stateHigh: "liquid",
|
||||
tempLow: -15,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1480,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.glowing_slime = {
|
||||
color: "#7B68EE",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 25000,
|
||||
tempHigh: -15,
|
||||
stateHigh: "liquid",
|
||||
tempLow: -20,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1395,
|
||||
stain: 0.2
|
||||
};
|
||||
elements.crunchy_slime = {
|
||||
color: "#00BFFF",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 30000,
|
||||
tempHigh: -20,
|
||||
stateHigh: "liquid",
|
||||
tempLow: -25,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 2050,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.sizzling_slime = {
|
||||
color: "#FFA07A",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 35000,
|
||||
tempHigh: -25,
|
||||
stateHigh: "liquid",
|
||||
tempLow: -30,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1463,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.spider_webbing = {
|
||||
color: "#FFFFFF",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 5000,
|
||||
tempHigh: 25,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1100,
|
||||
stain: 0.05
|
||||
};
|
||||
elements.webbing_gel = {
|
||||
color: "#FFD700",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 7000,
|
||||
tempHigh: 30,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1200,
|
||||
stain: 0.08
|
||||
};
|
||||
elements.arachnid_slime = {
|
||||
color: "#00FF00",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 8000,
|
||||
tempHigh: 35,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1250,
|
||||
stain: 0.1
|
||||
};
|
||||
elements.sticky_silk = {
|
||||
color: "#FFFACD",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 6000,
|
||||
tempHigh: 40,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1300,
|
||||
stain: 0.12
|
||||
};
|
||||
elements.webbing_solution = {
|
||||
color: "#FFA07A",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9000,
|
||||
tempHigh: 45,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1350,
|
||||
stain: 0.15
|
||||
};
|
||||
elements.arachnid_resin = {
|
||||
color: "#FF00FF",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 7500,
|
||||
tempHigh: 50,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1400,
|
||||
stain: 0.18
|
||||
};
|
||||
elements.spider_snot = {
|
||||
color: "#7FFFD4",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 8500,
|
||||
tempHigh: 55,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1450,
|
||||
stain: 0.2
|
||||
};
|
||||
elements.arachnid_ooze = {
|
||||
color: "#6495ED",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9500,
|
||||
tempHigh: 60,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1325,
|
||||
stain: 0.22
|
||||
};
|
||||
elements.sticky_spider_goo = {
|
||||
color: "#8A2BE2",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 8500,
|
||||
tempHigh: 65,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1350,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.arachnid_sludge = {
|
||||
color: "#FF4500",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 8000,
|
||||
tempHigh: 70,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1142,
|
||||
stain: 0.28
|
||||
};
|
||||
elements.spider_secretion = {
|
||||
color: "#FFFF00",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9000,
|
||||
tempHigh: 75,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1464,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.arachnid_essence = {
|
||||
color: "#800080",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 8500,
|
||||
tempHigh: 80,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1325,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.sticky_spider_residue = {
|
||||
color: "#8B4513",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9500,
|
||||
tempHigh: 85,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1499,
|
||||
stain: 0.28
|
||||
};
|
||||
elements.arachnid_phlegm = {
|
||||
color: "#32CD32",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9000,
|
||||
tempHigh: 90,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1345,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.sticky_spider_slime = {
|
||||
color: "#800000",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9000,
|
||||
tempHigh: 105,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1431,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.arachnid_mucus = {
|
||||
color: "#FF1493",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9500,
|
||||
tempHigh: 110,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 2000,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.spider_secretion = {
|
||||
color: "#32CD32",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9000,
|
||||
tempHigh: 115,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 2050,
|
||||
stain: 0.28
|
||||
};
|
||||
elements.arachnid_excretion = {
|
||||
color: "#FF4500",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 8500,
|
||||
tempHigh: 120,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 2100,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.sticky_spider_ooze = {
|
||||
color: "#00008B",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9000,
|
||||
tempHigh: 125,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 2150,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.arachnid_liquid = {
|
||||
color: "#FFFF00",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9500,
|
||||
tempHigh: 130,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 2200,
|
||||
stain: 0.28
|
||||
};
|
||||
elements.swamp_slime = {
|
||||
color: "#32CD32",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9000,
|
||||
tempHigh: 30,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1450,
|
||||
stain: 0.2
|
||||
};
|
||||
elements.muddy_swamp_water = {
|
||||
color: "#8B4513",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 9500,
|
||||
tempHigh: 35,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1500,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.swamp_sludge = {
|
||||
color: "#556B2F",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10000,
|
||||
tempHigh: 40,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1550,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.boggy_mud = {
|
||||
color: "#6B8E23",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 10500,
|
||||
tempHigh: 45,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1600,
|
||||
stain: 0.2
|
||||
};
|
||||
elements.swamp_ooze = {
|
||||
color: "#32CD32",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 11000,
|
||||
tempHigh: 50,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1650,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.sludgy_swamp_mixture = {
|
||||
color: "#556B2F",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 11500,
|
||||
tempHigh: 55,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1700,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.marshy_slime = {
|
||||
color: "#8B4513",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 12000,
|
||||
tempHigh: 60,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1750,
|
||||
stain: 0.2
|
||||
};
|
||||
elements.soggy_bog = {
|
||||
color: "#6B8E23",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 12500,
|
||||
tempHigh: 65,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1800,
|
||||
stain: 0.25
|
||||
};
|
||||
elements.mossy_swamp_water = {
|
||||
color: "#32CD32",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 13000,
|
||||
tempHigh: 70,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1850,
|
||||
stain: 0.3
|
||||
};
|
||||
elements.murky_marsh_mixture = {
|
||||
color: "#556B2F",
|
||||
behavior: elements.slime.behavior,
|
||||
viscosity: 13500,
|
||||
tempHigh: 75,
|
||||
stateHigh: "liquid",
|
||||
tempLow: 0,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1900,
|
||||
stain: 0.2
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,7 +18,37 @@ function getRGB(rgb){
|
|||
let rgb2 = rgb.replace(")", "").replace("rgb(", "").replace(/,/g, "r").split("r")
|
||||
return { r: parseInt(rgb2[0]), g: parseInt(rgb2[1]), b: parseInt(rgb2[2]) };
|
||||
}
|
||||
|
||||
function findMostFrequent(arr) {
|
||||
let freqMap = {};
|
||||
|
||||
if (arr) {
|
||||
if (arr.length === 0) {
|
||||
return "water";
|
||||
} else if (arr.length === 1) {
|
||||
return arr[0]
|
||||
} else {
|
||||
arr.forEach(item => {
|
||||
if(!freqMap[item]) {
|
||||
freqMap[item] = 0;
|
||||
}
|
||||
freqMap[item]++;
|
||||
});
|
||||
|
||||
let max = 0;
|
||||
let mostFrequent = [];
|
||||
|
||||
for (let item in freqMap) {
|
||||
if (freqMap[item] > max) {
|
||||
max = freqMap[item];
|
||||
mostFrequent = [item];
|
||||
} else if (freqMap[item] === max) {
|
||||
mostFrequent.push(item);
|
||||
}
|
||||
}
|
||||
return mostFrequent.join(', ');
|
||||
}
|
||||
}
|
||||
}
|
||||
behaviors.STURDYPOWDER2 = [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
|
|
@ -39,25 +69,21 @@ elements.knife = {
|
|||
//changePixel(pixel, cutInto)
|
||||
if (shiftDown) {
|
||||
if (Math.random() < 0.5) {
|
||||
changePixel(pixel, cutInto)
|
||||
var cutIntoEmit = elements[pixel.element].cutIntoEmit;
|
||||
if (!cutIntoEmit) { return };
|
||||
if(cutIntoEmit instanceof Array) { cutIntoEmit = cutIntoEmit[Math.floor(Math.random() * cutIntoEmit.length)] };
|
||||
var thiselement = pixel.element;
|
||||
if (elements[thiselement].cutIntoEmit && Math.random() < 0.7 && isEmpty(pixel.x,pixel.y-1)) {
|
||||
createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1);
|
||||
changePixel(pixel, cutInto)
|
||||
pixelTempCheck(pixel);
|
||||
if (elements[thiselement].cutIntoColor) {
|
||||
pixel.color = pixelColorPick(pixel, elements[thiselement].cutIntoColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!shiftDown) {
|
||||
if (Math.random() < 0.1) {
|
||||
changePixel(pixel, cutInto)
|
||||
var cutIntoEmit = elements[pixel.element].cutIntoEmit;
|
||||
if (!cutIntoEmit) { return };
|
||||
if(cutIntoEmit instanceof Array) { cutIntoEmit = cutIntoEmit[Math.floor(Math.random() * cutIntoEmit.length)] };
|
||||
var thiselement = pixel.element;
|
||||
if (elements[thiselement].cutIntoEmit && Math.random() < 0.4 && isEmpty(pixel.x,pixel.y-1)) {
|
||||
createPixel(elements[thiselement].cutIntoEmit,pixel.x,pixel.y-1);
|
||||
changePixel(pixel, cutInto)
|
||||
pixelTempCheck(pixel);
|
||||
if (elements[thiselement].cutIntoColor) {
|
||||
pixel.color = pixelColorPick(pixel, elements[thiselement].cutIntoColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -422,6 +448,10 @@ elements.soup = {
|
|||
if (Math.random() < 0.5) { deletePixel(ingredient.x, ingredient.y); }
|
||||
else {
|
||||
ingredient.color = pixelColorPick(ingredient, hex);
|
||||
if (!ingredient.elemlist){
|
||||
ingredient.elemlist = [];
|
||||
}
|
||||
ingredient.elemlist.push(soup.elemlist[Math.floor(Math.random() * soup.elemlist.length)])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -439,6 +469,13 @@ elements.soup = {
|
|||
}
|
||||
}
|
||||
},
|
||||
hoverStat: function(soup, ingredient) {
|
||||
if (findMostFrequent(soup.elemlist) == undefined) {
|
||||
return "Ingredients:None"
|
||||
} else {
|
||||
return "Ingredients:"+findMostFrequent(soup.elemlist)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
if (!elements.broth.reactions) elements.broth.reactions = {};
|
||||
|
|
@ -6586,6 +6623,7 @@ elements.durian = {
|
|||
cutInto: "cut_durian",
|
||||
state: "solid",
|
||||
density: 1050,
|
||||
breakInto: "durian_juice"
|
||||
}
|
||||
|
||||
elements.cut_durian = {
|
||||
|
|
@ -6601,6 +6639,7 @@ elements.cut_durian = {
|
|||
hidden: true,
|
||||
freezeDryInto: "freeze_dried_fruits",
|
||||
freezeDryIntoColor: "#a19f3b",
|
||||
breakInto: "durian_juice"
|
||||
}
|
||||
|
||||
elements.durian_seed = {
|
||||
|
|
@ -6649,6 +6688,32 @@ elements.durian_seed = {
|
|||
"XX|M1|XX",
|
||||
],
|
||||
};
|
||||
|
||||
elements.durian_juice = {
|
||||
color: "#ebe06e",
|
||||
onMix: function(pixel) {
|
||||
if (shiftDown) {
|
||||
if (Math.random() < 0.2) {
|
||||
changePixel(pixel,"juice")
|
||||
pixel.color = pixelColorPick(pixel,"#ebe06e")
|
||||
}
|
||||
}
|
||||
},
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "liquids",
|
||||
tempHigh: 100,
|
||||
stateHigh: ["steam","sugar"],
|
||||
burn: 70,
|
||||
burnTime: 300,
|
||||
burnInto: ["steam", "smoke"],
|
||||
state: "liquid",
|
||||
density: 825,
|
||||
hidden: true,
|
||||
temp: 30,
|
||||
hidden: true,
|
||||
tempLow: 0,
|
||||
};
|
||||
eLists.JUICEMIXABLE.push("durian_juice");
|
||||
elements.egg_white = {
|
||||
color: "#edece8",
|
||||
behavior: behaviors.LIQUID,
|
||||
|
|
@ -7613,6 +7678,7 @@ elements.unripe_rambutan = {
|
|||
cutInto: "cut_rambutan",
|
||||
state: "solid",
|
||||
density: 1050,
|
||||
breakInto: "rambutan_juice"
|
||||
}
|
||||
|
||||
elements.rambutan = {
|
||||
|
|
@ -7626,7 +7692,7 @@ elements.rambutan = {
|
|||
state: "solid",
|
||||
density: 1050,
|
||||
cutInto: "cut_rambutan",
|
||||
hidden: true,
|
||||
breakInto: "rambutan_juice"
|
||||
}
|
||||
|
||||
elements.cut_rambutan = {
|
||||
|
|
@ -7642,6 +7708,7 @@ elements.cut_rambutan = {
|
|||
hidden: true,
|
||||
freezeDryInto: "freeze_dried_fruits",
|
||||
freezeDryIntoColor: "#a19f3b",
|
||||
breakInto: "rambutan_juice"
|
||||
}
|
||||
|
||||
elements.rambutan_seed = {
|
||||
|
|
@ -7691,6 +7758,32 @@ elements.rambutan_seed = {
|
|||
],
|
||||
};
|
||||
|
||||
elements.rambutan_juice = {
|
||||
color: "#f7f4cb",
|
||||
onMix: function(pixel) {
|
||||
if (shiftDown) {
|
||||
if (Math.random() < 0.2) {
|
||||
changePixel(pixel,"juice")
|
||||
pixel.color = pixelColorPick(pixel,"#f7f4cb")
|
||||
}
|
||||
}
|
||||
},
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "liquids",
|
||||
tempHigh: 100,
|
||||
stateHigh: ["steam","sugar"],
|
||||
burn: 70,
|
||||
burnTime: 300,
|
||||
burnInto: ["steam", "smoke"],
|
||||
state: "liquid",
|
||||
density: 825,
|
||||
hidden: true,
|
||||
temp: 30,
|
||||
hidden: true,
|
||||
tempLow: 0,
|
||||
};
|
||||
eLists.JUICEMIXABLE.push("rambutan_juice");
|
||||
|
||||
elements.barbecued_shrimp = {
|
||||
color:["#bf743b", "#b57026","#8f5e29","#a87b11"],
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
|
|
@ -7829,6 +7922,26 @@ elements.raisin = {
|
|||
isFood: true
|
||||
}
|
||||
|
||||
elements.fruit_slush = {
|
||||
color: "#ed93a4",
|
||||
behavior: behaviors.LIQUID,
|
||||
reactions: {
|
||||
"dirt": { elem1: null, elem2: "mud" },
|
||||
"sand": { elem1: null, elem2: "wet_sand" },
|
||||
"uranium": { elem1:"dirty_water", chance:0.25 },
|
||||
},
|
||||
temp: -5,
|
||||
tempHigh: 18,
|
||||
tempLow: -20,
|
||||
stateLow: "juice_ice",
|
||||
stateHigh: "juice",
|
||||
category: "food",
|
||||
state: "liquid",
|
||||
density: 95,
|
||||
viscosity: 100,
|
||||
hidden: true
|
||||
}
|
||||
|
||||
// things to mix: juice, water, seltzer, sugar water, soda, juice, milk, cream,
|
||||
// juice, milk, chocolate milk, fruit milk, eggnog, nut milk, alcohol, wine, tea,
|
||||
// tea, coffee, honey, caramel, vanilla essence, peppermint tea, sugar, yogurt,
|
||||
|
|
@ -7836,9 +7949,9 @@ elements.raisin = {
|
|||
|
||||
// juice mixing
|
||||
for (let juicei = 0; juicei < eLists.JUICEMIXABLE.length; juicei++) {
|
||||
elem = eLists.JUICEMIXABLE[juicei];
|
||||
// juice with juice
|
||||
for (let juicej = 0; juicej < eLists.JUICEMIXABLE.length; juicej++) {
|
||||
elem = eLists.JUICEMIXABLE[juicei];
|
||||
elem2 = eLists.JUICEMIXABLE[juicej];
|
||||
if (elem != elem2) {
|
||||
if (!elements[elem].reactions) { chance:1, elements[elem].reactions = {} }
|
||||
|
|
@ -7909,6 +8022,19 @@ for (let juicei = 0; juicei < eLists.JUICEMIXABLE.length; juicei++) {
|
|||
pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
}}
|
||||
}
|
||||
|
||||
iceelem = elem+"_ice"
|
||||
// ice slush
|
||||
elements[elem].stateLowColorMultiplier = 1.2;
|
||||
elements[elem].tempLow = 10;
|
||||
elements.fruit_slush.stateHighColorMultiplier = 0.83333333333;
|
||||
elements.fruit_slush.stateLowColorMultiplier = 1.2;
|
||||
elements.juice_ice.stateHighColorMultiplier = 0.83333333333;
|
||||
elements.juice_ice.stateHigh = "fruit_slush"
|
||||
elements.juice_ice.tempHigh = -20
|
||||
elements[iceelem].stateHigh = "fruit_slush"
|
||||
elements[iceelem].tempHigh = -20
|
||||
|
||||
// fruit milk with milk
|
||||
elements.fruit_milk.reactions.milk = { chance:1, func: function(pixel1, pixel2){
|
||||
let newrgb = interpolateRgb(getRGB(pixel1.color), getRGB(pixel2.color), 0.2);
|
||||
|
|
@ -7982,3 +8108,25 @@ elements.fruit_milk.reactions.fruit_milk = { chance:1, func: function(pixel1, pi
|
|||
pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
}
|
||||
}
|
||||
// fruit milk onMix
|
||||
elements.fruit_milk.onMix = function(pixel){
|
||||
let num = Math.floor(Math.random() * 4);
|
||||
let x = pixel.x + adjacentCoords[num][0];
|
||||
let y = pixel.y + adjacentCoords[num][1];
|
||||
if(!isEmpty(x,y) && !outOfBounds(x,y)){
|
||||
let pixel2 = pixelMap[x][y];
|
||||
if(pixel.color != pixel2.color && pixel2.element == "fruit_milk"){
|
||||
let condition;
|
||||
if(shiftDown == 0){
|
||||
condition = (Math.floor(Math.random() * 2) == 1);
|
||||
} else {
|
||||
condition = true;
|
||||
}
|
||||
if(condition){
|
||||
let newrgb = interpolateRgb(getRGB(pixel.color), getRGB(pixel2.color), 0.5);
|
||||
pixel.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
pixel2.color = `rgb(${parseInt(newrgb.r)},${parseInt(newrgb.g)},${parseInt(newrgb.b)})`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,15 +69,15 @@ let cssForDebug = `
|
|||
}
|
||||
`,
|
||||
head = document.head || document.getElementsByTagName('head')[0],
|
||||
style = document.createElement('style');
|
||||
styleElem = document.createElement('style');
|
||||
|
||||
head.appendChild(style);
|
||||
head.appendChild(styleElem);
|
||||
|
||||
style.type = 'text/css';
|
||||
if (style.styleSheet) {
|
||||
style.styleSheet.cssText = cssForDebug;
|
||||
styleElem.type = 'text/css';
|
||||
if (styleElem.styleSheet) {
|
||||
styleElem.styleSheet.cssText = cssForDebug;
|
||||
} else {
|
||||
style.appendChild(document.createTextNode(cssForDebug));
|
||||
styleElem.appendChild(document.createTextNode(cssForDebug));
|
||||
};
|
||||
let debugMenu = document.createElement("div");
|
||||
debugMenu.innerHTML = `
|
||||
|
|
|
|||
|
|
@ -0,0 +1,245 @@
|
|||
elements.fossil = {
|
||||
color: ["#bbb3ae","#b4b4b4","#c0c0c0"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2%75|M1|M2%75",
|
||||
],
|
||||
reactions: {
|
||||
"water": {elem1: "wet_sand", chance: 0.00035},
|
||||
"salt_water": {elem1: "wet_sand", chance: 0.0005},
|
||||
"sugar_water": {elem1: "wet_sand", chance: 0.0004},
|
||||
"seltzer": {elem1: "wet_sand", chance: 0.0004},
|
||||
"dirty_water": {elem1: "wet_sand", chance: 0.0004},
|
||||
"soda": {elem1: "wet_sand", chance: 0.0004},
|
||||
"lichen": {elem1: "dirt", chance: 0.0025},
|
||||
"bone": {elem2: "fossil", chance: 0.000025},
|
||||
"bone_marrow": {elem2: "marrow_fossil", chance: 0.00002},
|
||||
"skull": {elem2: ["human_fossil","human_fossil","fossil"], chance: 0.000025},
|
||||
"wood": {elem2: "petrified_wood", chance: 0.000015},
|
||||
"tree_branch": {elem2: "petrified_wood", chance: 0.000015},
|
||||
"grape": {elem2: "juice", chance: 0.1, color2: "#291824"},
|
||||
"wheat": {elem2: "flour"},
|
||||
"primordial_soup": {elem1: "wet_sand", chance: 0.001}
|
||||
},
|
||||
tempHigh: 950,
|
||||
stateHigh: "magma",
|
||||
category: "life",
|
||||
state: "solid",
|
||||
density: 2600,
|
||||
hardness: 0.55,
|
||||
breakInto: ["rock","gravel","gravel","gravel","sand"],
|
||||
};
|
||||
|
||||
elements.marrow_fossil = {
|
||||
color: ["#cbb2b3","#c1a8a8","#d0b0b0"],
|
||||
hidden:true,
|
||||
behavior: behaviors.SUPPORTPOWDER,
|
||||
reactions: {
|
||||
"water": {elem1: "wet_sand", chance: 0.00035},
|
||||
"salt_water": {elem1: "wet_sand", chance: 0.0005},
|
||||
"sugar_water": {elem1: "wet_sand", chance: 0.0004},
|
||||
"seltzer": {elem1: "wet_sand", chance: 0.0004},
|
||||
"dirty_water": {elem1: "wet_sand", chance: 0.0004},
|
||||
"soda": {elem1: "wet_sand", chance: 0.0004},
|
||||
"lichen": {elem1: "dirt", chance: 0.0025},
|
||||
"bone": {elem2: "fossil", chance: 0.000025},
|
||||
"bone_marrow": {elem2: "marrow_fossil", chance: 0.00002},
|
||||
"skull": {elem2: ["human_fossil","human_fossil","fossil"], chance: 0.000025},
|
||||
"wood": {elem2: "petrified_wood", chance: 0.000015},
|
||||
"tree_branch": {elem2: "petrified_wood", chance: 0.000015},
|
||||
"grape": {elem2: "juice", chance: 0.1, color2: "#291824"},
|
||||
"wheat": {elem2: "flour"},
|
||||
"primordial_soup": {elem1: "wet_sand", chance: 0.001}
|
||||
},
|
||||
tempHigh: 950,
|
||||
stateHigh: "magma",
|
||||
category: "life",
|
||||
state: "solid",
|
||||
density: 2550,
|
||||
hardness: 0.55,
|
||||
breakInto: ["rock","gravel","gravel","gravel","sand"],
|
||||
};
|
||||
|
||||
elements.human_fossil = {
|
||||
color: ["#bbb3ae","#b4b4b4","#c0c0c0"],
|
||||
hidden:true,
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2%50|M1|M2%50",
|
||||
],
|
||||
reactions: {
|
||||
"water": {elem1: "wet_sand", chance: 0.00035},
|
||||
"salt_water": {elem1: "wet_sand", chance: 0.0005},
|
||||
"sugar_water": {elem1: "wet_sand", chance: 0.0004},
|
||||
"seltzer": {elem1: "wet_sand", chance: 0.0004},
|
||||
"dirty_water": {elem1: "wet_sand", chance: 0.0004},
|
||||
"soda": {elem1: "wet_sand", chance: 0.0004},
|
||||
"lichen": {elem1: "dirt", chance: 0.0025},
|
||||
"bone": {elem2: "fossil", chance: 0.000025},
|
||||
"bone_marrow": {elem2: "marrow_fossil", chance: 0.00002},
|
||||
"skull": {elem2: ["human_fossil","human_fossil","fossil"], chance: 0.000025},
|
||||
"wood": {elem2: "petrified_wood", chance: 0.000015},
|
||||
"tree_branch": {elem2: "petrified_wood", chance: 0.000015},
|
||||
"grape": {elem2: "juice", chance: 0.1, color2: "#291824"},
|
||||
"wheat": {elem2: "flour"},
|
||||
"primordial_soup": {elem1: "wet_sand", chance: 0.001}
|
||||
},
|
||||
tempHigh: 950,
|
||||
stateHigh: "magma",
|
||||
category: "life",
|
||||
state: "solid",
|
||||
density: 2600,
|
||||
hardness: 0.55,
|
||||
breakInto: ["rock","gravel","gravel","gravel","sand"],
|
||||
};
|
||||
|
||||
elements.petrified_wood = {
|
||||
color: ["#4e4e3e","#464646","#52533a"],
|
||||
hidden:true,
|
||||
behavior: behaviors.STURDYPOWDER,
|
||||
reactions: {
|
||||
"water": {elem1: "wet_sand", chance: 0.00035},
|
||||
"salt_water": {elem1: "wet_sand", chance: 0.0005},
|
||||
"sugar_water": {elem1: "wet_sand", chance: 0.0004},
|
||||
"seltzer": {elem1: "wet_sand", chance: 0.0004},
|
||||
"dirty_water": {elem1: "wet_sand", chance: 0.0004},
|
||||
"soda": {elem1: "wet_sand", chance: 0.0004},
|
||||
"lichen": {elem1: "dirt", chance: 0.0025},
|
||||
"bone": {elem2: "fossil", chance: 0.000025},
|
||||
"bone_marrow": {elem2: "marrow_fossil", chance: 0.00002},
|
||||
"skull": {elem2: ["human_fossil","human_fossil","fossil"], chance: 0.000025},
|
||||
"wood": {elem2: "petrified_wood", chance: 0.000015},
|
||||
"tree_branch": {elem2: "petrified_wood", chance: 0.000015},
|
||||
"grape": {elem2: "juice", chance: 0.1, color2: "#291824"},
|
||||
"wheat": {elem2: "flour"},
|
||||
"primordial_soup": {elem1: "wet_sand", chance: 0.001}
|
||||
},
|
||||
tempHigh: 950,
|
||||
stateHigh: "magma",
|
||||
category: "life",
|
||||
state: "solid",
|
||||
density: 2600,
|
||||
breakInto: ["rock","rock","gravel","gravel","gravel","gravel","gravel","sawdust"],
|
||||
};
|
||||
|
||||
elements.skull = {
|
||||
color: "#d9d9d9",
|
||||
hidden:true,
|
||||
behavior: behaviors.SUPPORT,
|
||||
reactions: {
|
||||
"water": { elem2:"broth", tempMin:70, color2:"#d7db69" },
|
||||
"salt_water": { elem2:"broth", tempMin:70, color2:"#d7db69" },
|
||||
"sugar_water": { elem2:"broth", tempMin:70, color2:"#d7db69" },
|
||||
"seltzer": { elem2:"broth", tempMin:70, color2:"#d7db69" },
|
||||
"rock": { "elem1": "fossil", chance:0.00005 },
|
||||
"sand": { "elem1": "fossil", chance:0.000035 },
|
||||
"dirt": { "elem1": "fossil", chance:0.00003 },
|
||||
"tuff": { "elem1": "fossil", chance:0.00005 },
|
||||
"basalt": { "elem1": "fossil", chance:0.00004 },
|
||||
"mudstone": { "elem1": "fossil", chance:0.00004 },
|
||||
"packed_sand": { "elem1": "fossil", chance:0.00004 },
|
||||
"gravel": { "elem1": "fossil", chance:0.000035 },
|
||||
"clay": { "elem1": "fossil", chance:0.00003 },
|
||||
"clay_soil": { "elem1": "fossil", chance:0.00003 },
|
||||
"permafrost": { "elem1": "fossil", chance:0.000035 },
|
||||
"mulch": { "elem1": "fossil", chance:0.00003 },
|
||||
"ant_wall": { "elem1": "fossil", chance:0.00002 },
|
||||
"limestone": { "elem1": "fossil", chance:0.00005 },
|
||||
"quicklime": { "elem1": "fossil", chance:0.000045 },
|
||||
"slaked_lime": { "elem1": "fossil", chance:0.000035 },
|
||||
},
|
||||
category:"life",
|
||||
tempHigh: 760,
|
||||
stateHigh: "quicklime",
|
||||
state: "solid",
|
||||
density: 1500,
|
||||
hardness: 0.5,
|
||||
breakInto: ["quicklime","bone","bone","bone_marrow"]
|
||||
},
|
||||
|
||||
elements.head.breakInto = ["blood","meat","skull"]
|
||||
|
||||
elements.dead_bug.breakInto = ["calcium","calcium","calcium","quicklime"]
|
||||
|
||||
elements.amber.breakInto = ["dna","dna","sap","sap","sap","sap","sap","dead_bug"]
|
||||
|
||||
elements.amber.tempHigh = 185
|
||||
|
||||
elements.amber.stateHigh = ["sap","sap","sap","calcium","sugar"]
|
||||
|
||||
if (!elements.bone.reactions) { elements.bone.reactions = {} }
|
||||
elements.bone.reactions.rock = { "elem1": "fossil", chance:0.00005 };
|
||||
elements.bone.reactions.sand = { "elem1": "fossil", chance:0.000035 };
|
||||
elements.bone.reactions.dirt = { "elem1": "fossil", chance:0.00003 };
|
||||
elements.bone.reactions.tuff = { "elem1": "fossil", chance:0.00005 };
|
||||
elements.bone.reactions.basalt = { "elem1": "fossil", chance:0.00004 };
|
||||
elements.bone.reactions.mudstone = { "elem1": "fossil", chance:0.00004 };
|
||||
elements.bone.reactions.packed_sand = { "elem1": "fossil", chance:0.00004 };
|
||||
elements.bone.reactions.gravel = { "elem1": "fossil", chance:0.000035 };
|
||||
elements.bone.reactions.clay = { "elem1": "fossil", chance:0.00003 };
|
||||
elements.bone.reactions.clay_soil = { "elem1": "fossil", chance:0.00003 };
|
||||
elements.bone.reactions.permafrost = { "elem1": "fossil", chance:0.000035 };
|
||||
elements.bone.reactions.mulch = { "elem1": "fossil", chance:0.00003 };
|
||||
elements.bone.reactions.ant_wall = { "elem1": "fossil", chance:0.00002 };
|
||||
elements.bone.reactions.limestone = { "elem1": "fossil", chance:0.00005 };
|
||||
elements.bone.reactions.quicklime = { "elem1": "fossil", chance:0.000045 };
|
||||
elements.bone.reactions.slaked_lime = { "elem1": "fossil", chance:0.000035 };
|
||||
|
||||
|
||||
if (!elements.bone_marrow.reactions) { elements.bone_marrow.reactions = {} }
|
||||
elements.bone_marrow.reactions.rock = { "elem1": "marrow_fossil", chance:0.00005 };
|
||||
elements.bone_marrow.reactions.sand = { "elem1": "marrow_fossil", chance:0.000035 };
|
||||
elements.bone_marrow.reactions.dirt = { "elem1": "marrow_fossil", chance:0.00003 };
|
||||
elements.bone_marrow.reactions.tuff = { "elem1": "marrow_fossil", chance:0.00005 };
|
||||
elements.bone_marrow.reactions.basalt = { "elem1": "marrow_fossil", chance:0.00004 };
|
||||
elements.bone_marrow.reactions.mudstone = { "elem1": "marrow_fossil", chance:0.00004 };
|
||||
elements.bone_marrow.reactions.packed_sand = { "elem1": "marrow_fossil", chance:0.00004 };
|
||||
elements.bone_marrow.reactions.gravel = { "elem1": "marrow_fossil", chance:0.000035 };
|
||||
elements.bone_marrow.reactions.clay = { "elem1": "marrow_fossil", chance:0.00003 };
|
||||
elements.bone_marrow.reactions.clay_soil = { "elem1": "marrow_fossil", chance:0.00003 };
|
||||
elements.bone_marrow.reactions.permafrost = { "elem1": "marrow_fossil", chance:0.000035 };
|
||||
elements.bone_marrow.reactions.mulch = { "elem1": "marrow_fossil", chance:0.00003 };
|
||||
elements.bone_marrow.reactions.ant_wall = { "elem1": "marrow_fossil", chance:0.00002 };
|
||||
elements.bone_marrow.reactions.limestone = { "elem1": "marrow_fossil", chance:0.00005 };
|
||||
elements.bone_marrow.reactions.quicklime = { "elem1": "marrow_fossil", chance:0.000045 };
|
||||
elements.bone_marrow.reactions.slaked_lime = { "elem1": "marrow_fossil", chance:0.000035 };
|
||||
|
||||
|
||||
if (!elements.wood.reactions) { elements.wood.reactions = {} }
|
||||
elements.wood.reactions.rock = { "elem1": "petrified_wood", chance:0.000045 };
|
||||
elements.wood.reactions.sand = { "elem1": "petrified_wood", chance:0.00003 };
|
||||
elements.wood.reactions.dirt = { "elem1": "petrified_wood", chance:0.000025 };
|
||||
elements.wood.reactions.tuff = { "elem1": "petrified_wood", chance:0.000045 };
|
||||
elements.wood.reactions.basalt = { "elem1": "petrified_wood", chance:0.000035 };
|
||||
elements.wood.reactions.mudstone = { "elem1": "petrified_wood", chance:0.000035 };
|
||||
elements.wood.reactions.packed_sand = { "elem1": "petrified_wood", chance:0.000035 };
|
||||
elements.wood.reactions.gravel = { "elem1": "petrified_wood", chance:0.00003 };
|
||||
elements.wood.reactions.clay = { "elem1": "petrified_wood", chance:0.000025 };
|
||||
elements.wood.reactions.clay_soil = { "elem1": "petrified_wood", chance:0.000025 };
|
||||
elements.wood.reactions.permafrost = { "elem1": "petrified_wood", chance:0.00003 };
|
||||
elements.wood.reactions.mulch = { "elem1": "petrified_wood", chance:0.000025 };
|
||||
elements.wood.reactions.ant_wall = { "elem1": "petrified_wood", chance:0.000015 };
|
||||
elements.wood.reactions.limestone = { "elem1": "petrified_wood", chance:0.000045 };
|
||||
elements.wood.reactions.quicklime = { "elem1": "petrified_wood", chance:0.00004 };
|
||||
elements.wood.reactions.slaked_lime = { "elem1": "petrified_wood", chance:0.00003 };
|
||||
|
||||
|
||||
if (!elements.tree_branch.reactions) { elements.tree_branch.reactions = {} }
|
||||
elements.tree_branch.reactions.rock = { "elem1": "petrified_wood", chance:0.00005 };
|
||||
elements.tree_branch.reactions.sand = { "elem1": "petrified_wood", chance:0.000035 };
|
||||
elements.tree_branch.reactions.dirt = { "elem1": "petrified_wood", chance:0.00003 };
|
||||
elements.tree_branch.reactions.tuff = { "elem1": "petrified_wood", chance:0.00005 };
|
||||
elements.tree_branch.reactions.basalt = { "elem1": "petrified_wood", chance:0.00004 };
|
||||
elements.tree_branch.reactions.mudstone = { "elem1": "petrified_wood", chance:0.00004 };
|
||||
elements.tree_branch.reactions.packed_sand = { "elem1": "petrified_wood", chance:0.00004 };
|
||||
elements.tree_branch.reactions.gravel = { "elem1": "petrified_wood", chance:0.000035 };
|
||||
elements.tree_branch.reactions.clay = { "elem1": "petrified_wood", chance:0.00003 };
|
||||
elements.tree_branch.reactions.clay_soil = { "elem1": "petrified_wood", chance:0.00003 };
|
||||
elements.tree_branch.reactions.permafrost = { "elem1": "petrified_wood", chance:0.000035 };
|
||||
elements.tree_branch.reactions.mulch = { "elem1": "petrified_wood", chance:0.00003 };
|
||||
elements.tree_branch.reactions.ant_wall = { "elem1": "petrified_wood", chance:0.00002 };
|
||||
elements.tree_branch.reactions.limestone = { "elem1": "petrified_wood", chance:0.00005 };
|
||||
elements.tree_branch.reactions.quicklime = { "elem1": "petrified_wood", chance:0.000045 };
|
||||
elements.tree_branch.reactions.slaked_lime = { "elem1": "petrified_wood", chance:0.000035 };
|
||||
|
|
@ -377,7 +377,7 @@ elements.destroyable_pipe = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (!pixel.con && elements[newPixel.element].movable) { //suck up pixel
|
||||
else if (!pixel.con && elements[newPixel.element].movable && newPixel.element != "ray") { //suck up pixel
|
||||
pixel.con = newPixel;
|
||||
deletePixel(newPixel.x,newPixel.y);
|
||||
pixel.con.x = pixel.x;
|
||||
|
|
@ -688,7 +688,7 @@ elements.e_pipe = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (!pixel.con && elements[newPixel.element].movable && (pixel.charge || pixel.chargeCD)) { //suck up pixel
|
||||
else if (!pixel.con && elements[newPixel.element].movable && (pixel.charge || pixel.chargeCD) && newPixel.element != "ray") { //suck up pixel
|
||||
pixel.con = newPixel;
|
||||
deletePixel(newPixel.x,newPixel.y);
|
||||
pixel.con.x = pixel.x;
|
||||
|
|
@ -806,7 +806,7 @@ elements.destroyable_e_pipe = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (!pixel.con && elements[newPixel.element].movable && (pixel.charge || pixel.chargeCD)) { //suck up pixel
|
||||
else if (!pixel.con && elements[newPixel.element].movable && (pixel.charge || pixel.chargeCD) && newPixel.element != "ray" ) { //suck up pixel
|
||||
pixel.con = newPixel;
|
||||
deletePixel(newPixel.x,newPixel.y);
|
||||
pixel.con.x = pixel.x;
|
||||
|
|
@ -933,7 +933,7 @@ elements.channel_pipe = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (!pixel.con && elements[newPixel.element].movable) { //suck up pixel
|
||||
else if (!pixel.con && elements[newPixel.element].movable && newPixel.element != "ray") { //suck up pixel
|
||||
pixel.con = newPixel;
|
||||
deletePixel(newPixel.x,newPixel.y);
|
||||
pixel.con.x = pixel.x;
|
||||
|
|
@ -1056,7 +1056,7 @@ elements.destroyable_channel_pipe = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (!pixel.con && elements[newPixel.element].movable) { //suck up pixel
|
||||
else if (!pixel.con && elements[newPixel.element].movable && newPixel.element != "ray") { //suck up pixel
|
||||
pixel.con = newPixel;
|
||||
deletePixel(newPixel.x,newPixel.y);
|
||||
pixel.con.x = pixel.x;
|
||||
|
|
@ -1173,7 +1173,7 @@ elements.bridge_pipe = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (!pixel.con && elements[newPixel.element].movable) { //suck up pixel
|
||||
else if (!pixel.con && elements[newPixel.element].movable && newPixel.element != "ray") { //suck up pixel
|
||||
pixel.con = newPixel;
|
||||
deletePixel(newPixel.x,newPixel.y);
|
||||
pixel.con.x = pixel.x;
|
||||
|
|
@ -1285,7 +1285,7 @@ elements.pipe.tick = function(pixel) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (!pixel.con && elements[newPixel.element].movable) { //suck up pixel
|
||||
else if (!pixel.con && elements[newPixel.element].movable && newPixel.element != "ray") { //suck up pixel
|
||||
pixel.con = newPixel;
|
||||
deletePixel(newPixel.x,newPixel.y);
|
||||
pixel.con.x = pixel.x;
|
||||
|
|
@ -2696,4 +2696,206 @@ elements.healing_serum = {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var rayElement = "ray"
|
||||
var rayStoppedByWalls = false
|
||||
elements.ray_emitter = {
|
||||
color: "#ff9c07",
|
||||
behavior: behaviors.WALL,
|
||||
category: "machines",
|
||||
movable: false,
|
||||
onSelect: function(pixel){
|
||||
var rayans = prompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
||||
if (!rayans) { return }
|
||||
rayElement = mostSimilarElement(rayans);
|
||||
var rayans2 = prompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
||||
if (rayans2 == "false"){rayStoppedByWalls = false} else {rayStoppedByWalls = true}
|
||||
},
|
||||
hoverStat: function(pixel){
|
||||
return (pixel.rayElement.toUpperCase() || "unset") + ", " + (pixel.rayStoppedByWalls.toString().toUpperCase() || "unset")
|
||||
},
|
||||
tick: function(pixel){
|
||||
if (pixelTicks == pixel.start){
|
||||
pixel.rayElement = rayElement
|
||||
pixel.rayStoppedByWalls = rayStoppedByWalls
|
||||
}
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y, true)){
|
||||
if (pixelMap[x][y].charge && pixelMap[x][y].element == "wire"){
|
||||
var dir = [0-squareCoords[i][0], 0-squareCoords[i][1]]
|
||||
var startx = pixel.x+dir[0]
|
||||
var starty = pixel.y+dir[1]
|
||||
var magnitude = 0
|
||||
if (width > height){magnitude = width} else {magnitude = height}
|
||||
var endx = startx+(magnitude*dir[0])
|
||||
var endy = starty+(magnitude*dir[1])
|
||||
// console.log("Direction seems to be " + dir)
|
||||
var jcoords = lineCoords(startx, starty, endx, endy, 1)
|
||||
// console.log(startx + " is the starting x, " + starty + " is the starting y, " + endx + " is the ending x, " + endy + " is the ending y. Result is " + jcoords)
|
||||
for (var j = 0; j < jcoords.length; j++) {
|
||||
var lcoord = jcoords[j];
|
||||
var lx = lcoord[0];
|
||||
var ly = lcoord[1];
|
||||
// console.log(lcoord)
|
||||
if (isEmpty(lx,ly)){
|
||||
createPixel(pixel.rayElement, lx, ly)
|
||||
pixelMap[lx][ly].temp = pixelMap[x][y].temp
|
||||
if (pixel.rayElement == "ray"){
|
||||
pixelMap[lx][ly].rColor = pixel.color
|
||||
pixelMap[lx][ly].color = pixel.color
|
||||
}
|
||||
} else if (!isEmpty(lx, ly, true)){
|
||||
if (pixelMap[lx][ly].element != pixel.rayElement && pixel.rayStoppedByWalls){
|
||||
break;
|
||||
} else if (pixelMap[lx][ly].element == "ray" && pixel.rayElement == "ray"){
|
||||
pixelMap[lx][ly].rColor = pixel.color
|
||||
pixelMap[lx][ly].life = 10
|
||||
pixelMap[lx][ly].color = pixel.color
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
insulate: true,
|
||||
}
|
||||
elements.indestructible_battery = {
|
||||
color: elements.battery.color,
|
||||
behavior: elements.battery.behavior,
|
||||
category: elements.battery.category
|
||||
}
|
||||
elements.ray = {
|
||||
color: "#ffffff",
|
||||
behavior: behaviors.WALL,
|
||||
movable: true,
|
||||
category: "special",
|
||||
hoverStat: function(pixel){
|
||||
return pixel.life || "unset"
|
||||
},
|
||||
properties: {
|
||||
life: 10
|
||||
},
|
||||
tick: function(pixel){
|
||||
if (pixel.rColor){
|
||||
pixel.rgb = pixel.rColor.match(/\d+/g);
|
||||
} else {
|
||||
pixel.rgb = [255,255,255]
|
||||
}
|
||||
pixel.life -= 1
|
||||
if (pixel.life < 10){
|
||||
pixel.color = "rgba("+pixel.rgb[0]+","+pixel.rgb[1]+","+pixel.rgb[2]+","+(pixel.life/10)+")"
|
||||
} else {pixel.color = "rgba("+pixel.rgb[0]+","+pixel.rgb[1]+","+pixel.rgb[2]+",1)"}
|
||||
if (pixel.life <= 0){
|
||||
deletePixel(pixel.x, pixel.y)
|
||||
}
|
||||
},
|
||||
canPlace: true,
|
||||
tool: function(pixel){
|
||||
if (pixel.element == "ray"){
|
||||
pixel.life = 10
|
||||
pixel.color = pixel.rColor
|
||||
}
|
||||
}
|
||||
}
|
||||
var specificRayStart = 0
|
||||
var specificRayEnd = 20
|
||||
var specificRayAngle = 0
|
||||
var stopAtElement = "wall"
|
||||
elements.specific_ray_emitter = {
|
||||
color: "#e73e63",
|
||||
behavior: behaviors.WALL,
|
||||
category: "machines",
|
||||
movable: false,
|
||||
onSelect: function(pixel){
|
||||
var rayans = prompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
||||
if (!rayans) { return }
|
||||
rayElement = mostSimilarElement(rayans);
|
||||
var rayans2 = prompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
||||
if (rayans2 == "false"){rayStoppedByWalls = false} else {rayStoppedByWalls = true}
|
||||
var rayans3 = prompt("How much should the beginning of the ray be offset from the emitter?", (specificRayStart||0));
|
||||
if (!rayans3) { return }
|
||||
specificRayStart = rayans3
|
||||
var rayans4 = prompt("How much should the end of the ray be offset from the emitter?", (specificRayEnd||0));
|
||||
if (!rayans4) { return }
|
||||
specificRayEnd = rayans4
|
||||
var rayans5 = prompt("What angle should the ray be emitted at? Type anything that isnt a number to use default angle logic.", (specificRayAngle||0));
|
||||
if (!rayans5) { return }
|
||||
specificRayAngle = rayans5
|
||||
if (isNaN(parseFloat(specificRayAngle))){
|
||||
specificRayAngle = "nah"
|
||||
}
|
||||
var rayans6 = prompt("What element should the ray stop at?", (stopAtElement||"wall"));
|
||||
if (!rayans6) { return }
|
||||
stopAtElement = mostSimilarElement(rayans6)
|
||||
},
|
||||
hoverStat: function(pixel){
|
||||
return (pixel.rayElement.toUpperCase() || "unset") + ", " + (pixel.rayStoppedByWalls.toString().toUpperCase() || "unset") + ", " + (pixel.specificRayStart || "unset") + ", " + (pixel.specificRayEnd || "unset") + ", " + (pixel.specificRayAngle || "unset")
|
||||
},
|
||||
tick: function(pixel){
|
||||
if (pixelTicks == pixel.start){
|
||||
pixel.rayElement = rayElement
|
||||
pixel.rayStoppedByWalls = rayStoppedByWalls
|
||||
pixel.specificRayStart = specificRayStart
|
||||
pixel.specificRayEnd = specificRayEnd
|
||||
pixel.specificRayAngle = specificRayAngle
|
||||
pixel.stopAtElement = stopAtElement
|
||||
}
|
||||
for (var i = 0; i < squareCoords.length; i++) {
|
||||
var coord = squareCoords[i];
|
||||
var x = pixel.x+coord[0];
|
||||
var y = pixel.y+coord[1];
|
||||
if (!isEmpty(x,y, true)){
|
||||
if (pixelMap[x][y].charge && pixelMap[x][y].element == "wire"){
|
||||
var dir = [0-squareCoords[i][0], 0-squareCoords[i][1]]
|
||||
let startx, starty, endx, endy, magnitude
|
||||
if (pixel.specificRayAngle == "nah"){
|
||||
startx = pixel.x+(dir[0]*specificRayStart)
|
||||
starty = pixel.y+(dir[1]*specificRayStart)
|
||||
magnitude = specificRayEnd
|
||||
endx = startx+(magnitude*dir[0])
|
||||
endy = starty+(magnitude*dir[1])
|
||||
} else {
|
||||
let angleInRadians = pixel.specificRayAngle * Math.PI / 180;
|
||||
console.log("Angle in radians is " + angleInRadians)
|
||||
dir = [(Math.cos(angleInRadians)), (Math.sin(angleInRadians))]
|
||||
startx = pixel.x+Math.round((dir[0]*specificRayStart))
|
||||
starty = pixel.y+Math.round((dir[1]*specificRayStart))
|
||||
magnitude = specificRayEnd
|
||||
endx = startx+Math.round((magnitude*dir[0]))
|
||||
endy = starty+Math.round((magnitude*dir[1]))
|
||||
}
|
||||
console.log("Direction seems to be " + dir)
|
||||
var jcoords = lineCoords(startx, starty, endx, endy, 1)
|
||||
//console.log(startx + " is the starting x, " + starty + " is the starting y, " + endx + " is the ending x, " + endy + " is the ending y. Result is " + jcoords)
|
||||
for (var j = 0; j < jcoords.length; j++) {
|
||||
var lcoord = jcoords[j];
|
||||
var lx = lcoord[0];
|
||||
var ly = lcoord[1];
|
||||
// console.log(lcoord)
|
||||
if (isEmpty(lx,ly)){
|
||||
createPixel(pixel.rayElement, lx, ly)
|
||||
pixelMap[lx][ly].temp = pixelMap[x][y].temp
|
||||
if (pixel.rayElement == "ray"){
|
||||
pixelMap[lx][ly].rColor = pixel.color
|
||||
pixelMap[lx][ly].color = pixel.color
|
||||
}
|
||||
} else if (!isEmpty(lx, ly, true)){
|
||||
if ((pixelMap[lx][ly].element != pixel.rayElement && pixel.rayStoppedByWalls) || pixelMap[lx][ly].element == pixel.stopAtElement){
|
||||
break;
|
||||
} else if (pixelMap[lx][ly].element == "ray" && pixel.rayElement == "ray"){
|
||||
pixelMap[lx][ly].rColor = pixel.color
|
||||
pixelMap[lx][ly].life = 10
|
||||
pixelMap[lx][ly].color = pixel.color
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
insulate: true,
|
||||
}
|
||||
21
mods/scp.js
21
mods/scp.js
|
|
@ -58,6 +58,8 @@ elements.SCP_008 = {
|
|||
reactions: {
|
||||
"head": { elem1:null, elem2:"z_head" , chance:0.5 },
|
||||
"body": { elem1:null, elem2:"z_body" , chance:0.5 },
|
||||
"skin": { elem1:null, elem2: ["infected_skin","infected_skin","infected_meat"] , chance:0.3 },
|
||||
"blood": { elem1:null, elem2:"infection" , chance:0.6 },
|
||||
"meat": { elem1:null, elem2:"infected_meat" , chance:0.4 },
|
||||
"rotten_meat": { elem1:null, elem2:"infected_meat" , chance:0.5 },
|
||||
"frozen_meat": { elem1:null, elem2:"frozen_infected_meat" , chance:0.3 },
|
||||
|
|
@ -84,11 +86,13 @@ elements.frozen_008 = {
|
|||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|DL%0.001|X",
|
||||
"M2%1.0|M1%1.0|M2%1.0",
|
||||
"XX|M1%1.0|XX",
|
||||
],
|
||||
reactions: {
|
||||
"head": { elem1:null, elem2:"z_head" , chance:0.4 },
|
||||
"body": { elem1:null, elem2:"z_body" , chance:0.4 },
|
||||
"skin": { elem1:null, elem2:"frozen_infected_meat" , chance:0.4 },
|
||||
"blood": { elem1:null, elem2:"infection" , chance:0.6 },
|
||||
"meat": { elem1:null, elem2:"frozen_infected_meat" , chance:0.4 },
|
||||
"rotten_meat": { elem1:null, elem2:"frozen_infected_meat" , chance:0.5 },
|
||||
"frozen_meat": { elem1:null, elem2:"frozen_infected_meat" , chance:0.4 },
|
||||
|
|
@ -108,9 +112,9 @@ elements.infected_skin = {
|
|||
color: ["#11111f","#75816B","#4D6B53"],
|
||||
singleColor: true,
|
||||
behavior: [
|
||||
"XX|CR:stench,stench,stench,SCP_008,fly%0.15 AND CH:skin,meat>infected_skin,infected_meat%1|XX",
|
||||
"CH:skin,meat>infected_skin,infected_meat%1|XX|CH:skin,meat>infected_skin,infected_meat%1",
|
||||
"XX|CH:skin,meat>infected_skin,infected_meat%1|XX",
|
||||
"XX|CR:stench,stench,stench,SCP_008,fly%0.05 AND CH:meat>infected_meat%1|XX",
|
||||
"CH:meat>infected_meat%1|XX|CH:meat>infected_meat%1",
|
||||
"M2%1.0|M1%1.0 AND CH:meat>infected_meat%1|M2%1.0",
|
||||
],
|
||||
tick: function(pixel) {
|
||||
if (pixel.temp > 40 && Math.random() < 0.003) {
|
||||
|
|
@ -136,6 +140,12 @@ elements.infected_skin = {
|
|||
pixel2.color = pixelColorPick(pixel2,RGBToHex(pixel1.color.match(/\d+/g)))
|
||||
if (pixel1.origColor) { pixel2.origColor = pixel1.origColor }
|
||||
} },
|
||||
"skin": { chance:0.01, func:function(pixel1,pixel2){
|
||||
changePixel(pixel2,"infected_skin");
|
||||
pixel2.color = pixelColorPick(pixel2,RGBToHex(pixel1.color.match(/\d+/g)))
|
||||
if (pixel1.origColor) { pixel2.origColor = pixel1.origColor }
|
||||
} },
|
||||
"blood": { elem2:"infection" , chance:0.6 },
|
||||
"acid": { elem1:"infection" },
|
||||
"soap": { elem1:null, elem2:null, chance:0.005 },
|
||||
"light": { stain1:"#825043" },
|
||||
|
|
@ -180,6 +190,8 @@ elements.infected_meat = {
|
|||
"dirty_water": { elem2:"broth", tempMin:70, color2:"#d7db69" },
|
||||
"seltzer": { elem2:"dirty_water" },
|
||||
"fly": { elem1: [null,null,"SCP_008"] , elem2: ["dead_bug","dead_bug","SCP_008"] , chance:0.2},
|
||||
"blood": { elem2:"infection" , chance:0.6 },
|
||||
"skin": { elem2:"infected_skin" , chance:0.6 },
|
||||
},
|
||||
tempHigh: 300,
|
||||
stateHigh: ["SCP_008","ash","ammonia"],
|
||||
|
|
@ -209,6 +221,7 @@ elements.frozen_infected_meat = {
|
|||
"sugar_water": { elem2:"dirty_water" },
|
||||
"seltzer": { elem2:"dirty_water" },
|
||||
"fly": { elem2: ["dead_bug","dead_bug","SCP_008"] , chance:0.2},
|
||||
"blood": { elem2:"infection" , chance:0.6 },
|
||||
},
|
||||
temp: -20,
|
||||
tempHigh: 10,
|
||||
|
|
|
|||
Loading…
Reference in New Issue