This commit is contained in:
parent
7f9390d50e
commit
9bb962c188
|
|
@ -2,18 +2,25 @@ var elementslist = []
|
||||||
for (elementi in elements){
|
for (elementi in elements){
|
||||||
elementslist.push(elementi)
|
elementslist.push(elementi)
|
||||||
}
|
}
|
||||||
|
async function _GNPrompt(message, title = "Prompt", defaultValue = "") { // thanks to ggod
|
||||||
|
return new Promise(resolve => {
|
||||||
|
promptInput(message, (result) => {
|
||||||
|
resolve(result);
|
||||||
|
}, title, defaultValue);
|
||||||
|
})
|
||||||
|
}
|
||||||
elements.change_count = {
|
elements.change_count = {
|
||||||
color: "#34eb86",
|
color: "#34eb86",
|
||||||
canPlace: false,
|
canPlace: false,
|
||||||
behavior: behaviors.SELFDELETE,
|
behavior: behaviors.SELFDELETE,
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var cans = prompt("Please input how many elements you would like to be generared each time.", 10000);
|
var cans = _GNPrompt("Please input how many elements you would like to be generared each time.", "10kelements.js is asking you...", 10000);
|
||||||
if (!cans) { return }
|
if (!cans) { return }
|
||||||
if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; settings.sandeasteregg = false; saveSettings(); alert("skin"); return}
|
if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; settings.sandeasteregg = false; saveSettings(); promptText("skin"); return}
|
||||||
if (cans == "sand"){settings.randomcount = 10000; settings.skineasteregg = false; settings.sandeasteregg = true; saveSettings(); alert("sand"); return}
|
if (cans == "sand"){settings.randomcount = 10000; settings.skineasteregg = false; settings.sandeasteregg = true; saveSettings(); promptText("sand"); return}
|
||||||
if (cans > 100000){alert("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return}
|
if (cans > 100000){promptText("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return}
|
||||||
if (cans < 1 && (parseInt(cans) > -1) ){alert("You have either put a decimal or zero. Why? Element count will remain unchanged."); return}
|
if (cans < 1 && (parseInt(cans) > -1) ){alert("You have either put a decimal or zero. Why? Element count will remain unchanged."); return}
|
||||||
if (isNaN(parseInt(cans))){alert("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return}
|
if (isNaN(parseInt(cans))){promptText("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return}
|
||||||
settings.randomcount = parseInt(cans)
|
settings.randomcount = parseInt(cans)
|
||||||
settings.skineasteregg = false;
|
settings.skineasteregg = false;
|
||||||
settings.sandeasteregg = false;
|
settings.sandeasteregg = false;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
const oldExplode = explodeAt;
|
||||||
|
let explosionCooldown = 0
|
||||||
|
playExplosionSound = function(){
|
||||||
|
var audio = new Audio("https://JustAGenericUsername.github.io/explosion.mp3");
|
||||||
|
audio.play();
|
||||||
|
}
|
||||||
|
explodeAt = function(x,y,radius,fire="fire"){
|
||||||
|
oldExplode(x,y,radius,fire);
|
||||||
|
if(explosionCooldown <= 0){
|
||||||
|
playExplosionSound();
|
||||||
|
explosionCooldown = 7
|
||||||
|
//console.log("success")
|
||||||
|
} //else {
|
||||||
|
//console.log("yeah no")
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
runEveryTick(function(){
|
||||||
|
explosionCooldown -= 1;
|
||||||
|
})
|
||||||
|
|
@ -69,7 +69,7 @@ elements.soul_sand = {
|
||||||
category: "minecraft",
|
category: "minecraft",
|
||||||
state: "solid",
|
state: "solid",
|
||||||
tempHigh: 2575,
|
tempHigh: 2575,
|
||||||
stateHigh: "soul_glass",
|
stateHigh: "molten_soul_glass",
|
||||||
density: 1375,
|
density: 1375,
|
||||||
reactions: {
|
reactions: {
|
||||||
"water": { "elem1":"wet_soul_sand", "elem2":null },
|
"water": { "elem1":"wet_soul_sand", "elem2":null },
|
||||||
|
|
@ -114,6 +114,19 @@ elements.wet_soul_sand = {
|
||||||
stateHigh: "soul_sand",
|
stateHigh: "soul_sand",
|
||||||
density: 1660,
|
density: 1660,
|
||||||
};
|
};
|
||||||
|
elements.molten_soul_glass = {
|
||||||
|
color: ["#36d7ec", "#2fbacd", "#289faf", "#218491", "#1a6a75"],
|
||||||
|
fireColor: "#36d7ec",
|
||||||
|
viscosity: 1000,
|
||||||
|
behavior: behaviors.MOLTEN,
|
||||||
|
category: "minecraft",
|
||||||
|
density: 1625,
|
||||||
|
hidden: true,
|
||||||
|
tempLow: 2540,
|
||||||
|
stateLow: "soul_glass",
|
||||||
|
state: "liquid",
|
||||||
|
temp: 2700,
|
||||||
|
}
|
||||||
/* unfinished but near:
|
/* unfinished but near:
|
||||||
Soul Adobe,
|
Soul Adobe,
|
||||||
Molten Soul Glass,
|
Molten Soul Glass,
|
||||||
|
|
@ -135,6 +148,13 @@ function playShriek() {
|
||||||
var audio = new Audio("https://JustAGenericUsername.github.io/shriek" + Math.floor((Math.random()*4) +1) + ".ogg");
|
var audio = new Audio("https://JustAGenericUsername.github.io/shriek" + Math.floor((Math.random()*4) +1) + ".ogg");
|
||||||
audio.play();
|
audio.play();
|
||||||
}
|
}
|
||||||
|
async function _GNPrompt(message, title = "Prompt", defaultValue = "") { // thanks to ggod
|
||||||
|
return new Promise(resolve => {
|
||||||
|
promptInput(message, (result) => {
|
||||||
|
resolve(result);
|
||||||
|
}, title, defaultValue);
|
||||||
|
})
|
||||||
|
}
|
||||||
function turnIntoSpecific(pixel){
|
function turnIntoSpecific(pixel){
|
||||||
newPixel = pixel.storedPixel
|
newPixel = pixel.storedPixel
|
||||||
newPixel.x = pixel.x;
|
newPixel.x = pixel.x;
|
||||||
|
|
@ -597,8 +617,8 @@ elements.sculk_wifi_transmitter = {
|
||||||
hoverStat: function(pixel){
|
hoverStat: function(pixel){
|
||||||
return pixel.channel || "unset"
|
return pixel.channel || "unset"
|
||||||
},
|
},
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
let ans1 = prompt("What channel should this transmitter be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", channelVar||0)
|
let ans1 = await _GNPrompt("What channel should this transmitter be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", "minecraft.js is asking you...",channelVar||0)
|
||||||
channelVar = ans1
|
channelVar = ans1
|
||||||
},
|
},
|
||||||
tick: function(pixel){
|
tick: function(pixel){
|
||||||
|
|
@ -636,8 +656,8 @@ elements.sculk_wifi_receiver = {
|
||||||
hoverStat: function(pixel){
|
hoverStat: function(pixel){
|
||||||
return pixel.channel || "unset"
|
return pixel.channel || "unset"
|
||||||
},
|
},
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
let ans1 = prompt("What channel should this receiver be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", channelVar||0)
|
let ans1 = _GNPrompt("What channel should this receiver be? Wont work if you do multiple while paused. (This is meant to be used in machinery!)", "minecraft.js is asking you...", channelVar||0)
|
||||||
channelVar = ans1
|
channelVar = ans1
|
||||||
},
|
},
|
||||||
tick: function(pixel){
|
tick: function(pixel){
|
||||||
|
|
@ -772,26 +792,18 @@ elements.obsidian = { //subject to change
|
||||||
density: 2400,
|
density: 2400,
|
||||||
renderer: function(pixel, ctx){
|
renderer: function(pixel, ctx){
|
||||||
autoFillColorRectangle(ctx, pixel, "#06030B", 1, 1, 0, 0)
|
autoFillColorRectangle(ctx, pixel, "#06030B", 1, 1, 0, 0)
|
||||||
autoFillColorRectangle(ctx, pixel, "#000001", 0.5, 1/6, 0, 0)
|
autoFillColorRectangle(ctx, pixel, "#000100", 1/6, 1/6, 5/6, 5/6)
|
||||||
autoFillColorRectangle(ctx, pixel, "#000001", 1/6, 1/6, 1/6, 5/6)
|
autoFillColorRectangle(ctx, pixel, "#000100", 1/6, 1/3, 1/3, 2/3)
|
||||||
autoFillColorRectangle(ctx, pixel, "#000001", 1/6, 1/6, 5/6, 2/3)
|
autoFillColorRectangle(ctx, pixel, "#000100", 1/3, 1/6, 1/6, 2/3)
|
||||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 1/6, 0, 5/6)
|
autoFillColorRectangle(ctx, pixel, "#000100", 1/6, 1/6, 0, 1/6)
|
||||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/3, 1/5, 1/6, 0.5)
|
autoFillColorRectangle(ctx, pixel, "#000100", 1/3, 1/6, 1/6, 0)
|
||||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 1/3, 1/3, 1/3)
|
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/3, 1/3, 1/2, 0)
|
||||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 1/6, 2/3, 0)
|
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/2, 1/6, 1/3, 1/6)
|
||||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/6, 0.5, 2/3, 0.5)
|
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/3, 1/6, 2/3, 2/3)
|
||||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/3, 1/6, 2/3, 0.5)
|
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 1/3, 1/2)
|
||||||
autoFillColorRectangle(ctx, pixel, "#100C1C", 1/3, 1/6, 0.5, 5/6)
|
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/3, 0, 1/2)
|
||||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 0, 2/3)
|
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/5, 1/6, 5/6, 1/2)
|
||||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 1/6, 1/3)
|
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 1/2, 0)
|
||||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 0.5, 0)
|
|
||||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 5/6, 1/3)
|
|
||||||
autoFillColorRectangle(ctx, pixel, "#271E3D", 1/6, 1/6, 1/3, 5/6)
|
|
||||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 0, 1/3)
|
|
||||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 1/6, 1/6)
|
|
||||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/3, 1/6, 1/3, 2/3)
|
|
||||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 2/3, 1/3)
|
|
||||||
autoFillColorRectangle(ctx, pixel, "#3B2754", 1/6, 1/6, 5/6, 1/6)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elements.molten_obsidian = {
|
elements.molten_obsidian = {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,11 @@
|
||||||
// Gallium is the best element
|
// Gallium is the best element
|
||||||
|
async function _nousersthingsprompt(message, defaultValue = "") { // thanks to ggod for updated prompt function
|
||||||
|
return new Promise(resolve => {
|
||||||
|
promptInput(message, (result) => {
|
||||||
|
resolve(result);
|
||||||
|
}, "nousersthings.js is asking you...", defaultValue);
|
||||||
|
})
|
||||||
|
}
|
||||||
behaviors.RADSOLID = [
|
behaviors.RADSOLID = [
|
||||||
"XX|CR:radiation%1|XX",
|
"XX|CR:radiation%1|XX",
|
||||||
"CR:radiation%1|XX|CR:radiation%1",
|
"CR:radiation%1|XX|CR:radiation%1",
|
||||||
|
|
@ -854,11 +861,9 @@ elements.destroyable_e_pipe = {
|
||||||
currentChannel = 0;
|
currentChannel = 0;
|
||||||
elements.channel_pipe = {
|
elements.channel_pipe = {
|
||||||
color: "#414c4f",
|
color: "#414c4f",
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer3 = prompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.",(currentChannel||undefined));
|
currentChannel = await _nousersthingsprompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.", (currentChannel||undefined))
|
||||||
if (!answer3) { return }
|
logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Channel pipes only give pixels to channel pipes with the same channel.");
|
||||||
currentChannel = answer3;
|
|
||||||
logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Use the prop tool to set channel to a number before erasing the holes.");
|
|
||||||
},
|
},
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
if (pixel.start===pixelTicks){
|
if (pixel.start===pixelTicks){
|
||||||
|
|
@ -977,11 +982,9 @@ elements.channel_pipe = {
|
||||||
},
|
},
|
||||||
elements.destroyable_channel_pipe = {
|
elements.destroyable_channel_pipe = {
|
||||||
color: "#414c4f",
|
color: "#414c4f",
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer3 = prompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.",(currentChannel||undefined));
|
currentChannel = await _nousersthingsprompt("Please input the desired channel of this pipe strand. Warning: It wont work if you do multiple strand types while paused.", (currentChannel||undefined))
|
||||||
if (!answer3) { return }
|
logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Use the prop tool to set channel to a number before erasing the holes.");
|
||||||
currentChannel = answer3;
|
|
||||||
logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole. Use the prop tool to set channel to a number before erasing the holes.");
|
|
||||||
},
|
},
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
if (pixel.start === pixelTicks){
|
if (pixel.start === pixelTicks){
|
||||||
|
|
@ -1328,8 +1331,8 @@ elements.bridge_pipe = {
|
||||||
filterTypeVar = 0;
|
filterTypeVar = 0;
|
||||||
elements.filter = {
|
elements.filter = {
|
||||||
color: "#599fc2",
|
color: "#599fc2",
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer4 = prompt("Please input the desired element of this filter. It will not work if you do multiple filter types while paused.",(filterTypeVar||undefined));
|
var answer4 = await _nousersthingsprompt("Please input the desired element of this filter. It will not work if you do multiple filter types while paused.",(filterTypeVar||undefined));
|
||||||
if (!answer4) { return }
|
if (!answer4) { return }
|
||||||
filterTypeVar = answer4;
|
filterTypeVar = answer4;
|
||||||
},
|
},
|
||||||
|
|
@ -1559,11 +1562,11 @@ elements.converter = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer5 = prompt("Please input what type of element should be converted. Write \"all\" to include everything.",(converter1Var||undefined));
|
var answer5 = await _nousersthingsprompt("Please input what type of element should be converted. Write \"all\" to include everything.",(converter1Var||undefined));
|
||||||
if (!answer5) { return }
|
if (!answer5) { return }
|
||||||
converter1Var = answer5;
|
converter1Var = answer5;
|
||||||
var answer6 = prompt("Please input what it should turn into.",(converter2Var||undefined));
|
var answer6 = await _nousersthingsprompt("Please input what it should turn into.",(converter2Var||undefined));
|
||||||
if (!answer6) { return }
|
if (!answer6) { return }
|
||||||
converter2Var = answer6;
|
converter2Var = answer6;
|
||||||
},
|
},
|
||||||
|
|
@ -2302,8 +2305,8 @@ elements.element_filler = {
|
||||||
excludeRandom: true,
|
excludeRandom: true,
|
||||||
state: "solid",
|
state: "solid",
|
||||||
movable: "false",
|
movable: "false",
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer6 = prompt("Please input the desired element of this filler. It will not work if you do multiple filler types while paused.",(elemfillerVar||undefined));
|
var answer6 = await _nousersthingsprompt("Please input the desired element of this filler. It will not work if you do multiple filler types while paused.",(elemfillerVar||undefined));
|
||||||
if (!answer6) { return }
|
if (!answer6) { return }
|
||||||
elemfillerVar = mostSimilarElement(answer6);
|
elemfillerVar = mostSimilarElement(answer6);
|
||||||
},
|
},
|
||||||
|
|
@ -2335,8 +2338,8 @@ elements.inner_outliner = {
|
||||||
color: elements.filler.color,
|
color: elements.filler.color,
|
||||||
category: elements.filler.category,
|
category: elements.filler.category,
|
||||||
excludeRandom: true,
|
excludeRandom: true,
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answerot = prompt("Please input the desired element of this outliner. It will not work if you do multiple outliner types while paused.",(outlinerVar||undefined));
|
var answerot = await _nousersthingsprompt("Please input the desired element of this outliner. It will not work if you do multiple outliner types while paused.",(outlinerVar||undefined));
|
||||||
if (!answerot) { return }
|
if (!answerot) { return }
|
||||||
outlinerVar = mostSimilarElement(answerot);
|
outlinerVar = mostSimilarElement(answerot);
|
||||||
},
|
},
|
||||||
|
|
@ -2566,8 +2569,8 @@ elements.selective_void = {
|
||||||
excludeRandom: true,
|
excludeRandom: true,
|
||||||
state: "solid",
|
state: "solid",
|
||||||
movable: "false",
|
movable: "false",
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var selvoidans = prompt("Please input the desired element of this void. It will not work if you do multiple void types while paused.",(selvoid||undefined));
|
var selvoidans = await _nousersthingsprompt("Please input the desired element of this void. It will not work if you do multiple void types while paused.",(selvoid||undefined));
|
||||||
if (!selvoidans) { return }
|
if (!selvoidans) { return }
|
||||||
selvoid = mostSimilarElement(selvoidans);
|
selvoid = mostSimilarElement(selvoidans);
|
||||||
},
|
},
|
||||||
|
|
@ -2594,8 +2597,8 @@ elements.scuffed_circle_brush = {
|
||||||
excludeRandom: true,
|
excludeRandom: true,
|
||||||
state: "solid",
|
state: "solid",
|
||||||
movable: false,
|
movable: false,
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
var answerE = prompt("Element of the brush.",(circleElem||undefined));
|
var answerE = await _nousersthingsprompt("Element of the brush.",(circleElem||undefined));
|
||||||
if (!answerE) { return }
|
if (!answerE) { return }
|
||||||
circleElem = mostSimilarElement(answerE);
|
circleElem = mostSimilarElement(answerE);
|
||||||
},
|
},
|
||||||
|
|
@ -2616,8 +2619,8 @@ elements.scuffed_triangle_brush = {
|
||||||
excludeRandom: true,
|
excludeRandom: true,
|
||||||
state: "solid",
|
state: "solid",
|
||||||
movable: false,
|
movable: false,
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
var answerE = prompt("Element of the brush.",(circleElem||undefined));
|
var answerE = await _nousersthingsprompt("Element of the brush.",(circleElem||undefined));
|
||||||
if (!answerE) { return }
|
if (!answerE) { return }
|
||||||
circleElem = mostSimilarElement(answerE);
|
circleElem = mostSimilarElement(answerE);
|
||||||
},
|
},
|
||||||
|
|
@ -2666,8 +2669,8 @@ elements.grid_brush = {
|
||||||
behavior: behaviors.WALL,
|
behavior: behaviors.WALL,
|
||||||
category: "special",
|
category: "special",
|
||||||
movable: false,
|
movable: false,
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var gridans = prompt("Please input the desired element of this grid brush",(gridElem||undefined));
|
var gridans = await _nousersthingsprompt("Please input the desired element of this grid brush",(gridElem||undefined));
|
||||||
if (!gridans) { return }
|
if (!gridans) { return }
|
||||||
gridElem = mostSimilarElement(gridans);
|
gridElem = mostSimilarElement(gridans);
|
||||||
},
|
},
|
||||||
|
|
@ -2733,11 +2736,11 @@ elements.ray_emitter = {
|
||||||
behavior: behaviors.WALL,
|
behavior: behaviors.WALL,
|
||||||
category: "machines",
|
category: "machines",
|
||||||
movable: false,
|
movable: false,
|
||||||
onSelect: function(pixel){
|
onSelect: async function(pixel){
|
||||||
var rayans = prompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
var rayans = await _nousersthingsprompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
||||||
if (!rayans) { return }
|
if (!rayans) { return }
|
||||||
rayElement = mostSimilarElement(rayans);
|
rayElement = mostSimilarElement(rayans);
|
||||||
var rayans2 = prompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
var rayans2 = await _nousersthingsprompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
||||||
if (rayans2 == "false"){rayStoppedByWalls = false} else {rayStoppedByWalls = true}
|
if (rayans2 == "false"){rayStoppedByWalls = false} else {rayStoppedByWalls = true}
|
||||||
},
|
},
|
||||||
hoverStat: function(pixel){
|
hoverStat: function(pixel){
|
||||||
|
|
@ -2849,37 +2852,37 @@ elements.specific_ray_emitter = {
|
||||||
behavior: behaviors.WALL,
|
behavior: behaviors.WALL,
|
||||||
category: "machines",
|
category: "machines",
|
||||||
movable: false,
|
movable: false,
|
||||||
onSelect: function(pixel){
|
onSelect: async function(pixel){
|
||||||
var rayans = prompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
var rayans = await _nousersthingsprompt("Please input the desired element of this ray emitter",(rayElement||undefined));
|
||||||
if (!rayans) { return }
|
if (!rayans) { return }
|
||||||
rayElement = mostSimilarElement(rayans);
|
rayElement = mostSimilarElement(rayans);
|
||||||
if (rayElement != "ray"){rainbowMode = false}
|
if (rayElement != "ray"){rainbowMode = false}
|
||||||
var rayans2 = prompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
var rayans2 = await _nousersthingsprompt("Should the ray be stopped by walls? Write true or false.",(rayStoppedByWalls||false));
|
||||||
if (rayans2 == "false"){rayStoppedByWalls = false} else {rayStoppedByWalls = true}
|
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));
|
var rayans3 = await _nousersthingsprompt("How much should the beginning of the ray be offset from the emitter?", (specificRayStart||0));
|
||||||
if (!rayans3) { return }
|
if (!rayans3) { return }
|
||||||
specificRayStart = rayans3
|
specificRayStart = rayans3
|
||||||
var rayans4 = prompt("How much should the end of the ray be offset from the emitter?", (specificRayEnd||0));
|
var rayans4 = await _nousersthingsprompt("How much should the end of the ray be offset from the emitter?", (specificRayEnd||0));
|
||||||
if (!rayans4) { return }
|
if (!rayans4) { return }
|
||||||
specificRayEnd = rayans4
|
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));
|
var rayans5 = await _nousersthingsprompt("What angle should the ray be emitted at? Type anything that isnt a number to use default angle logic.", (specificRayAngle||0));
|
||||||
if (!rayans5) { return }
|
if (!rayans5) { return }
|
||||||
specificRayAngle = rayans5
|
specificRayAngle = rayans5
|
||||||
if (isNaN(parseFloat(specificRayAngle))){
|
if (isNaN(parseFloat(specificRayAngle))){
|
||||||
specificRayAngle = "nah"
|
specificRayAngle = "nah"
|
||||||
}
|
}
|
||||||
var rayans6 = prompt("What element should the ray stop at?", (stopAtElement||"wall"));
|
var rayans6 = await _nousersthingsprompt("What element should the ray stop at?", (stopAtElement||"wall"));
|
||||||
if (!rayans6) { return }
|
if (!rayans6) { return }
|
||||||
stopAtElement = mostSimilarElement(rayans6)
|
stopAtElement = mostSimilarElement(rayans6)
|
||||||
let rayans7
|
let rayans7
|
||||||
if (rayans == "ray"){ rayans7 = prompt("How long should the ray stay on screen in ticks?", (rayLife||10));
|
if (rayans == "ray"){ rayans7 = await _nousersthingsprompt("How long should the ray stay on screen in ticks?", (rayLife||10));
|
||||||
if (!rayans7) { return }
|
if (!rayans7) { return }
|
||||||
if (isNaN(parseFloat(rayans7))){
|
if (isNaN(parseFloat(rayans7))){
|
||||||
rayLife = 10
|
rayLife = 10
|
||||||
} else {
|
} else {
|
||||||
rayLife = rayans7
|
rayLife = rayans7
|
||||||
}
|
}
|
||||||
var rayans8 = prompt("Would you like rainbow mode to be enabled? Type yes or no.", (rainbowMode||"no"));
|
var rayans8 = await _nousersthingsprompt("Would you like rainbow mode to be enabled? Type yes or no.", (rainbowMode||"no"));
|
||||||
if (rayans8 == "yes"){rainbowMode = true} else {rainbowMode = false}
|
if (rayans8 == "yes"){rainbowMode = true} else {rainbowMode = false}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -2978,8 +2981,8 @@ elements.run_some_code = {
|
||||||
category: "tools",
|
category: "tools",
|
||||||
canPlace: false,
|
canPlace: false,
|
||||||
tool: function(){},
|
tool: function(){},
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
let code = prompt("Enter code to run")
|
let code = await _nousersthingsprompt("Enter code to run")
|
||||||
if (code){
|
if (code){
|
||||||
eval(code)
|
eval(code)
|
||||||
}
|
}
|
||||||
|
|
@ -3096,8 +3099,8 @@ elements.piston_ray_emitter = {
|
||||||
behavior: behaviors.WALL,
|
behavior: behaviors.WALL,
|
||||||
category: "machines",
|
category: "machines",
|
||||||
movable: false,
|
movable: false,
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
var ans1 = prompt("Would you like this piston to pull or push?", "pull").toLowerCase();
|
var ans1 = await _nousersthingsprompt("Would you like this piston to pull or push?", "pull").toLowerCase();
|
||||||
if (ans1 == "pull"){pullOrPush = 1}
|
if (ans1 == "pull"){pullOrPush = 1}
|
||||||
else if (ans1 == "push"){pullOrPush = 2}
|
else if (ans1 == "push"){pullOrPush = 2}
|
||||||
},
|
},
|
||||||
|
|
@ -3187,22 +3190,22 @@ elements.specific_piston_ray_emitter = {
|
||||||
behavior: behaviors.WALL,
|
behavior: behaviors.WALL,
|
||||||
category: "machines",
|
category: "machines",
|
||||||
movable: false,
|
movable: false,
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
var ans1 = prompt("Would you like this piston to pull or push?", "pull").toLowerCase();
|
var ans1 = await _nousersthingsprompt("Would you like this piston to pull or push?", "pull").toLowerCase();
|
||||||
if (ans1 == "pull"){pullOrPush = 1}
|
if (ans1 == "pull"){pullOrPush = 1}
|
||||||
else if (ans1 == "push"){pullOrPush = 2}
|
else if (ans1 == "push"){pullOrPush = 2}
|
||||||
var ans2 = parseInt(prompt("How offset should the start of the push/pulling be?", "0"))
|
var ans2 = parseInt(await _nousersthingsprompt("How offset should the start of the push/pulling be?", "0"))
|
||||||
pistonStart = ans2
|
pistonStart = ans2
|
||||||
var ans3 = parseInt(prompt("How offset should the end of the push/pulling be?", "20"))
|
var ans3 = parseInt(await _nousersthingsprompt("How offset should the end of the push/pulling be?", "20"))
|
||||||
pistonEnd = ans3
|
pistonEnd = ans3
|
||||||
var ans4 = parseInt(prompt("How far should it push the pixels each charge?", "1"))
|
var ans4 = parseInt(await _nousersthingsprompt("How far should it push the pixels each charge?", "1"))
|
||||||
pistonDistance = ans4
|
pistonDistance = ans4
|
||||||
var ans5 = parseInt(prompt("How many ticks should it wait to be charged again?", "6"))
|
var ans5 = parseInt(await _nousersthingsprompt("How many ticks should it wait to be charged again?", "6"))
|
||||||
pistonCooldown = ans5
|
pistonCooldown = ans5
|
||||||
var ans6 = parseInt(prompt("How many times should it repeat the push/pulling?", "1"))
|
var ans6 = parseInt(await _nousersthingsprompt("How many times should it repeat the push/pulling?", "1"))
|
||||||
pistonRepeat = ans6
|
pistonRepeat = ans6
|
||||||
if (pistonRepeat != 1){
|
if (pistonRepeat != 1){
|
||||||
var ans7 = parseInt(prompt("How many ticks should it wait between repeats?", "1"))
|
var ans7 = parseInt(await _nousersthingsprompt("How many ticks should it wait between repeats?", "1"))
|
||||||
pistonRepeatCooldown = ans7
|
pistonRepeatCooldown = ans7
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -3468,8 +3471,8 @@ elements.lattice_brush = {
|
||||||
color: elements.grid_brush.color,
|
color: elements.grid_brush.color,
|
||||||
behavior: behaviors.WALL,
|
behavior: behaviors.WALL,
|
||||||
category: "special",
|
category: "special",
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
let ans1 = prompt("Enter the element you want to use for the lattice", latticeElem||"wood")
|
let ans1 = await _nousersthingsprompt("Enter the element you want to use for the lattice", latticeElem||"wood")
|
||||||
latticeElem = mostSimilarElement(ans1)
|
latticeElem = mostSimilarElement(ans1)
|
||||||
},
|
},
|
||||||
tick: function(pixel){
|
tick: function(pixel){
|
||||||
|
|
@ -3490,8 +3493,8 @@ elements.spaced_lattice_brush = {
|
||||||
color: elements.grid_brush.color,
|
color: elements.grid_brush.color,
|
||||||
behavior: behaviors.WALL,
|
behavior: behaviors.WALL,
|
||||||
category: "special",
|
category: "special",
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
let ans1 = prompt("Enter the element you want to use for the lattice", latticeElem||"wood")
|
let ans1 = await _nousersthingsprompt("Enter the element you want to use for the lattice", latticeElem||"wood")
|
||||||
latticeElem = mostSimilarElement(ans1)
|
latticeElem = mostSimilarElement(ans1)
|
||||||
},
|
},
|
||||||
tick: function(pixel){
|
tick: function(pixel){
|
||||||
|
|
@ -3516,8 +3519,8 @@ elements.outer_outliner = {
|
||||||
color: elements.inner_outliner.color,
|
color: elements.inner_outliner.color,
|
||||||
behavior: behaviors.WALL,
|
behavior: behaviors.WALL,
|
||||||
category: "special",
|
category: "special",
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
let ans1 = prompt("Enter the element you want to use for the outliner. The outliner will ignore pixels of this type.", outlinerElem||"wood")
|
let ans1 = await _nousersthingsprompt("Enter the element you want to use for the outliner. The outliner will ignore pixels of this type.", outlinerElem||"wood")
|
||||||
outlinerElem = mostSimilarElement(ans1)
|
outlinerElem = mostSimilarElement(ans1)
|
||||||
},
|
},
|
||||||
tick: function(pixel){
|
tick: function(pixel){
|
||||||
|
|
@ -3622,8 +3625,8 @@ elements.copycat_filler = {
|
||||||
color: elements.random.color,
|
color: elements.random.color,
|
||||||
behavior:behaviors.WALL,
|
behavior:behaviors.WALL,
|
||||||
category: "special",
|
category: "special",
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
let ans1 = prompt("Enter the element you want to use for the copycat filler", copycatfillerElem||"sand")
|
let ans1 = await _nousersthingsprompt("Enter the element you want to use for the copycat filler", copycatfillerElem||"sand")
|
||||||
copycatfillerElem = mostSimilarElement(ans1)
|
copycatfillerElem = mostSimilarElement(ans1)
|
||||||
},
|
},
|
||||||
tick: function(pixel){
|
tick: function(pixel){
|
||||||
|
|
@ -3799,8 +3802,8 @@ elements.pipe_transmitter = {
|
||||||
movable: false,
|
movable: false,
|
||||||
canContain: true,
|
canContain: true,
|
||||||
insulate: true,
|
insulate: true,
|
||||||
onSelect: () => {
|
onSelect: async () => {
|
||||||
let newChannel = prompt("Enter the channel of this pipe transmitter. It will not work if you do multiple while paused.", pipe_transmitter_channelVar);
|
let newChannel = await _nousersthingsprompt("Enter the channel of this pipe transmitter. It will not work if you do multiple while paused.", pipe_transmitter_channelVar);
|
||||||
pipe_transmitter_channelVar = newChannel;
|
pipe_transmitter_channelVar = newChannel;
|
||||||
},
|
},
|
||||||
tick: (pixel) => {
|
tick: (pixel) => {
|
||||||
|
|
@ -3830,8 +3833,8 @@ elements.pipe_receiver = {
|
||||||
movable: false,
|
movable: false,
|
||||||
canContain: true,
|
canContain: true,
|
||||||
insulate: true,
|
insulate: true,
|
||||||
onSelect: () => {
|
onSelect: async () => {
|
||||||
let newChannel = prompt("Enter the channel of this pipe receiver. It will not work if you do multiple while paused.", pipe_receiver_channelVar);
|
let newChannel = await _nousersthingsprompt("Enter the channel of this pipe receiver. It will not work if you do multiple while paused.", pipe_receiver_channelVar);
|
||||||
pipe_receiver_channelVar = newChannel;
|
pipe_receiver_channelVar = newChannel;
|
||||||
},
|
},
|
||||||
tick: (pixel) => {
|
tick: (pixel) => {
|
||||||
|
|
@ -3911,8 +3914,8 @@ elements.sign = {
|
||||||
color: "#FFFFFF",
|
color: "#FFFFFF",
|
||||||
darkText: true,
|
darkText: true,
|
||||||
category: "special",
|
category: "special",
|
||||||
onSelect: function(){
|
onSelect: async function(){
|
||||||
let signi = prompt("What text should the sign display?", signInput||"Hello World!")
|
let signi = await _nousersthingsprompt("What text should the sign display?", signInput||"Hello World!")
|
||||||
signInput = signi;
|
signInput = signi;
|
||||||
},
|
},
|
||||||
renderer: function(pixel, ctx){
|
renderer: function(pixel, ctx){
|
||||||
|
|
@ -3925,8 +3928,8 @@ elements.e_sign = {
|
||||||
darkText: true,
|
darkText: true,
|
||||||
category: "special",
|
category: "special",
|
||||||
movable: false,
|
movable: false,
|
||||||
onSelect: () => {
|
onSelect: async () => {
|
||||||
let signi = prompt("What text should the sign display?", signInput||"Hello World!")
|
let signi = await _nousersthingsprompt("What text should the sign display?", signInput||"Hello World!")
|
||||||
signInput = signi;
|
signInput = signi;
|
||||||
},
|
},
|
||||||
renderer: function(pixel, ctx){
|
renderer: function(pixel, ctx){
|
||||||
|
|
@ -3972,8 +3975,8 @@ elements.mod_dectector = {
|
||||||
category: "machines",
|
category: "machines",
|
||||||
movable: false,
|
movable: false,
|
||||||
excludeRandom: true,
|
excludeRandom: true,
|
||||||
onSelect: () => {
|
onSelect: async () => {
|
||||||
let newMod = prompt("What mod should this machine detect?", "nousersthings.js"||modName)
|
let newMod = await _nousersthingsprompt("What mod should this machine detect?", "nousersthings.js"||modName)
|
||||||
machinemodName = newMod
|
machinemodName = newMod
|
||||||
},
|
},
|
||||||
tick: (pixel) => {
|
tick: (pixel) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue