Nichrome + dependencies

* Nichrome heats up when charged.
* It can be formed by alloying nickel and the new chromium.
* For those reactions, the "runAfterAutogen and onload restructure.js" and "changeTempReactionParameter.js" are required.
This commit is contained in:
Laetitia (O-01-67) 2023-02-06 12:05:38 -05:00 committed by GitHub
parent 6e975dd607
commit d608af8060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 468 additions and 385 deletions

View File

@ -1,16 +1,93 @@
elements.iron.hardness = 0.74 var modName = "mods/metals.js";
//https://www.engineeringtoolbox.com/bhn-brinell-hardness-number-d_1365.html var changeTempMod = "mods/changeTempReactionParameter.js";
//https://en.wikipedia.org/wiki/Hardnesses_of_the_elements_(data_page) var runAfterAutogenMod = "mods/runAfterAutogen and onload restructure.js";
//"Annealed chissel steel" hardness and then divided by iron hardness (Brinell) if(enabledMods.includes(changeTempMod) && enabledMods.includes(runAfterAutogenMod)) {
//sqrt()ed like IACS-derived conductivities and scaled to the 0.8 hardness of steel elements.iron.hardness = 0.74
//and because 1 means infinite hardness, the others are derived using //https://www.engineeringtoolbox.com/bhn-brinell-hardness-number-d_1365.html
//1-(0.26/(otherThingBHN/200)) //https://en.wikipedia.org/wiki/Hardnesses_of_the_elements_(data_page)
//it doesn't matter much anyway but I'd like to have some semblance/veneer of accuracy //"Annealed chissel steel" hardness and then divided by iron hardness (Brinell)
//Then I nerfed and buffed some of them with inconsistent rounding. //sqrt()ed like IACS-derived conductivities and scaled to the 0.8 hardness of steel
//and because 1 means infinite hardness, the others are derived using
//1-(0.26/(otherThingBHN/200))
//it doesn't matter much anyway but I'd like to have some semblance/veneer of accuracy
//Then I nerfed and buffed some of them with inconsistent rounding.
//Copper exists elements.chromium = {
color: ["#c8cccb", "#dce3e0", "#ebedeb"],
behavior: behaviors.WALL,
reactions: {
elements.ruthenium = { },
tempHigh: 1907,
category: "solids",
density: 7190,
conduct: 0.35,
hardness: 0.985,
state: "solid",
};
nichromeDoNeighborCount = true;
function nichromeNeighborLogic(count) {
if(count < 3) { return 2.5 };
return count == 3 ? 1.25 : 0;
};
elements.nichrome = {
color: ["#d1cfcb", "#dbd7ce", "#e8e2d5"],
behavior: behaviors.WALL,
tempHigh: 1400,
category: "solids",
density: 8300,
conduct: 0.75,
hardness: 0.7, //???
state: "solid",
tick: function(pixel) {
if(nichromeDoNeighborCount) {
var neighbors = 0;
for(i = 0; i < adjacentCoords.length; i++) {
if(!isEmpty(pixel.x+adjacentCoords[i][0],pixel.y+adjacentCoords[i][1],true)) {
var newPixel = pixelMap[pixel.x+adjacentCoords[i][0]][pixel.y+adjacentCoords[i][1]];
if(elements[newPixel.element].conduct) { neighbors++ };
};
};
};
if(pixel.charge) {
pixel.temp += ((1.1 + nichromeNeighborLogic(neighbors)) * pixel.charge);
};
},
};
elements.molten_chromium = {
density: 6300,
temp: 2000,
reactions: { //(test.hello ??= {}).world
molten_nichrome: { elem1: "molten_nichrome", elem2: "molten_chromium", chance: 0.4, changeTemp: false, oneway: true },
},
};
elements.molten_nichrome = {
reactions: { //(test.hello ??= {}).world
molten_nickel: { elem1: "molten_nickel", elem2: "molten_nichrome", chance: 0.4, changeTemp: false, oneway: true },
},
};
worldgentypes.test = {
layers: [[0.3, "pointer"], [0, "molten_nickel"]],
temperature: 2000
};
runAfterAutogen(function() {
if(!elements.molten_nickel.reactions) {
elements.molten_nickel.reactions = {};
};
elements.molten_nickel.reactions.molten_chromium = { elem1: "molten_nichrome", elem2: ["molten_chromium","molten_chromium","molten_chromium","molten_chromium","molten_nichrome"], changeTemp: false };
});
//Copper exists
elements.ruthenium = {
color: ["#e8ebca","#eaebd5"], //color pulled from my ass because I don't want another gray metal color: ["#e8ebca","#eaebd5"], //color pulled from my ass because I don't want another gray metal
behavior: behaviors.WALL, behavior: behaviors.WALL,
tempHigh: 2334, tempHigh: 2334,
@ -19,13 +96,13 @@ elements.ruthenium = {
density: 12450, density: 12450,
conduct: 0.45, conduct: 0.45,
hardness: 0.97, hardness: 0.97,
}, },
elements.molten_ruthenium = { elements.molten_ruthenium = {
density: 10650, density: 10650,
}, },
elements.rhodium = { elements.rhodium = {
color: ["#f0e4df","#f7eae4"], //it looked slightly reddish on Wikipedia color: ["#f0e4df","#f7eae4"], //it looked slightly reddish on Wikipedia
behavior: behaviors.WALL, behavior: behaviors.WALL,
tempHigh: 1964, tempHigh: 1964,
@ -34,13 +111,13 @@ elements.rhodium = {
density: 12410, density: 12410,
conduct: 0.59, conduct: 0.59,
hardness: 0.95, hardness: 0.95,
}, },
elements.molten_rhodium = { elements.molten_rhodium = {
density: 10700, density: 10700,
}, },
elements.palladium = { elements.palladium = {
color: ["#fff8ed","#f5e6ce","#faeccf"], //Terraria reference color: ["#fff8ed","#f5e6ce","#faeccf"], //Terraria reference
behavior: behaviors.WALL, behavior: behaviors.WALL,
tempHigh: 1555, tempHigh: 1555,
@ -49,15 +126,15 @@ elements.palladium = {
density: 12023, density: 12023,
conduct: 0.38, conduct: 0.38,
hardness: 0.83, hardness: 0.83,
}, },
elements.molten_palladium = { elements.molten_palladium = {
density: 10380, density: 10380,
}, },
//Silver exists //Silver exists
elements.rhenium = { elements.rhenium = {
color: ["#e5f0d1","#e6edda"], //it looks like almost every other metal but in some pictures the lighting makes it look ever-so-slightly greenish color: ["#e5f0d1","#e6edda"], //it looks like almost every other metal but in some pictures the lighting makes it look ever-so-slightly greenish
behavior: behaviors.WALL, behavior: behaviors.WALL,
tempHigh: 3186, tempHigh: 3186,
@ -66,13 +143,13 @@ elements.rhenium = {
density: 21020, density: 21020,
conduct: 0.29, conduct: 0.29,
hardness: 0.96, hardness: 0.96,
}, },
elements.molten_rhenium = { elements.molten_rhenium = {
density: 18900, density: 18900,
}, },
elements.osmium = { elements.osmium = {
color: ["#d8e1eb","#cee1f0"], //it looks bluish color: ["#d8e1eb","#cee1f0"], //it looks bluish
behavior: behaviors.WALL, behavior: behaviors.WALL,
tempHigh: 3033, tempHigh: 3033,
@ -81,13 +158,13 @@ elements.osmium = {
density: 22590, density: 22590,
conduct: 0.40, conduct: 0.40,
hardness: 0.98, hardness: 0.98,
}, },
elements.molten_osmium = { elements.molten_osmium = {
density: 2e4, density: 2e4,
}, },
elements.iridium = { elements.iridium = {
color: ["#dfb9f0","#d6a9eb","#dfd1ed","#eeeeee"], //Minecraft and Stardew Valley reference color: ["#dfb9f0","#d6a9eb","#dfd1ed","#eeeeee"], //Minecraft and Stardew Valley reference
behavior: behaviors.WALL, behavior: behaviors.WALL,
tempHigh: 2446, tempHigh: 2446,
@ -96,13 +173,13 @@ elements.iridium = {
density: 22560, density: 22560,
conduct: 0.54, conduct: 0.54,
hardness: 0.97, hardness: 0.97,
}, },
elements.molten_iridium = { elements.molten_iridium = {
density: 19000, density: 19000,
}, },
elements.platinum = { elements.platinum = {
color: ["#dddddd","#d7d7d7"], color: ["#dddddd","#d7d7d7"],
behavior: behaviors.WALL, behavior: behaviors.WALL,
tempHigh: 1768, tempHigh: 1768,
@ -111,15 +188,15 @@ elements.platinum = {
density: 21450, density: 21450,
conduct: 0.38, conduct: 0.38,
hardness: 0.83226, hardness: 0.83226,
}, },
elements.molten_platinum = { elements.molten_platinum = {
density: 19770, density: 19770,
}, },
//Gold exists //Gold exists
elements.mercury = { elements.mercury = {
color: ["#d1d1d1", "#bababa"], color: ["#d1d1d1", "#bababa"],
behavior: behaviors.LIQUID, behavior: behaviors.LIQUID,
tempHigh: 357, tempHigh: 357,
@ -131,9 +208,9 @@ elements.mercury = {
density: 13534, density: 13534,
conduct: 0.13, conduct: 0.13,
breakInto: "mercury_gas", breakInto: "mercury_gas",
}, },
elements.frozen_mercury = { elements.frozen_mercury = {
color: ["#d1d1d1", "#bababa"], color: ["#d1d1d1", "#bababa"],
density: 14184, density: 14184,
behavior: behaviors.WALL, behavior: behaviors.WALL,
@ -146,9 +223,9 @@ elements.frozen_mercury = {
state: "solid", state: "solid",
hidden: true, hidden: true,
hardness: 0.2775, //(desperately scaled Mohs hardness) hardness: 0.2775, //(desperately scaled Mohs hardness)
}, },
elements.mercury_gas = { //hg d@bp extrapolated from density change with temperature: 12743 elements.mercury_gas = { //hg d@bp extrapolated from density change with temperature: 12743
density: 8.477, density: 8.477,
color: ["#d1d1d1", "#bababa"], color: ["#d1d1d1", "#bababa"],
colorOn: ["#96ffbf", "#9cffc2", "#9effe7"], colorOn: ["#96ffbf", "#9cffc2", "#9effe7"],
@ -160,19 +237,19 @@ elements.mercury_gas = { //hg d@bp extrapolated from density change with tempera
category: "gases", category: "gases",
state: "gas", state: "gas",
hidden: true, hidden: true,
} }
neighbors = [[-1,0],[0,-1],[1,0],[0,1]] neighbors = [[-1,0],[0,-1],[1,0],[0,1]]
function randomChoice(array) { function randomChoice(array) {
return array[Math.floor(Math.random() * array.length)]; return array[Math.floor(Math.random() * array.length)];
} }
function exposedToAir(pixel) { function exposedToAir(pixel) {
return (isEmpty(pixel.x+1,pixel.y) || isEmpty(pixel.x-1,pixel.y) || isEmpty(pixel.x,pixel.y+1) || isEmpty(pixel.x,pixel.y-1)); return (isEmpty(pixel.x+1,pixel.y) || isEmpty(pixel.x-1,pixel.y) || isEmpty(pixel.x,pixel.y+1) || isEmpty(pixel.x,pixel.y-1));
} }
function tryTarnish(pixel,element,chance) { function tryTarnish(pixel,element,chance) {
if(exposedToAir(pixel)) { if(exposedToAir(pixel)) {
if(Array.isArray(element)) { if(Array.isArray(element)) {
if(Math.random() < chance) { if(Math.random() < chance) {
@ -184,10 +261,10 @@ function tryTarnish(pixel,element,chance) {
} }
} }
} }
} }
//Non-element: Liquid ammonia //Non-element: Liquid ammonia
elements.liquid_ammonia = { elements.liquid_ammonia = {
color: "#bab6a9", color: "#bab6a9",
behavior: behaviors.LIQUID, behavior: behaviors.LIQUID,
reactions: { reactions: {
@ -217,17 +294,17 @@ elements.liquid_ammonia = {
state: "liquid", state: "liquid",
hidden: true, hidden: true,
density: 681.9, density: 681.9,
} }
elements.ammonia.tempLow = -78 elements.ammonia.tempLow = -78
elements.ammonia.stateLow = "liquid_ammonia" elements.ammonia.stateLow = "liquid_ammonia"
//Hydrogen //Hydrogen
//Hydrogen exists, but its solid form doesn't. //Hydrogen exists, but its solid form doesn't.
elements.liquid_hydrogen.tempLow = -259.16 elements.liquid_hydrogen.tempLow = -259.16
elements.liquid_hydrogen.stateLow = "hydrogen_ice" elements.liquid_hydrogen.stateLow = "hydrogen_ice"
elements.hydrogen_ice = { elements.hydrogen_ice = {
color: "#E6E6FF", color: "#E6E6FF",
behavior: behaviors.WALL, behavior: behaviors.WALL,
density: 76, density: 76,
@ -236,10 +313,10 @@ elements.hydrogen_ice = {
hidden: true, hidden: true,
tempHigh: -259, tempHigh: -259,
stateHigh: "liquid_hydrogen", stateHigh: "liquid_hydrogen",
} }
//Lithium (incomplete/hiatus) //Lithium (incomplete/hiatus)
elements.lithium = { elements.lithium = {
color: "#b0ab9d", color: "#b0ab9d",
behavior: behaviors.WALL, behavior: behaviors.WALL,
tick: function(pixel) { tick: function(pixel) {
@ -268,9 +345,9 @@ elements.lithium = {
burnTime: 130, burnTime: 130,
burnInto: "lithium_oxide", burnInto: "lithium_oxide",
fireColor: "#fc0a22", fireColor: "#fc0a22",
} }
elements.molten_lithium = { //too damn reactive elements.molten_lithium = { //too damn reactive
color: "#b0ab9d", color: "#b0ab9d",
behavior: [ behavior: [
"XX|HT:1%1|XX", "XX|HT:1%1|XX",
@ -294,9 +371,9 @@ elements.molten_lithium = { //too damn reactive
burnInto: "lithium_oxide", burnInto: "lithium_oxide",
fireColor: "#fc0a22", fireColor: "#fc0a22",
density: 512, density: 512,
} }
elements.lithium_oxide = { elements.lithium_oxide = {
color: "#eee9ec", //HRT UV-to-visible strategy again color: "#eee9ec", //HRT UV-to-visible strategy again
behavior: behaviors.POWDER, behavior: behaviors.POWDER,
reactions: { reactions: {
@ -309,9 +386,9 @@ elements.lithium_oxide = {
state: "solid", state: "solid",
hidden: true, hidden: true,
tempHigh: 1438, tempHigh: 1438,
} }
elements.lithium_hydroxide = { elements.lithium_hydroxide = {
color: "#eeeeee", color: "#eeeeee",
behavior: behaviors.POWDER, behavior: behaviors.POWDER,
reactions: { reactions: {
@ -324,9 +401,9 @@ elements.lithium_hydroxide = {
state: "solid", state: "solid",
hidden: true, hidden: true,
tempHigh: 462, tempHigh: 462,
} }
elements.lithium_hydroxide_monohydrate = { elements.lithium_hydroxide_monohydrate = {
color: "#e0e4e7", color: "#e0e4e7",
behavior: behaviors.POWDER, behavior: behaviors.POWDER,
reactions: { reactions: {
@ -353,9 +430,9 @@ elements.lithium_hydroxide_monohydrate = {
category: "powders", category: "powders",
state: "solid", state: "solid",
hidden: true, hidden: true,
} }
elements.lithium_carbonate = { //todo elements.lithium_carbonate = { //todo
color: "#eeeeee", color: "#eeeeee",
behavior: behaviors.POWDER, behavior: behaviors.POWDER,
density: 2110, density: 2110,
@ -363,9 +440,9 @@ elements.lithium_carbonate = { //todo
state: "solid", state: "solid",
hidden: true, hidden: true,
tempHigh: 723, tempHigh: 723,
} }
elements.lithium_nitride = { elements.lithium_nitride = {
color: "#eeeeee", color: "#eeeeee",
behavior: behaviors.POWDER, behavior: behaviors.POWDER,
reactions: { reactions: {
@ -379,9 +456,9 @@ elements.lithium_nitride = {
state: "solid", state: "solid",
hidden: true, hidden: true,
tempHigh: 813, tempHigh: 813,
} }
elements.lithium_hydride = { elements.lithium_hydride = {
color: "#eeeeee", color: "#eeeeee",
behavior: behaviors.POWDER, behavior: behaviors.POWDER,
reactions: { //the acid part of lye reactions: { //the acid part of lye
@ -393,9 +470,9 @@ elements.lithium_hydride = {
state: "solid", state: "solid",
hidden: true, hidden: true,
tempHigh: 689, tempHigh: 689,
} }
elements.lithium_amide = { elements.lithium_amide = {
color: "#eeeeee", color: "#eeeeee",
behavior: behaviors.POWDER, behavior: behaviors.POWDER,
reactions: { reactions: {
@ -407,15 +484,15 @@ elements.lithium_amide = {
state: "solid", state: "solid",
hidden: true, hidden: true,
tempHigh: 375, tempHigh: 375,
} }
//Sodium exists //Sodium exists
//... //...
//at request of Serioustar#1337 //at request of Serioustar#1337
elements.niobium = { elements.niobium = {
color: ["#dedede","#edead8","#e8e9ed"], color: ["#dedede","#edead8","#e8e9ed"],
behavior: behaviors.WALL, behavior: behaviors.WALL,
tempHigh: 2477, tempHigh: 2477,
@ -423,4 +500,10 @@ elements.niobium = {
density: 8570, density: 8570,
conduct: 0.35, conduct: 0.35,
hardness: 0.7, //idk lol hardness: 0.7, //idk lol
};
} else {
if(!enabledMods.includes(changeTempMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,changeTempMod) };
if(!enabledMods.includes(runAfterAutogenMod)) { enabledMods.splice(enabledMods.indexOf(modName),0,runAfterAutogenMod) };
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
alert(`The "${changeTempMod}" and "${runAfterAutogenMod}" mods are required; any missing mods in this list have been automatically inserted (reload for this to take effect).`)
}; };