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:
parent
6e975dd607
commit
d608af8060
|
|
@ -1,3 +1,7 @@
|
|||
var modName = "mods/metals.js";
|
||||
var changeTempMod = "mods/changeTempReactionParameter.js";
|
||||
var runAfterAutogenMod = "mods/runAfterAutogen and onload restructure.js";
|
||||
if(enabledMods.includes(changeTempMod) && enabledMods.includes(runAfterAutogenMod)) {
|
||||
elements.iron.hardness = 0.74
|
||||
//https://www.engineeringtoolbox.com/bhn-brinell-hardness-number-d_1365.html
|
||||
//https://en.wikipedia.org/wiki/Hardnesses_of_the_elements_(data_page)
|
||||
|
|
@ -8,6 +12,79 @@ elements.iron.hardness = 0.74
|
|||
//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.
|
||||
|
||||
elements.chromium = {
|
||||
color: ["#c8cccb", "#dce3e0", "#ebedeb"],
|
||||
behavior: behaviors.WALL,
|
||||
reactions: {
|
||||
|
||||
},
|
||||
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 = {
|
||||
|
|
@ -424,3 +501,9 @@ elements.niobium = {
|
|||
conduct: 0.35,
|
||||
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).`)
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue