Merge branch 'R74nCom:main' into main
This commit is contained in:
commit
ce4a2c9bf7
File diff suppressed because it is too large
Load Diff
|
|
@ -14,6 +14,13 @@ try {
|
|||
|
||||
//ESSENTIAL COMMON FUNCTIONS (CODE LIBRARY) ##
|
||||
|
||||
//DEBUGGING
|
||||
|
||||
function logAndReturn(thing) {
|
||||
console.log(thing);
|
||||
return thing
|
||||
};
|
||||
|
||||
//URL
|
||||
|
||||
urlParams = new URLSearchParams(window.location.search);
|
||||
|
|
@ -493,7 +500,7 @@ try {
|
|||
if(!color.startsWith("hsl(") || !color.endsWith(")")) {
|
||||
throw new Error(`The color ${color} is not a valid hsl() color`)
|
||||
};
|
||||
var colorTempArray = color.split(",")
|
||||
var colorTempArray = color.split(",").map(x => x.trim())
|
||||
if(colorTempArray.length !== 3) {
|
||||
throw new Error(`The color ${color} is not a valid hsl() color`)
|
||||
};
|
||||
|
|
@ -2101,6 +2108,8 @@ try {
|
|||
if(pixelIndex !== -1) {
|
||||
currentPixels.splice(pixelIndex,1)
|
||||
if (pixelMap[x][y]) { delete pixelMap[x][y] };
|
||||
} else {
|
||||
return false
|
||||
};
|
||||
//if (pixelMap[x][y]) {pixelMap[x][y].del = true}
|
||||
//if (pixelMap[x][y]) { delete pixelMap[x][y] };
|
||||
|
|
@ -21260,10 +21269,13 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
|
|||
tempLow: Math.min(rockInfo.tempHigh - 100,800),
|
||||
stateLow: rockName,
|
||||
density: rockInfo.density * 0.9,
|
||||
hardness: rockInfo.density * 0.85,
|
||||
//breakInto: newName + "_gravel",
|
||||
_data: [rockData[0], rockData[1], hotData2Switch(rockData[2])],
|
||||
};
|
||||
|
||||
if(rockInfo.hardness) {
|
||||
elements[newName].hardness = rockInfo.hardness * 0.85
|
||||
};
|
||||
|
||||
//console.log([elements[rockName].tempHigh,elements[rockName].stateHigh]);
|
||||
//console.log([elements[newName].tempLow,elements[newName].stateLow])
|
||||
|
|
@ -45937,14 +45949,15 @@ maxPixels (default 1000): Maximum amount of pixels/changes (if xSpacing and ySpa
|
|||
//SPECIFY CURRENT ELEMENT ON LOAD ##
|
||||
|
||||
window.addEventListener("load",function() {
|
||||
//console.log(currentElement);
|
||||
currentElement = urlParams.get("currentElement") ?? "sand";
|
||||
//console.log(currentElement);
|
||||
if(!elementExists(currentElement)) {
|
||||
//console.log(false);
|
||||
currentElement = "sand"
|
||||
}// else { console.log(true) };
|
||||
//console.log(currentElement);
|
||||
}
|
||||
var size = urlParams.get("mouseSize") ?? 5;
|
||||
if(isNaN(size)) {
|
||||
size = 5;
|
||||
};
|
||||
mouseSize = size
|
||||
});
|
||||
|
||||
//MISCELLANEOUS CHANGES ##
|
||||
|
|
|
|||
|
|
@ -1,4 +1,37 @@
|
|||
// 1.0 update
|
||||
// adds dragon breath
|
||||
// adds frostbite
|
||||
// adds pulsium
|
||||
// adds pulsium bar
|
||||
// adds goblins delight
|
||||
// adds pheonix
|
||||
// adds pheonix ash
|
||||
// adds baby pheonix
|
||||
// adds ice pheonix
|
||||
|
||||
// 1.1 update
|
||||
// adds dragon scale
|
||||
// adds mystic runes
|
||||
// adds enchanted wood
|
||||
// adds quartzium
|
||||
// adds quartz
|
||||
// adds moonite
|
||||
|
||||
// 1.2 update
|
||||
// fixed visibility bug and some errors
|
||||
// adds faustium
|
||||
// adds nebulaflare
|
||||
// adds flaro
|
||||
// adds aurorium
|
||||
// adds glimmerium
|
||||
// adds ozmoz
|
||||
// adds goblin
|
||||
// adds fenzium
|
||||
// adds sceptrium
|
||||
// adds sceptrium dust
|
||||
|
||||
// 1.3.2 fantasy_elements.js mod
|
||||
// added changelog
|
||||
// adds plode a bomb
|
||||
|
||||
// 1.4 the golem mod
|
||||
|
|
@ -12,6 +45,11 @@
|
|||
// iced pheonix at 700 degrees becomes pheonix
|
||||
// added blood golem
|
||||
|
||||
// 1.5 update
|
||||
// corrected the 'phoenix' wrong spelling mistake to pheonix
|
||||
// added grethe
|
||||
// added grothea
|
||||
|
||||
elements.dragon_breath = {
|
||||
color: "#f94e4e",
|
||||
behavior: behaviors.GAS,
|
||||
|
|
@ -110,7 +148,7 @@ elements.pheonix = {
|
|||
baby: "baby_pheonix",
|
||||
};
|
||||
|
||||
elements.phoenix_ash = {
|
||||
elements.pheonix_ash = {
|
||||
color: "#a8a8a5",
|
||||
behavior: behaviors.POWDER,
|
||||
category: "fantasy",
|
||||
|
|
@ -134,7 +172,7 @@ elements.baby_pheonix = {
|
|||
burnTime:19,
|
||||
state: "solid",
|
||||
stateLow: "iced_pheonix",
|
||||
breakInto: "phoenix_ash",
|
||||
breakInto: "pheonix_ash",
|
||||
density: 850,
|
||||
conduct: 1,
|
||||
};
|
||||
|
|
@ -738,3 +776,25 @@ elements.blood_golem= {
|
|||
"category":"fantasy",
|
||||
"temp": 10,
|
||||
};
|
||||
|
||||
elements.grethe = {
|
||||
color: "#51f542",
|
||||
"behavior": [
|
||||
"XX|XX|DL",
|
||||
"SA|XX|M2",
|
||||
"XX|M1|XX",
|
||||
],
|
||||
category: "fantasy",
|
||||
state: "solid",
|
||||
};
|
||||
|
||||
elements.grothea = {
|
||||
color: ["#d742f5","#c246db","#772987"],
|
||||
"behavior": [
|
||||
"M2|XX|XX",
|
||||
"SA|M1|XX",
|
||||
"XX|XX|DL",
|
||||
],
|
||||
category: "fantasy",
|
||||
state: "solid",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,111 @@
|
|||
//jaydsfunctions
|
||||
erase1Var = 0;
|
||||
elements.selective_eraser = {
|
||||
color: ["#ffff00","#ffff00","#ffff00","#555555","#555555","#555555"],
|
||||
category: "tools",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element === erase1Var) {
|
||||
deletePixel(pixel.x, pixel.y);
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer1 = prompt("Please input what element should be erased.",(erase1Var||undefined));
|
||||
if (!answer1) { return }
|
||||
erase1Var = answer1;
|
||||
}
|
||||
},
|
||||
explode1Var = 0;
|
||||
elements.selective_exploder = {
|
||||
color: ["#ff0000","#ff0000","#ff0000","#555555","#555555","#555555"],
|
||||
category: "tools",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element === explode1Var) {
|
||||
changePixel(pixel, "explosion")
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer2 = prompt("Please input what element to explode.",(explode1Var||undefined));
|
||||
if (!answer2) { return }
|
||||
explode1Var = answer2;
|
||||
}
|
||||
},
|
||||
convert11Var = 0;
|
||||
convert22Var = 0;
|
||||
elements.converter_tool = {
|
||||
color: ["#ffffff","#ffffff","#ffffff","#555555","#555555","#555555"],
|
||||
darkText: true,
|
||||
category: "tools",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element === convert11Var) {
|
||||
changePixel(pixel, convert22Var)
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer3 = prompt("Please input what should element be converted.",(convert11Var||undefined));
|
||||
if (!answer3) { return }
|
||||
convert11Var = answer3;
|
||||
var answer4 = prompt("Please input what element to convert into.",(convert22Var||undefined));
|
||||
if (!answer4) { return }
|
||||
convert22Var = answer4;
|
||||
}
|
||||
},
|
||||
elements.fast_bomb = {
|
||||
color: "#524c41",
|
||||
category: "weapons",
|
||||
state: "solid",
|
||||
behavior: [
|
||||
"XX|EX:10>explosion|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:10>explosion|M2",
|
||||
],
|
||||
tick: function(pixel) {
|
||||
for (var i=0; i<3; i++) {
|
||||
if (!tryMove(pixel, pixel.x, pixel.y+1)) {
|
||||
if (!isEmpty(pixel.x, pixel.y+1,true)) {
|
||||
var newPixel = pixelMap[pixel.x][pixel.y+1];
|
||||
if (newPixel.element === "fast_bomb") { break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
},
|
||||
exclude1Var = 0;
|
||||
elements.exclusive_eraser = {
|
||||
color: ["#ff5a00","#ff5a00","#ff5a00","#555555","#555555","#555555"],
|
||||
category: "tools",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element !== exclude1Var) {
|
||||
deletePixel(pixel.x, pixel.y);
|
||||
}
|
||||
},
|
||||
onSelect: function() {
|
||||
var answer5 = prompt("Please input what element shouldn't be erased.",(exclude1Var||undefined));
|
||||
if (!answer5) { return }
|
||||
exclude1Var = answer5;
|
||||
}
|
||||
},
|
||||
elements.tenth_heater = {
|
||||
category: "special",
|
||||
color: "#ff0000",
|
||||
behavior: [
|
||||
"XX|HT:0.1|XX",
|
||||
"HT:0.1|XX|HT:0.1",
|
||||
"XX|HT:0.1|XX",
|
||||
],
|
||||
ignore: "tenth_heater"
|
||||
},
|
||||
elements.e_tenth_heater = {
|
||||
category: "special",
|
||||
color: "#ff0000",
|
||||
behavior: behaviors.WALL,
|
||||
behaviorOn: [
|
||||
"XX|HT:0.1|XX",
|
||||
"HT:0.1|XX|HT:0.1",
|
||||
"XX|HT:0.1|XX",
|
||||
],
|
||||
ignore: "tenth_heater",
|
||||
conduct: 1
|
||||
}
|
||||
|
|
@ -509,4 +509,87 @@ tick: function(pixel) {
|
|||
}}},
|
||||
category: "aircrafts",
|
||||
breakInto: "metal_scrap"
|
||||
}
|
||||
},
|
||||
elements.machine_for_throwing_bombs_at_you_left = {
|
||||
color: "#524c41",
|
||||
behavior: behaviors.WALL,
|
||||
behaviorOn: [
|
||||
"XX|XX|XX",
|
||||
"CR:bombs_for_throwing_at_you_left|XX|XX",
|
||||
"XXXX|XX",
|
||||
],
|
||||
category: "weapons",
|
||||
conduct: 1
|
||||
},
|
||||
elements.bombs_for_throwing_at_you_left = {
|
||||
color: "#524c41",
|
||||
category: "ammunition",
|
||||
behavior: [
|
||||
"XX|EX:10>bomb|XX",
|
||||
"XX|XX|XX",
|
||||
"M1|M1%10 AND EX:10>bomb|XX",
|
||||
],
|
||||
}
|
||||
elements.machine_for_throwing_bombs_at_right = {
|
||||
color: "#524c41",
|
||||
behavior: behaviors.WALL,
|
||||
behaviorOn: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|CR:bombs_for_throwing_at_you_right",
|
||||
"XXXX|XX",
|
||||
],
|
||||
category: "weapons",
|
||||
conduct: 1
|
||||
},
|
||||
elements.bombs_for_throwing_at_you_right = {
|
||||
color: "#524c41",
|
||||
category: "ammunition",
|
||||
behavior: [
|
||||
"XX|EX:10>bomb|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|M1%10 AND EX:10>bomb|M1",
|
||||
],
|
||||
},
|
||||
elements.energized_orb_left = {
|
||||
color: ["#e0e000","#f3f300"],
|
||||
category: "energy",
|
||||
behavior: [
|
||||
"XX|EX:50>electric|XX",
|
||||
"M1 AND EX:50>electric|XX|EX:50>electric",
|
||||
"XX|EX:50>electric|XX"
|
||||
],
|
||||
state: "gas",
|
||||
},
|
||||
elements.energized_orb_right = {
|
||||
color: ["#e0e000","#f3f300"],
|
||||
category: "energy",
|
||||
behavior: [
|
||||
"XX|EX:50>electric|XX",
|
||||
"EX:50>electric|XX|M1 AND EX:50>electric",
|
||||
"XX|EX:50>electric|XX"
|
||||
],
|
||||
state: "gas",
|
||||
},
|
||||
elements.fast_bomb = {
|
||||
color: "#524c41",
|
||||
category: "weapons",
|
||||
state: "solid",
|
||||
behavior: [
|
||||
"XX|EX:10>explosion|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:10>explosion|M2",
|
||||
],
|
||||
tick: function(pixel) {
|
||||
for (var i=0; i<3; i++) {
|
||||
if (!tryMove(pixel, pixel.x, pixel.y+1)) {
|
||||
if (!isEmpty(pixel.x, pixel.y+1,true)) {
|
||||
var newPixel = pixelMap[pixel.x][pixel.y+1];
|
||||
if (newPixel.element === "fast_bomb") { break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
density: 1300,
|
||||
excludeRandom: true,
|
||||
cooldown: defaultCooldown
|
||||
}
|
||||
Loading…
Reference in New Issue