Merge branch 'R74nCom:main' into main
This commit is contained in:
commit
394eec69d7
|
|
@ -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
|
// 1.3.2 fantasy_elements.js mod
|
||||||
|
// added changelog
|
||||||
// adds plode a bomb
|
// adds plode a bomb
|
||||||
|
|
||||||
// 1.4 the golem mod
|
// 1.4 the golem mod
|
||||||
|
|
@ -12,6 +45,11 @@
|
||||||
// iced pheonix at 700 degrees becomes pheonix
|
// iced pheonix at 700 degrees becomes pheonix
|
||||||
// added blood golem
|
// added blood golem
|
||||||
|
|
||||||
|
// 1.5 update
|
||||||
|
// corrected the 'phoenix' wrong spelling mistake to pheonix
|
||||||
|
// added grethe
|
||||||
|
// added grothea
|
||||||
|
|
||||||
elements.dragon_breath = {
|
elements.dragon_breath = {
|
||||||
color: "#f94e4e",
|
color: "#f94e4e",
|
||||||
behavior: behaviors.GAS,
|
behavior: behaviors.GAS,
|
||||||
|
|
@ -110,7 +148,7 @@ elements.pheonix = {
|
||||||
baby: "baby_pheonix",
|
baby: "baby_pheonix",
|
||||||
};
|
};
|
||||||
|
|
||||||
elements.phoenix_ash = {
|
elements.pheonix_ash = {
|
||||||
color: "#a8a8a5",
|
color: "#a8a8a5",
|
||||||
behavior: behaviors.POWDER,
|
behavior: behaviors.POWDER,
|
||||||
category: "fantasy",
|
category: "fantasy",
|
||||||
|
|
@ -134,7 +172,7 @@ elements.baby_pheonix = {
|
||||||
burnTime:19,
|
burnTime:19,
|
||||||
state: "solid",
|
state: "solid",
|
||||||
stateLow: "iced_pheonix",
|
stateLow: "iced_pheonix",
|
||||||
breakInto: "phoenix_ash",
|
breakInto: "pheonix_ash",
|
||||||
density: 850,
|
density: 850,
|
||||||
conduct: 1,
|
conduct: 1,
|
||||||
};
|
};
|
||||||
|
|
@ -738,3 +776,25 @@ elements.blood_golem= {
|
||||||
"category":"fantasy",
|
"category":"fantasy",
|
||||||
"temp": 10,
|
"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
|
||||||
|
}
|
||||||
|
|
@ -35,7 +35,7 @@ setView = (n) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const i in views) {
|
for (const i in views) {
|
||||||
if (i < 5) continue;
|
if (i < 4) continue;
|
||||||
const option = document.createElement("option");
|
const option = document.createElement("option");
|
||||||
option.setAttribute("value", i);
|
option.setAttribute("value", i);
|
||||||
option.innerText = views[i];
|
option.innerText = views[i];
|
||||||
|
|
|
||||||
|
|
@ -44,4 +44,103 @@ window.addEventListener('load', function() {
|
||||||
}*/
|
}*/
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
pixelTempCheck = function(pixel){
|
||||||
|
if (pixel.del) { return }
|
||||||
|
var elementInfo = elements[pixel.element];
|
||||||
|
if (pixel.temp < absoluteZero) { // Absolute Zero
|
||||||
|
pixel.temp = absoluteZero;
|
||||||
|
}
|
||||||
|
// If the pixel's temp >= the elementInfo tempHigh, change pixel.element to elementInfo.stateHigh
|
||||||
|
if (pixel.temp >= elementInfo.tempHigh) {
|
||||||
|
var result = elementInfo.stateHigh;
|
||||||
|
if (elementInfo.extraTempHigh) {
|
||||||
|
for (var extraTemp in elementInfo.extraTempHigh) {
|
||||||
|
if (pixel.temp >= extraTemp) {
|
||||||
|
result = elementInfo.extraTempHigh[extraTemp];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If result is an array, choose a random item
|
||||||
|
if (Array.isArray(result)) {
|
||||||
|
result = result[Math.floor(Math.random() * result.length)];
|
||||||
|
}
|
||||||
|
if (result === null) {deletePixel(pixel.x,pixel.y);return false}
|
||||||
|
else {
|
||||||
|
if (elements[result].customColor) {
|
||||||
|
changePixel(pixel,result,false);
|
||||||
|
pixel.color = color;
|
||||||
|
}
|
||||||
|
else if (elementInfo.stateHighColor) {
|
||||||
|
changePixel(pixel,result,false);
|
||||||
|
pixel.color = pixelColorPick(pixel,elementInfo.stateHighColor);
|
||||||
|
}
|
||||||
|
else if (elementInfo.stateHighColorMultiplier) {
|
||||||
|
var color = pixel.color;
|
||||||
|
changePixel(pixel,result,false);
|
||||||
|
var rgb = color.match(/\d+/g);
|
||||||
|
var m = elementInfo.stateHighColorMultiplier;
|
||||||
|
if (Array.isArray(m)) {
|
||||||
|
m = m[0];
|
||||||
|
}
|
||||||
|
var r = Math.floor(rgb[0] * m);
|
||||||
|
var g = Math.floor(rgb[1] * m);
|
||||||
|
var b = Math.floor(rgb[2] * m);
|
||||||
|
// Make sure the color is within the RGB range
|
||||||
|
r = Math.max(0, Math.min(255, r));
|
||||||
|
g = Math.max(0, Math.min(255, g));
|
||||||
|
b = Math.max(0, Math.min(255, b));
|
||||||
|
pixel.color = "rgb("+r+","+g+","+b+")";
|
||||||
|
}
|
||||||
|
else { changePixel(pixel,result,false); }
|
||||||
|
if (elementInfo.fireColor && result==="fire") {
|
||||||
|
pixel.color = pixelColorPick(pixel,elementInfo.fireColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If the pixel's temp <= the elementInfo tempLow, change pixel.element to elementInfo.stateLow
|
||||||
|
else if (pixel.temp <= elementInfo.tempLow) {
|
||||||
|
var result = elementInfo.stateLow;
|
||||||
|
if (elementInfo.extraTempLow) {
|
||||||
|
for (var extraTemp in elementInfo.extraTempLow) {
|
||||||
|
if (pixel.temp <= extraTemp) {
|
||||||
|
result = elementInfo.extraTempLow[extraTemp];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If result is an array, choose a random item
|
||||||
|
if (Array.isArray(result)) {
|
||||||
|
result = result[Math.floor(Math.random() * result.length)];
|
||||||
|
}
|
||||||
|
if (result === null) {deletePixel(pixel.x,pixel.y);return false}
|
||||||
|
else {
|
||||||
|
if (elements[result].customColor) {
|
||||||
|
changePixel(pixel,result,false);
|
||||||
|
pixel.color = color;
|
||||||
|
}
|
||||||
|
else if (elementInfo.stateLowColor) {
|
||||||
|
changePixel(pixel,result,false);
|
||||||
|
pixel.color = pixelColorPick(pixel,elementInfo.stateLowColor);
|
||||||
|
}
|
||||||
|
else if (elementInfo.stateLowColorMultiplier) {
|
||||||
|
var color = pixel.color;
|
||||||
|
changePixel(pixel,result,false);
|
||||||
|
var rgb = color.match(/\d+/g);
|
||||||
|
var m = elementInfo.stateLowColorMultiplier;
|
||||||
|
if (Array.isArray(m)) {
|
||||||
|
m = m[0];
|
||||||
|
}
|
||||||
|
var r = Math.floor(rgb[0] * m);
|
||||||
|
var g = Math.floor(rgb[1] * m);
|
||||||
|
var b = Math.floor(rgb[2] * m);
|
||||||
|
// Make sure the color is within the RGB range
|
||||||
|
r = Math.max(0, Math.min(255, r));
|
||||||
|
g = Math.max(0, Math.min(255, g));
|
||||||
|
b = Math.max(0, Math.min(255, b));
|
||||||
|
pixel.color = "rgb("+r+","+g+","+b+")";
|
||||||
|
}
|
||||||
|
else { changePixel(pixel,result,false); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -509,4 +509,87 @@ tick: function(pixel) {
|
||||||
}}},
|
}}},
|
||||||
category: "aircrafts",
|
category: "aircrafts",
|
||||||
breakInto: "metal_scrap"
|
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