commit
02af27b8b4
|
|
@ -151,6 +151,7 @@
|
|||
<tr><td>save_loading.js</td><td>Adds the ability to save and load scenes from files (See the info page of the element)</td><td>Alice</td></tr>
|
||||
<tr><td>selective_paint.js</td><td>Adds a tool to paint only selected elements</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>stripe_paint.js</td><td>Adds a tool to paint with stripes</td><td>Alice</td></tr>
|
||||
<tr><td>texturepack.js</td><td>Adds tools that let you create and share custom texture packs</td><td>nousernamefound</td></tr>
|
||||
<tr><td>the_ground.js</td><td>Adds several rock types, worldgen settings, and gemstones</td><td>Alice</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Science & Chemistry</td></tr><!---->
|
||||
|
|
|
|||
|
|
@ -74,6 +74,14 @@ if (Math.abs(settings.randomcount) == settings.randomcount){
|
|||
}else(elements["element_"+i].desc += (" or " + reaction))
|
||||
}
|
||||
}
|
||||
for (var reaction in elements["element_" + i].reactions){
|
||||
if (elements[elements["element_"+i].reactions[reaction].elem1].category == "tools" || elements[elements["element_"+i].reactions[reaction].elem2].category == "tools"){
|
||||
console.log(i + " makes a tool...? when it touches " + reaction)
|
||||
if (!elements["element_"+i].desc){
|
||||
elements["element_" + i].desc = "This breaks the laws of physics if it touches " + reaction
|
||||
}else(elements["element_"+i].desc += (" or " + reaction))
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = 1; i <= settings.randomcount; i++){
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
elements.led = {
|
||||
behavior: behaviors.WALL,
|
||||
reactions: {
|
||||
"light": {"charge1":1},
|
||||
"liquid_light": {"charge1":1},
|
||||
},
|
||||
color: "#666666",
|
||||
colorOn: "#ffffff",
|
||||
category: "machines",
|
||||
tempHigh: 1500,
|
||||
stateHigh: ["molten_glass","molten_glass","molten_glass","molten_gallium"],
|
||||
conduct: 1,
|
||||
breakInto: "glass_shard",
|
||||
tick: (pixel) => {
|
||||
if (pixel.start == pixelTicks) {
|
||||
pixel.normalColor = pixel.color;
|
||||
pixel.chargeColor = `rgb(${pixel.color.replace(/[rgb\(\)]/g, "").split(",").map(a => parseInt(a.trim()) + 120).join(", ")})`;
|
||||
}
|
||||
if (pixel.color != pixel.normalColor && !pixel.charge && !pixel.chargeCD) {
|
||||
pixel.normalColor = pixel.color;
|
||||
pixel.chargeColor = `rgb(${pixel.color.replace(/[rgb\(\)]/g, "").split(",").map(a => parseInt(a.trim()) + 120).join(", ")})`;
|
||||
}
|
||||
if (pixel.charge) {
|
||||
pixel.color = pixel.chargeColor;
|
||||
} else {
|
||||
pixel.color = pixel.normalColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pixelColorPick = (function() {
|
||||
const oldPixelColorPick = pixelColorPick;
|
||||
|
||||
return function(pixel, customColor = null) {
|
||||
if (pixel.element == "led" && pixel.color && !customColor) return pixel.color;
|
||||
return oldPixelColorPick.apply(this, arguments);
|
||||
}
|
||||
})()
|
||||
|
|
@ -428,7 +428,7 @@ elements.plague_doctor = {
|
|||
createPixel("doc_head", pixel.x, pixel.y-1);
|
||||
pixelMap[pixel.x][pixel.y-1].color = pixel.color;
|
||||
pixel.element = "doc_body";
|
||||
pixelMap[pixel.x][pixel.y].color = ["#11111f","#242424"];
|
||||
pixel.color = pixelColorPick(pixel)
|
||||
}
|
||||
else {
|
||||
deletePixel(pixel.x, pixel.y);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
if (!settings.texturepack){
|
||||
settings.texturepack = {}
|
||||
saveSettings()
|
||||
}
|
||||
elements.clear_textures = {
|
||||
color: "#dd0000",
|
||||
onSelect: function(){
|
||||
var sure = prompt("Are you sure you wanna reset all texture data? Type \"yes\". Also, refresh once you've done this for the changes to apply!", "no");
|
||||
if (sure == "yes"){
|
||||
settings.texturepack = {}
|
||||
saveSettings()
|
||||
}
|
||||
},
|
||||
canPlace: false,
|
||||
category: "texture tools"
|
||||
}
|
||||
var addSave = null
|
||||
elements.add_texture = {
|
||||
color: elements.rainbow.color,
|
||||
category: "texture tools",
|
||||
canPlace: false,
|
||||
onSelect: function(){
|
||||
var whoelement = prompt("What element would you like to change the texture of? Type no if this was a mistake.", (addSave||"no"))
|
||||
if (whoelement != "no"){
|
||||
addSave = whoelement
|
||||
var replacehm = prompt("Would you like to overwrite all textures or add? 1 for overwrite, 2 for add.", 2)
|
||||
var colortodo = prompt("Hex code, please! Also, refresh once you've done this for the changes to apply!", "#ff0000")
|
||||
if (replacehm == 1){
|
||||
if (!replacehm || !colortodo){return}
|
||||
if (!settings.texturepack[whoelement]){settings.texturepack[whoelement] = []}
|
||||
settings.texturepack[whoelement] = [colortodo]
|
||||
elements[whoelement].color = settings.texturepack[whoelement]
|
||||
saveSettings()
|
||||
} else {
|
||||
if (!replacehm || !colortodo){return}
|
||||
if (!settings.texturepack[whoelement]){settings.texturepack[whoelement] = []}
|
||||
settings.texturepack[whoelement].push(colortodo)
|
||||
elements[whoelement].color = settings.texturepack[whoelement]
|
||||
saveSettings()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.remove_a_texture = {
|
||||
color: elements.void.color,
|
||||
category: "texture tools",
|
||||
canPlace: false,
|
||||
onSelect: function(){
|
||||
var whoelement = prompt("What element would you like to change the texture of? Type no if this was a mistake.", "no")
|
||||
if (whoelement != "no"){
|
||||
var replacehm = prompt("Would you like to delete all textures of the element or just one? Type 1 for all, 2 for just one.", 2)
|
||||
var colortodo = prompt(("Ignore this if you chose 1. Index of the color you wanna delete. For reference, here are the current colors:" + settings.texturepack[whoelement]), 0)
|
||||
if (replacehm == 1){
|
||||
delete settings.texturepack[whoelement]
|
||||
saveSettings()
|
||||
} else {
|
||||
delete settings.texturepack[whoelement][colortodo]
|
||||
elements[whoelement].color = settings.texturepack[whoelement]
|
||||
saveSettings()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.list_all_textures = {
|
||||
color: elements.mix.color,
|
||||
category: "texture tools",
|
||||
canPlace: false,
|
||||
onSelect: function(){
|
||||
var whoelement = prompt("What element would you like to see the textures of?")
|
||||
alert(whoelement + " has the following textures: " + settings.texturepack[whoelement])
|
||||
}
|
||||
}
|
||||
elements.texture_pack_share_or_load = {
|
||||
color: elements.image.color,
|
||||
category: "texture tools",
|
||||
canPlace: false,
|
||||
onSelect: function(){
|
||||
var whichSL = prompt("Would you like to copy the texture pack to your clipboard or load it from your clipboard? Type 1 for copy, 2 for load.", 1)
|
||||
if (whichSL == 1){
|
||||
var text = JSON.stringify(settings.texturepack)
|
||||
alert(text)
|
||||
} else {
|
||||
var text = prompt("Paste your texture pack here. It should be in the format of a JSON object.")
|
||||
if (text){
|
||||
settings.texturepack = JSON.parse(text)
|
||||
saveSettings()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (settings.texturepack){
|
||||
for (var elementi in settings.texturepack){
|
||||
elements[elementi].color = settings.texturepack[elementi]
|
||||
}}
|
||||
Loading…
Reference in New Issue