diff --git a/lang/zh_hant.json b/lang/zh_hant.json
index 4cfe2415..dfdc2281 100644
--- a/lang/zh_hant.json
+++ b/lang/zh_hant.json
@@ -14,6 +14,7 @@
"machines":"機器",
"special":"特別",
"other":"別徳",
+"states":"狀態",
"heat":"加熱",
"cool":"冷卻",
"erase":"擦",
@@ -549,5 +550,11 @@
"rice":"米",
"galvanized_steel":"鍍鋅鋼",
"midas_touch":"點石成金",
-"liquid_ozone":"液臭氧"
+"liquid_ozone":"液臭氧",
+"ectoplasm":"外質",
+"soul":"鬼",
+"tombstone":"墳墓",
+"spider":"蜘蛛",
+"web":"蜘蛛網"
+
}
diff --git a/mods/betterStats.js b/mods/betterStats.js
index 3c043b10..2cb49bdb 100644
--- a/mods/betterStats.js
+++ b/mods/betterStats.js
@@ -26,7 +26,7 @@ function updateStatsNew() {
if (pixelMap[mousePos.x] != undefined) {
var currentPixel = pixelMap[mousePos.x][mousePos.y];
if (currentPixel != undefined) {
- stats += "Elem:" + (elements[currentPixel.element].name || currentPixel.element).toUpperCase() + "";
+ stats += "Elem:" + (elements[currentPixel.element].name || currentPixel.element).toString().toUpperCase() + "";
stats += "Temp:" + formatTemp(currentPixel.temp) + "";
if (currentPixel.charge) {
stats += "C" + currentPixel.charge + "";
@@ -49,7 +49,7 @@ function updateStatsNew() {
}
// If the view is not null, show the view in all caps
if (view != null) {
- stats += "" + viewKey[view].toUpperCase() + "";
+ stats += "" + viewKey[view].toString().toUpperCase() + "";
}
statsDiv.innerHTML = stats;
}
diff --git a/mods/chemFormula.js b/mods/chemFormula.js
new file mode 100644
index 00000000..eaff0b48
--- /dev/null
+++ b/mods/chemFormula.js
@@ -0,0 +1,43 @@
+const styleElement = document.createElement('style');
+styleElement.innerHTML = `
+.tooltip {
+ z-index: 1000;
+ position: relative;
+}
+
+.tooltip .tooltiptext {
+ visibility: hidden;
+ background-color: rgba(0, 0, 0, 0.8);
+ color: #fff;
+ text-align: center;
+ padding: 0.5em;
+ border-radius: 0.5em;
+ position: absolute;
+ z-index: 1000;
+ bottom: 100%;
+ left: 50%;
+ transform: translateX(-50%);
+ pointer-events: none;
+ text-shadow: none;
+}
+
+.tooltip:hover .tooltiptext {
+ visibility: visible;
+}
+`
+
+document.head.appendChild(styleElement);
+
+runAfterLoad(async () => {
+ const data = await fetch('mods/chemFormulas.json').then((res) => res.json());
+ for (const element in data) {
+ if (elements[element]) {
+ elements[element].hoverStat = () => data[element].length > 1 ? "Multiple compounds" : data[element][0].replace(/\<\/?su[bp]\>/g, "");
+ document.querySelector(`button[element='${element}']`)?.classList.add('tooltip');
+ const span = document.createElement('span');
+ span.classList.add('tooltiptext');
+ span.innerHTML = data[element].join("
");
+ document.querySelector(`button[element='${element}']`)?.appendChild(span);
+ }
+ }
+});
\ No newline at end of file
diff --git a/mods/chemFormulas.json b/mods/chemFormulas.json
new file mode 100644
index 00000000..74aab89c
--- /dev/null
+++ b/mods/chemFormulas.json
@@ -0,0 +1,241 @@
+{
+ "sand": ["SiO2"],
+ "dirt": ["Organic matter"],
+ "mud": ["H2O", "Organic matter"],
+ "wet_sand": ["SiO2", "H2O"],
+ "rock": ["SiO2"],
+ "rock_wall": ["SiO2"],
+ "mudstone": ["SiO2", "H2O", "Organic matter"],
+ "packed_sand": ["SiO2"],
+ "snow": ["H2O"],
+ "packed_snow": ["H2O"],
+ "gravel": ["SiO2"],
+ "clay": ["Al2Si2O5(OH)4", "H2O"],
+ "clay_soil": ["Al2Si2O5(OH)4", "H2O", "Organic matter"],
+ "permafrost": ["Organic matter", "SiO2", "H2O"],
+ "mycelium": ["Organic matter"],
+ "mulch": ["Organic matter"],
+ "basalt": ["SiO2", "FeO", "CaO"],
+ "tuff": ["SiO2", "Al2O3", "CaO", "K2O"],
+ "limestone": ["CaCO3"],
+ "quicklime": ["CaO"],
+ "slaked_lime": ["Ca(OH)2"],
+ "water": ["H2O"],
+ "salt_water": ["H2O", "NaCl"],
+ "sugar_water": ["H2O", "C12H22O11"],
+ "seltzer": ["H2O", "CO2"],
+ "dirty_water": ["H2O", "Impurities"],
+ "pool_water": ["H2O", "Cl2"],
+ "slush": ["H2O"],
+ "magma": ["SiO2", "FeO", "CaO"],
+ "slime": ["H2O", "Organic matter"],
+ "cement": ["CaO", "SiO2", "Al2O3"],
+ "oil": ["C5H12", "C6H14", "C7H16", "C8H18", "C9H20", "C10H22", "C11H24", "C12H26"],
+ "lamp_oil": ["C12H26", "C13H28", "C14H30", "C15H32", "C16H34"],
+ "acid": ["HCl"],
+ "neutral_acid": ["H2O", "HCl"],
+ "glue": ["C4H6O2"],
+ "soda": ["H2O", "C6H12O6", "CO2"],
+ "melted_wax": ["C25H52"],
+ "vinegar": ["H2O", "C2H4O2"],
+ "alcohol": ["C2H5OH"],
+ "soap": ["C17H35COONa"],
+ "bleach": ["NaClO"],
+ "mercury": ["Hg"],
+ "tea": ["H2O", "C8H10N4O2"],
+ "coffee": ["H2O", "C8H10N4O2"],
+ "honey": ["C12H22O11"],
+ "sap": ["C12H22O11"],
+ "caramel": ["C12H22O11"],
+ "molasses": ["C12H22O11"],
+ "liquid_oxygen": ["O2"],
+ "liquid_nitrogen": ["N2"],
+ "cyanide": ["CN"],
+ "concrete": ["CaO", "SiO2", "Al2O3"],
+ "ash": ["SiO2", "CaO", "K2O"],
+ "charcoal": ["C"],
+ "hail": ["H2O"],
+ "wax": ["C25H52"],
+ "sodium": ["Na"],
+ "calcium": ["Ca"],
+ "potassium": ["K"],
+ "magnesium": ["Mg"],
+ "thermite": ["Al", "Fe2O3"],
+ "slag": ["CaSiO3"],
+ "amalgam": ["Hg", "Ag"],
+ "sulfur": ["S"],
+ "copper_sulfate": ["CuSO4"],
+ "uranium": ["U"],
+ "diamond": ["C"],
+ "gold coin": ["Au"],
+ "rust": ["Fe2O3"],
+ "oxidized_copper": ["CuO"],
+ "alga": ["AlGa"],
+ "glass_shard": ["SiO2"],
+ "rad_shard": ["SiO2", "U"],
+ "color_sand": ["SiO2", "Fe2O3"],
+ "borax": ["Na2B4O7"],
+ "epsom_salt": ["MgSO4"],
+ "potassium_salt": ["KCl"],
+ "caustic_potash": ["KOH"],
+ "sodium_acetate": ["NaC2H3O2"],
+ "ice": ["H2O"],
+ "rime": ["H2O"],
+ "glass": ["SiO2"],
+ "rad_glass": ["SiO2", "U"],
+ "stained_glass": ["SiO2", "Metal oxides"],
+ "plastic": ["(C8H8)n", "(C4H6)n", "(C3H3N)n"],
+ "iron": ["Fe"],
+ "copper": ["Cu"],
+ "gold": ["Au"],
+ "steel": ["Fe", "C"],
+ "galvanized_steel": ["Fe", "Zn"],
+ "zinc": ["Zn"],
+ "silver": ["Ag"],
+ "tin": ["Sn"],
+ "lead": ["Pb"],
+ "nickel": ["Ni"],
+ "aluminum": ["Al"],
+ "tungsten": ["W"],
+ "brass": ["Cu", "Zn"],
+ "bronze": ["Cu", "Sn"],
+ "sterling": ["Ag", "Cu"],
+ "gallium": ["Ga"],
+ "rose_gold": ["Au", "Cu"],
+ "purple_gold": ["Au", "Al"],
+ "blue_gold": ["Au", "Ga"],
+ "electrum": ["Au", "Ag"],
+ "pyrite": ["FeS2"],
+ "solder": ["Sn", "Pb"],
+ "dry ice": ["CO2"],
+ "nitrogen_ice": ["N2"],
+ "light": ["γ"],
+ "liquid_light": ["γ"],
+ "laser": ["γ"],
+ "radiation": ["α", "β", "γ"],
+ "neutron": ["n"],
+ "proton": ["p"],
+ "electric": ["e-"],
+ "lightning": ["e-"],
+ "positron": ["e+"],
+ "flash": ["γ"],
+ "tnt": ["C7H5N3O6"],
+ "c4": ["C3H6N6O6"],
+ "dynamite": ["C3H5N3O9"],
+ "gunpowder": ["KNO3", "S", "C"],
+ "nitro": ["C3H5N3O9"],
+ "steam": ["H2O"],
+ "hydrogen": ["H2"],
+ "oxygen": ["O2"],
+ "nitrogen": ["N2"],
+ "helium": ["He"],
+ "anesthesia": ["N2O"],
+ "carbon_dioxide": ["CO2"],
+ "bubble": ["CO2"],
+ "ammonia": ["NH3"],
+ "propane": ["C3H8"],
+ "methane": ["CH4"],
+ "acid_gas": ["HCl"],
+ "dioxin": ["C4H4O2"],
+ "chlorine": ["Cl2"],
+ "neon": ["Ne"],
+ "smog": ["CO2", "CO", "NO2", "O3"],
+ "cyanide_gas": ["HCN"],
+ "ozone": ["O3"],
+ "rad_steam": ["H2O", "U"],
+ "salt": ["NaCl"],
+ "sugar": ["C12H22O11"],
+ "chocolate": ["C12H22O11", "C7H8N4O2", "C8H10N4O2", "C18H36O2", "C16H32O2"],
+ "baking_soda": ["NaHCO3"],
+ "antipowder": ["Ry2O3"],
+ "antimolten": ["Ry2O3"],
+ "antiice": ["Ry7O12"],
+ "antifluid": ["Ry7O12"],
+ "antigas": ["Ry7O12"],
+ "molten_glass": ["SiO2"],
+ "molten_rad_glass": ["SiO2", "U"],
+ "molten_salt": ["NaCl"],
+ "molten_ash": ["SiO2", "CaO", "K2O"],
+ "liquid_ammonia": ["NH3"],
+ "liquid_propane": ["C3H8"],
+ "liquid_methane": ["CH4"],
+ "molten_stained_glass": ["SiO2", "Metal oxides"],
+ "molten_plastic": ["(C8H8)n", "(C4H6)n", "(C3H3N)n"],
+ "molten_tungsten": ["W"],
+ "molten_gallium": ["Ga"],
+ "gallium_gas": ["Ga"],
+ "molten_copper": ["Cu"],
+ "molten_copper_sulfate": ["CuSO4"],
+ "molten_gold": ["Au"],
+ "molten_silver": ["Ag"],
+ "molten_iron": ["Fe"],
+ "molten_nickel": ["Ni"],
+ "molten_tin": ["Sn"],
+ "molent_lead": ["Pb"],
+ "molten_solder": ["Sn", "Pb"],
+ "alcohol_gas": ["C2H5OH"],
+ "molten_tuff": ["SiO2", "Al2O3", "CaO", "K2O"],
+ "liquid_chlorine": ["Cl2"],
+ "mercury_gas": ["Hg"],
+ "solid_mercury": ["Hg"],
+ "fat": ["C55H98O6"],
+ "molten_chocolate": ["C12H22O11", "C7H8N4O2", "C8H10N4O2", "C18H36O2", "C16H32O2"],
+ "liquid_hydrogen": ["H2"],
+ "liquid_helium": ["He"],
+ "molten_sodium": ["Na"],
+ "sodium_gas": ["Na"],
+ "molten_calcium": ["Ca"],
+ "molten_potassium": ["K"],
+ "potassium_gas": ["K"],
+ "molten_magnesium": ["Mg"],
+ "molten_thermite": ["Al", "Fe2O3"],
+ "molten_aluminum": ["Al"],
+ "molten_zinc": ["Zn"],
+ "liquid_neon": ["Ne"],
+ "liquid_ozone": ["O3"],
+ "molten_sulfur": ["S"],
+ "sulfur_gas": ["S"],
+ "molten_uranium": ["U"],
+ "molten_slag": ["CaSiO3"],
+ "molten_dirt": ["Organic matter"],
+ "salt_ice": ["NaCl", "H2O"],
+ "sugar_ice": ["C12H22O11", "H2O"],
+ "seltzer_ice": ["H2O", "CO2"],
+ "dirty_ice": ["H2O", "Impurities"],
+ "pool_ice": ["H2O", "Cl2"],
+ "antiice_ice": ["Ry2O"],
+ "ammonia_ice": ["NH3"],
+ "propane_ice": ["C3H8"],
+ "methane_ice": ["CH4"],
+ "acid_ice": ["HCl"],
+ "soda_ice": ["H2O", "C6H12O6", "CO2"],
+ "molten_steel": ["Fe", "C"],
+ "molten_galvanized_steel": ["Fe", "Zn"],
+ "molten_brass": ["Cu", "Zn"],
+ "molten_bronze": ["Cu", "Sn"],
+ "molten_sterling": ["Ag", "Cu"],
+ "molten_rose_gold": ["Au", "Cu"],
+ "molten_purple_gold": ["Au", "Al"],
+ "molten_blue_gold": ["Au", "Ga"],
+ "molten_electrum": ["Au", "Ag"],
+ "molten_pyrite": ["FeS2"],
+ "frozen_vinegar": ["H2O", "C2H4O2"],
+ "alcohol_ice": ["C2H5OH"],
+ "bleach_ice": ["NaClO"],
+ "chlorine_ice": ["Cl2"],
+ "tea_ice": ["H2O", "C8H10N4O2"],
+ "coffee_ice": ["H2O", "C8H10N4O2"],
+ "hydrogen_ice": ["H2"],
+ "oxygen_ice": ["O2"],
+ "molten_amalgam": ["Hg", "Ag"],
+ "neon_ice": ["Ne"],
+ "cyanide_ice": ["CN"],
+ "slime_ice": ["H2O", "Organic matter"],
+ "molten_alga": ["AlGa"],
+ "molten_borax": ["Na2B4O7"],
+ "molten_epsom_salt": ["MgSO4"],
+ "molten_potassium_salt": ["KCl"],
+ "molten_caustic_potash": ["KOH"],
+ "molten_sodium_acetate": ["NaC2H3O2"],
+ "frozen_nitro": ["C3H5N3O9"]
+}
diff --git a/mods/noblegas.js b/mods/noblegas.js
index bb16d9e9..ff9aadfd 100644
--- a/mods/noblegas.js
+++ b/mods/noblegas.js
@@ -106,7 +106,7 @@ elements.frozen_xenon = {
elements.radon = {
color: elements.neon.color,
behavior: behaviors.GAS,
- colorOn: ["#d33d7c","#f73273","#c03190"],
+ colorOn: ["#3dd3cb","#32f7e7","#31c0a8"],
category: "gases",
state: "gas",
conduct: 0.8,
@@ -156,7 +156,7 @@ elements.radon = {
elements.liquid_radon = {
color: elements.neon.color,
behavior: behaviors.LIQUID,
- colorOn: ["#d33d7c","#f73273","#c03190"],
+ colorOn: ["#3dd3cb","#32f7e7","#31c0a8"],
category: "states",
state: "liquid",
tempHigh: -58,
@@ -170,7 +170,7 @@ elements.liquid_radon = {
elements.frozen_radon = {
color: elements.neon.color,
behavior: behaviors.WALL,
- colorOn: ["#d33d7c","#f73273","#c03190"],
+ colorOn: ["#3dd3cb","#32f7e7","#31c0a8"],
category: "states",
state: "solid",
tempHigh: -68,
@@ -182,7 +182,7 @@ elements.frozen_radon = {
elements.oganesson = {
color: elements.neon.color,
behavior: behaviors.GAS,
- colorOn: ["#5bdce6","#56a9f7","#56b0e4"],
+ colorOn: ["#b5e65b","#b9f756","#aee456"],
category: "gases",
state: "gas",
conduct: 0.8,
diff --git a/mods/scenexe.js b/mods/scenexe.js
index 54a2e842..cbcf157a 100644
--- a/mods/scenexe.js
+++ b/mods/scenexe.js
@@ -1,3 +1,11 @@
+/*
+ ____ _
+ | _ \ __ _| |_ __ _
+ | | | |/ _` | __/ _` |
+ | |_| | (_| | || (_| |
+ |____/ \__,_|\__\__,_|
+
+*/
polygonColors = function(sides){
let baseColors = [
/*
@@ -33,6 +41,68 @@ polygonColors = function(sides){
return "rgb(0, 0, 0)"
}
}
+const usefulMiscColors = {
+ playerBlue: "rgb(0, 176, 225)",
+ barrelGray: "rgb(153, 153, 153)",
+ playerGreen: "rgb(0, 224, 108)",
+ playerRed: "rgb(240, 79, 84)",
+ playerPurple: "rgb(216, 43, 207)",
+ bodyGray: "rgb(95, 103, 108)",
+ fallenGray: "rgb(192, 192, 192)",
+ celestialPink: "rgb(237, 110, 222)"
+}
+const upgrades = {
+ weapons: {
+ annihilator: [
+ {
+ theta: 0,
+ damage: 150,
+ reload: 1,
+ angle: 0,
+ spread: 0,
+ yoffset: 0,
+ xoffset: 0,
+ length: 1.9,
+ width: 1,
+ type: 0,
+ bulletHealth: 60
+ }
+ ],
+ twin: [
+ {
+ theta: 0,
+ damage: 150,
+ reload: 1,
+ angle: 0,
+ spread: 0,
+ yoffset: 0,
+ xoffset: 0.5,
+ length: 1.8,
+ width: 0.45,
+ type: 0,
+ bulletHealth: 60
+ },
+ {
+ theta: 0,
+ damage: 150,
+ reload: 1,
+ angle: 0,
+ spread: 0,
+ yoffset: 0,
+ xoffset: -0.5,
+ length: 1.8,
+ width: 0.45,
+ type: 0,
+ bulletHealth: 60
+ }
+ ]
+ },
+ bodies: {
+
+ }
+}
+polygonList = []
+zoomLevel = 0.5
isKeyDown = {
w: false,
a: false,
@@ -41,6 +111,66 @@ isKeyDown = {
i: false,
o: false
}
+let mouseX = 0;
+let mouseY = 0;
+camera = [0, 0]
+scenexeplayer = {
+ x: 0,
+ y: 0,
+ facing: 0,
+ vx: 0,
+ vy: 0,
+ level: 1,
+ rotation: 0,
+ radius: 40,
+ collisionMass: 520,
+ type: 1,
+ bodyDamage: 5,
+ maxHealth: 10000,
+ health: 10000,
+ regenDelay: 14,
+ regenSpeed: 0.0001,
+ timeSinceHurt: null,
+ color: usefulMiscColors.playerBlue,
+ barrels: [
+ {
+ theta: 0,
+ damage: 150,
+ reload: 1,
+ angle: 0,
+ spread: 0,
+ yoffset: 0,
+ xoffset: 0.5,
+ length: 1.8,
+ width: 0.45,
+ type: 0,
+ bulletHealth: 60
+ },
+ {
+ theta: 0,
+ damage: 150,
+ reload: 1,
+ angle: 0,
+ spread: 0,
+ yoffset: 0,
+ xoffset: -0.5,
+ length: 1.8,
+ width: 0.45,
+ type: 0,
+ bulletHealth: 60
+ }
+ ]
+}
+bullets = []
+debug = false
+/*
+ _____ _ _
+ | ___| _ _ __ ___| |_(_) ___ _ __ ___
+ | |_ | | | | '_ \ / __| __| |/ _ \| '_ \/ __|
+ | _|| |_| | | | | (__| |_| | (_) | | | \__ \
+ |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
+
+*/
function HSVtoRGB(h, s, v) {
var r, g, b, i, f, p, q, t;
if (arguments.length === 1) {
@@ -112,6 +242,13 @@ function makeVisible(color){
colorObject.b = Math.max(40, colorObject.b)
return objectToColor(colorObject)
}
+function darkenPercent(color, percent){
+ let colorObject = colorToObject(color)
+ colorObject.r = Math.floor(colorObject.r * percent)
+ colorObject.g = Math.floor(colorObject.g * percent)
+ colorObject.b = Math.floor(colorObject.b * percent)
+ return objectToColor(colorObject)
+}
// when wasd keydown, set isKeyDown to true
document.addEventListener("keydown", (event) => {
if (event.key === "w") {
@@ -161,6 +298,18 @@ document.addEventListener("keyup", (event) => {
}
}
})
+document.addEventListener("mousemove", (event) => {
+ let rect = canvas.getBoundingClientRect();
+ mouseX = event.clientX - rect.left;
+ mouseY = event.clientY - rect.top;
+});
+let mouseDown = false;
+document.addEventListener("mousedown", (event) => {
+ mouseDown = true;
+});
+document.addEventListener("mouseup", (event) => {
+ mouseDown = false;
+});
orbitalSpeed = function(sides){
return 1/(1.00672*Math.pow(0.344151, sides) + 0.000002)
}
@@ -210,8 +359,6 @@ function polygonCount(random){
}
}
}
-polygonList = []
-zoomLevel = 0.5
function newPolygon(sides){
polygonList.push({
sides: sides,
@@ -236,12 +383,8 @@ function newPolygon(sides){
polygonSize = function(sides){
return 18 * Math.pow(1.47, sides - 3)
}
-for (var i = 0; i <= 400; i++){
- sides = polygonCount(Math.random())
- newPolygon(sides)
-}
function drawPolygon(ctx, polygon, index){
- if (Math.abs(polygonList[index].x-camera[0]-polygon.radius