From 0e9d2bcc30154ed0ad15a722c9612c8f353284f0 Mon Sep 17 00:00:00 2001 From: landgreen Date: Sat, 26 Dec 2020 08:16:22 -0800 Subject: [PATCH] console style updated in game console style and all messages to match real game commands new names inline with lore, mod -> tech, game -> simulation this is probably going to cause many minor bugs, so let me know what you find new reroll display in power up selection tech: rocket-propelled now works with all grenade tech --- index.html | 8 +- js/bullet.js | 699 +++++++++------- js/engine.js | 44 +- js/index.js | 366 ++++----- js/level.js | 292 +++---- js/mob.js | 130 +-- js/player.js | 388 ++++----- js/powerup.js | 377 ++++----- js/{game.js => simulation.js} | 523 ++++++------ js/spawn.js | 230 +++--- js/{mods.js => tech.js} | 1437 +++++++++++++++++---------------- style.css | 92 ++- todo.txt | 105 ++- 13 files changed, 2436 insertions(+), 2255 deletions(-) rename js/{game.js => simulation.js} (65%) rename js/{mods.js => tech.js} (72%) diff --git a/index.html b/index.html index 98b08ff..e1ddda8 100644 --- a/index.html +++ b/index.html @@ -33,7 +33,7 @@
-
+
@@ -327,7 +327,7 @@ animation: dash 5s ease-in forwards; } - + // SVGleftMouse: ' ', - SVGrightMouse: ' ', - makeTextLog(text, time = 180) { - if (game.replaceTextLog) { - document.getElementById("text-log").innerHTML = text; - document.getElementById("text-log").style.opacity = 1; - game.lastLogTime = mech.cycle + time; + // SVGrightMouse: ' ', + makeTextLog(text, time = 120) { + if (simulation.isTextLogOpen && !build.isCustomSelection) { + if (simulation.lastLogTime > mech.cycle) { //if there is an older message + document.getElementById("text-log").innerHTML = document.getElementById("text-log").innerHTML + '
' + text; + simulation.lastLogTime = mech.cycle + time; + } else { + document.getElementById("text-log").innerHTML = text; + document.getElementById("text-log").style.opacity = 1; + simulation.lastLogTime = mech.cycle + time; + } } }, textLog() { - if (game.lastLogTime && game.lastLogTime < mech.cycle) { - game.lastLogTime = 0; - game.replaceTextLog = true + if (simulation.lastLogTime && simulation.lastLogTime < mech.cycle) { + simulation.lastLogTime = 0; // document.getElementById("text-log").innerHTML = " "; document.getElementById("text-log").style.opacity = 0; } }, nextGun() { - if (b.inventory.length > 0 && !mod.isGunCycle) { + if (b.inventory.length > 0 && !tech.isGunCycle) { b.inventoryGun++; if (b.inventoryGun > b.inventory.length - 1) b.inventoryGun = 0; - game.switchGun(); + simulation.switchGun(); } }, previousGun() { - if (b.inventory.length > 0 && !mod.isGunCycle) { + if (b.inventory.length > 0 && !tech.isGunCycle) { b.inventoryGun--; if (b.inventoryGun < 0) b.inventoryGun = b.inventory.length - 1; - game.switchGun(); + simulation.switchGun(); } }, switchGun() { - if (mod.isCrouchAmmo) mod.isCrouchAmmo = 1 //this prevents hacking the mod by switching guns + if (tech.isCrouchAmmo) tech.isCrouchAmmo = 1 //this prevents hacking the tech by switching guns b.activeGun = b.inventory[b.inventoryGun]; - game.updateGunHUD(); - game.boldActiveGunHUD(); + simulation.updateGunHUD(); + simulation.boldActiveGunHUD(); // mech.drop(); }, zoom: null, zoomScale: 1000, isAutoZoom: true, - setZoom(zoomScale = game.zoomScale) { //use in window resize in index.js - game.zoomScale = zoomScale - game.zoom = canvas.height / zoomScale; //sets starting zoom scale + setZoom(zoomScale = simulation.zoomScale) { //use in window resize in index.js + simulation.zoomScale = zoomScale + simulation.zoom = canvas.height / zoomScale; //sets starting zoom scale }, zoomTransition(newZoomScale, step = 2) { - if (game.isAutoZoom) { - const isBigger = (newZoomScale - game.zoomScale > 0) ? true : false; + if (simulation.isAutoZoom) { + const isBigger = (newZoomScale - simulation.zoomScale > 0) ? true : false; requestAnimationFrame(zLoop); const currentLevel = level.onLevel function zLoop() { - if (currentLevel !== level.onLevel || game.isAutoZoom === false) return //stop the zoom if player goes to a new level + if (currentLevel !== level.onLevel || simulation.isAutoZoom === false) return //stop the zoom if player goes to a new level if (isBigger) { - game.zoomScale += step - if (game.zoomScale >= newZoomScale) { - game.setZoom(newZoomScale); + simulation.zoomScale += step + if (simulation.zoomScale >= newZoomScale) { + simulation.setZoom(newZoomScale); return } } else { - game.zoomScale -= step - if (game.zoomScale <= newZoomScale) { - game.setZoom(newZoomScale); + simulation.zoomScale -= step + if (simulation.zoomScale <= newZoomScale) { + simulation.setZoom(newZoomScale); return } } - game.setZoom(); + simulation.setZoom(); requestAnimationFrame(zLoop); } } }, zoomInFactor: 0, startZoomIn(time = 180) { - game.zoom = 0; + simulation.zoom = 0; let count = 0; requestAnimationFrame(zLoop); function zLoop() { - game.zoom += canvas.height / game.zoomScale / time; + simulation.zoom += canvas.height / simulation.zoomScale / time; count++; if (count < time) { requestAnimationFrame(zLoop); } else { - game.setZoom(); + simulation.setZoom(); } } }, @@ -421,27 +425,27 @@ const game = { mech.pos.x = player.position.x; mech.pos.y = playerBody.position.y - mech.yOff; const scale = 0.8; - mech.transSmoothX = canvas.width2 - mech.pos.x - (game.mouse.x - canvas.width2) * scale; - mech.transSmoothY = canvas.height2 - mech.pos.y - (game.mouse.y - canvas.height2) * scale; + mech.transSmoothX = canvas.width2 - mech.pos.x - (simulation.mouse.x - canvas.width2) * scale; + mech.transSmoothY = canvas.height2 - mech.pos.y - (simulation.mouse.y - canvas.height2) * scale; mech.transX += (mech.transSmoothX - mech.transX) * 1; mech.transY += (mech.transSmoothY - mech.transY) * 1; }, edgeZoomOutSmooth: 1, camera() { //zoom out when mouse gets near the edge of the window - const dx = game.mouse.x / window.innerWidth - 0.5 //x distance from mouse to window center scaled by window width - const dy = game.mouse.y / window.innerHeight - 0.5 //y distance from mouse to window center scaled by window height + const dx = simulation.mouse.x / window.innerWidth - 0.5 //x distance from mouse to window center scaled by window width + const dy = simulation.mouse.y / window.innerHeight - 0.5 //y distance from mouse to window center scaled by window height const d = Math.max(dx * dx, dy * dy) - game.edgeZoomOutSmooth = (1 + 4 * d * d) * 0.04 + game.edgeZoomOutSmooth * 0.96 + simulation.edgeZoomOutSmooth = (1 + 4 * d * d) * 0.04 + simulation.edgeZoomOutSmooth * 0.96 ctx.save(); ctx.translate(canvas.width2, canvas.height2); //center - ctx.scale(game.zoom / game.edgeZoomOutSmooth, game.zoom / game.edgeZoomOutSmooth); //zoom in once centered + ctx.scale(simulation.zoom / simulation.edgeZoomOutSmooth, simulation.zoom / simulation.edgeZoomOutSmooth); //zoom in once centered ctx.translate(-canvas.width2 + mech.transX, -canvas.height2 + mech.transY); //translate //calculate in game mouse position by undoing the zoom and translations - game.mouseInGame.x = (game.mouse.x - canvas.width2) / game.zoom * game.edgeZoomOutSmooth + canvas.width2 - mech.transX; - game.mouseInGame.y = (game.mouse.y - canvas.height2) / game.zoom * game.edgeZoomOutSmooth + canvas.height2 - mech.transY; + simulation.mouseInGame.x = (simulation.mouse.x - canvas.width2) / simulation.zoom * simulation.edgeZoomOutSmooth + canvas.width2 - mech.transX; + simulation.mouseInGame.y = (simulation.mouse.y - canvas.height2) / simulation.zoom * simulation.edgeZoomOutSmooth + canvas.height2 - mech.transY; }, restoreCamera() { ctx.restore(); @@ -455,15 +459,15 @@ const game = { bodies[i].force.y += bodies[i].mass * magnitude; } } - addGravity(powerUp, game.g); - addGravity(body, game.g); - player.force.y += player.mass * game.g; + addGravity(powerUp, simulation.g); + addGravity(body, simulation.g); + player.force.y += player.mass * simulation.g; }, firstRun: true, splashReturn() { - game.onTitlePage = true; + simulation.onTitlePage = true; document.getElementById("splash").onclick = function() { - game.startGame(); + simulation.startGame(); }; document.getElementById("choose-grid").style.display = "none" document.getElementById("info").style.display = "inline"; @@ -483,7 +487,7 @@ const game = { document.body.style.cursor = "none"; document.body.style.overflow = "hidden" } - game.onTitlePage = false; + simulation.onTitlePage = false; document.getElementById("choose-grid").style.display = "none" document.getElementById("build-grid").style.display = "none" document.getElementById("info").style.display = "none"; @@ -496,7 +500,7 @@ const game = { mech.spawn(); //spawns the player level.levels = level.playableLevels.slice(0) //copy array, not by just by assignment - if (game.isCommunityMaps) { + if (simulation.isCommunityMaps) { level.levels.push("stronghold"); level.levels.push("basement"); level.levels.push("detours"); @@ -505,14 +509,22 @@ const game = { level.levels = shuffle(level.levels); //shuffles order of maps level.levels.unshift("intro"); //add level to the start of the randomized levels list level.levels.push("gauntlet"); //add level to the end of the randomized levels list - level.levels.push("finalBoss"); //add level to the end of the randomized levels list + level.levels.push("final"); //add level to the end of the randomized levels list input.endKeySensing(); b.removeAllGuns(); - game.isNoPowerUps = false; - mod.setupAllMods(); //sets mods to default values + simulation.isNoPowerUps = false; + + tech.setupAllMods(); //sets tech to default values + tech.laserBotCount = 0; + tech.orbitBotCount = 0; + tech.nailBotCount = 0; + tech.foamBotCount = 0; + tech.boomBotCount = 0; + tech.plasmaBotCount = 0; + b.setFireCD(); - game.updateModHUD(); + simulation.updateModHUD(); powerUps.totalPowerUps = 0; powerUps.reroll.rerolls = 0; mech.setFillColors(); @@ -520,11 +532,11 @@ const game = { mech.maxEnergy = 1 mech.energy = 1 mech.hole.isOn = false - game.paused = false; + simulation.paused = false; engine.timing.timeScale = 1; - game.fpsCap = game.fpsCapDefault; - game.isAutoZoom = true; - game.makeGunHUD(); + simulation.fpsCap = simulation.fpsCapDefault; + simulation.isAutoZoom = true; + simulation.makeGunHUD(); mech.drop(); mech.holdingTarget = null mech.health = 0.25; @@ -534,58 +546,98 @@ const game = { level.levelsCleared = 0; //resetting difficulty - game.dmgScale = 0; //increases in level.difficultyIncrease + simulation.dmgScale = 0; //increases in level.difficultyIncrease b.dmgScale = 1; //decreases in level.difficultyIncrease - game.accelScale = 1; - game.lookFreqScale = 1; - game.CDScale = 1; - game.difficulty = 0; - game.difficultyMode = Number(document.getElementById("difficulty-select").value) + simulation.accelScale = 1; + simulation.lookFreqScale = 1; + simulation.CDScale = 1; + simulation.difficulty = 0; + simulation.difficultyMode = Number(document.getElementById("difficulty-select").value) build.isCustomSelection = false; - game.clearNow = true; + simulation.clearNow = true; document.getElementById("text-log").style.opacity = 0; document.getElementById("fade-out").style.opacity = 0; document.title = "n-gon"; //set to default field mech.fieldMode = 0; - game.replaceTextLog = true; - game.makeTextLog(`${game.SVGrightMouse} ${mech.fieldUpgrades[mech.fieldMode].name}

${mech.fieldUpgrades[mech.fieldMode].description}`, 600); + // simulation.makeTextLog(`${simulation.SVGrightMouse} ${mech.fieldUpgrades[mech.fieldMode].name}

${mech.fieldUpgrades[mech.fieldMode].description}`, 600); + // simulation.makeTextLog(` + // input.key.up = ["${input.key.up}", "ArrowUp"] + //
input.key.left = ["${input.key.left}", "ArrowLeft"] + //
input.key.down = ["${input.key.down}", "ArrowDown"] + //
input.key.right = ["${input.key.right}", "ArrowRight"] + //
+ //
mech.fieldMode = "${mech.fieldUpgrades[mech.fieldMode].name}" + //
input.key.field = ["${input.key.field}", "right mouse"] + //
mech.field.description = "${mech.fieldUpgrades[mech.fieldMode].description}" + // `, 800); + let delay = 500 + const step = 150 + setTimeout(function() { + simulation.makeTextLog(`input.key.up = ["${input.key.up}", "ArrowUp"]`); + }, delay); + delay += step + setTimeout(function() { + simulation.makeTextLog(`input.key.left = ["${input.key.left}", "ArrowLeft"]`); + }, delay); + delay += step + setTimeout(function() { + simulation.makeTextLog(`input.key.down = ["${input.key.down}", "ArrowDown"]`); + }, delay); + delay += step + setTimeout(function() { + simulation.makeTextLog(`input.key.right = ["${input.key.right}", "ArrowRight"]`); + }, delay); + delay += 1000 + setTimeout(function() { + simulation.makeTextLog(`
mech.fieldMode = "${mech.fieldUpgrades[mech.fieldMode].name}"`); + }, delay); + delay += step + setTimeout(function() { + simulation.makeTextLog(`input.key.field = ["${input.key.field}", "MouseRight"]`); + }, delay); + // delay += step + // setTimeout(function() { + // simulation.makeTextLog(`mech.field.description
"${mech.fieldUpgrades[mech.fieldMode].description}"`); + // }, delay); + + mech.setField(mech.fieldMode) //exit testing - if (game.testing) { - game.testing = false; - game.loop = game.normalLoop - if (game.isConstructionMode) { + if (simulation.testing) { + simulation.testing = false; + simulation.loop = simulation.normalLoop + if (simulation.isConstructionMode) { document.getElementById("construct").style.display = 'none' } } - game.isCheating = false - game.firstRun = false; + simulation.isCheating = false + simulation.firstRun = false; //setup FPS cap - game.fpsInterval = 1000 / game.fpsCap; - game.then = Date.now(); + simulation.fpsInterval = 1000 / simulation.fpsCap; + simulation.then = Date.now(); requestAnimationFrame(cycle); //starts game loop }, clearNow: false, clearMap() { - if (mod.isMineAmmoBack) { + if (tech.isMineAmmoBack) { let count = 0; for (i = 0, len = bullet.length; i < len; i++) { //count mines left on map if (bullet[i].bulletType === "mine") count++ } for (i = 0, len = b.guns.length; i < len; i++) { //find which gun is mine if (b.guns[i].name === "mine") { - if (mod.isCrouchAmmo) count = Math.ceil(count / 2) + if (tech.isCrouchAmmo) count = Math.ceil(count / 2) b.guns[i].ammo += count - game.updateGunHUD(); + simulation.updateGunHUD(); break; } } } - if (mod.isMutualism && !mod.isEnergyHealth) { + if (tech.isMutualism && !tech.isEnergyHealth) { for (let i = 0; i < bullet.length; i++) { if (bullet[i].isMutualismActive) { mech.health += 0.005 @@ -595,12 +647,12 @@ const game = { } } - if (mod.isEndLevelPowerUp) { + if (tech.isEndLevelPowerUp) { for (let i = 0; i < powerUp.length; i++) { - if (powerUp[i].name === "mod") { - mod.giveMod() + if (powerUp[i].name === "tech") { + tech.giveMod() } else if (powerUp[i].name === "gun") { - if (!mod.isOneGun) b.giveGuns("random") + if (!tech.isOneGun) b.giveGuns("random") } else if (powerUp[i].name === "field") { if (mech.fieldMode === 0) mech.setField(Math.ceil(Math.random() * (mech.fieldUpgrades.length - 1))) //pick a random field, but not field 0 } else { @@ -620,7 +672,7 @@ const game = { level.fillBG = []; level.zones = []; level.queryList = []; - game.drawList = []; + simulation.drawList = []; function removeAll(array) { for (let i = 0; i < array.length; ++i) Matter.World.remove(engine.world, array[i]); @@ -656,8 +708,8 @@ const game = { mech.holdingTarget.collisionFilter.mask = 0; } //set fps back to default - game.fpsCap = game.fpsCapDefault - game.fpsInterval = 1000 / game.fpsCap; + simulation.fpsCap = simulation.fpsCapDefault + simulation.fpsInterval = 1000 / simulation.fpsCap; }, // getCoords: { // //used when building maps, outputs a draw rect command to console, only works in testing mode @@ -671,20 +723,20 @@ const game = { // }, // out() { // if (keys[49]) { - // game.getCoords.pos1.x = Math.round(game.mouseInGame.x / 25) * 25; - // game.getCoords.pos1.y = Math.round(game.mouseInGame.y / 25) * 25; + // simulation.getCoords.pos1.x = Math.round(simulation.mouseInGame.x / 25) * 25; + // simulation.getCoords.pos1.y = Math.round(simulation.mouseInGame.y / 25) * 25; // } // if (keys[50]) { // //press 1 in the top left; press 2 in the bottom right;copy command from console - // game.getCoords.pos2.x = Math.round(game.mouseInGame.x / 25) * 25; - // game.getCoords.pos2.y = Math.round(game.mouseInGame.y / 25) * 25; + // simulation.getCoords.pos2.x = Math.round(simulation.mouseInGame.x / 25) * 25; + // simulation.getCoords.pos2.y = Math.round(simulation.mouseInGame.y / 25) * 25; // window.getSelection().removeAllRanges(); // var range = document.createRange(); // range.selectNode(document.getElementById("test")); // window.getSelection().addRange(range); // document.execCommand("copy"); // window.getSelection().removeAllRanges(); - // console.log(`spawn.mapRect(${game.getCoords.pos1.x}, ${game.getCoords.pos1.y}, ${game.getCoords.pos2.x - game.getCoords.pos1.x}, ${game.getCoords.pos2.y - game.getCoords.pos1.y}); //`); + // console.log(`spawn.mapRect(${simulation.getCoords.pos1.x}, ${simulation.getCoords.pos1.y}, ${simulation.getCoords.pos2.x - simulation.getCoords.pos1.x}, ${simulation.getCoords.pos2.y - simulation.getCoords.pos1.y}); //`); // } // } // }, @@ -692,9 +744,9 @@ const game = { if (!(mech.cycle % 60)) { //once a second //energy overfill - if (mech.energy > mech.maxEnergy) mech.energy = mech.maxEnergy + (mech.energy - mech.maxEnergy) * mod.overfillDrain //every second energy above max energy loses 25% + if (mech.energy > mech.maxEnergy) mech.energy = mech.maxEnergy + (mech.energy - mech.maxEnergy) * tech.overfillDrain //every second energy above max energy loses 25% - if (mech.pos.y > game.fallHeight) { // if 4000px deep + if (mech.pos.y > simulation.fallHeight) { // if 4000px deep Matter.Body.setVelocity(player, { x: 0, y: 0 @@ -716,31 +768,31 @@ const game = { }); } } - mech.damage(0.1 * game.difficultyMode); - mech.energy -= 0.1 * game.difficultyMode + mech.damage(0.1 * simulation.difficultyMode); + mech.energy -= 0.1 * simulation.difficultyMode } - // if (mod.isEnergyDamage) { - // document.getElementById("mod-capacitor").innerHTML = `(+${(mech.energy/0.05).toFixed(0)}%)` + // if (tech.isEnergyDamage) { + // document.getElementById("tech-capacitor").innerHTML = `(+${(mech.energy/0.05).toFixed(0)}%)` // } - // if (mod.restDamage) { + // if (tech.restDamage) { // if (player.speed < 1) { - // document.getElementById("mod-rest").innerHTML = `(+20%)` + // document.getElementById("tech-rest").innerHTML = `(+20%)` // } else { - // document.getElementById("mod-rest").innerHTML = `(+0%)` + // document.getElementById("tech-rest").innerHTML = `(+0%)` // } // } if (mech.lastKillCycle + 300 > mech.cycle) { //effects active for 5 seconds after killing a mob - if (mod.isEnergyRecovery) mech.energy += mech.maxEnergy * 0.05 - if (mod.isHealthRecovery) mech.addHealth(0.01 * mech.maxHealth) + if (tech.isEnergyRecovery) mech.energy += mech.maxEnergy * 0.05 + if (tech.isHealthRecovery) mech.addHealth(0.01 * mech.maxHealth) } - if (!(game.cycle % 420)) { //once every 7 seconds + if (!(simulation.cycle % 420)) { //once every 7 seconds fallCheck = function(who, save = false) { let i = who.length; while (i--) { - if (who[i].position.y > game.fallHeight) { + if (who[i].position.y > simulation.fallHeight) { if (save) { Matter.Body.setVelocity(who[i], { x: 0, @@ -766,49 +818,30 @@ const game = { //crouch playerHead.position.y - player.position.y = 9.7 //positive //standing playerHead.position.y - player.position.y = -30 //negative // mech.undoCrouch() - if (!mech.crouch && ((playerHead.position.y - player.position.y) > 0)) { - Matter.Body.translate(playerHead, { - x: 0, - y: 40 - }); - // if ((playerHead.position.y - player.position.y) > 0) { - // Matter.Body.translate(playerHead, { - // x: 0, - // y: 40 - // }); - // if ((playerHead.position.y - player.position.y) > 0) { - // Matter.Body.translate(playerHead, { - // x: 0, - // y: 40 - // }); - // if ((playerHead.position.y - player.position.y) > 0) { - // Matter.Body.translate(playerHead, { - // x: 0, - // y: 40 - // }); - // } - // } - // } - } else if (mech.crouch && ((playerHead.position.y - player.position.y) > 10)) { - Matter.Body.translate(playerHead, { - x: 0, - y: 40 - }); - } - // else if (mech.crouch && ((playerHead.position.y - player.position.y) < 0)) {} + // if (!mech.crouch && ((playerHead.position.y - player.position.y) > 0)) { + // Matter.Body.translate(playerHead, { + // x: 0, + // y: 40 + // }); + // } else if (mech.crouch && ((playerHead.position.y - player.position.y) > 10)) { + // Matter.Body.translate(playerHead, { + // x: 0, + // y: 40 + // }); + // } } } }, testingOutput() { ctx.fillStyle = "#000"; - if (!game.isConstructionMode) { + if (!simulation.isConstructionMode) { // ctx.textAlign = "right"; ctx.fillText("T: exit testing mode", canvas.width / 2, canvas.height - 10); // let line = 500; // const x = canvas.width - 5; // ctx.fillText("T: exit testing mode", x, line); // line += 20; - // ctx.fillText("Y: give all mods", x, line); + // ctx.fillText("Y: give all tech", x, line); // line += 20; // ctx.fillText("R: teleport to mouse", x, line); // line += 20; @@ -823,10 +856,10 @@ const game = { // ctx.fillText("1-7: spawn things", x, line); } ctx.textAlign = "center"; - ctx.fillText(`(${game.mouseInGame.x.toFixed(1)}, ${game.mouseInGame.y.toFixed(1)})`, game.mouse.x, game.mouse.y - 20); + ctx.fillText(`(${simulation.mouseInGame.x.toFixed(1)}, ${simulation.mouseInGame.y.toFixed(1)})`, simulation.mouse.x, simulation.mouse.y - 20); }, draw: { - powerUp() { //is set by Bayesian mod + powerUp() { //is set by Bayesian tech // ctx.globalAlpha = 0.4 * Math.sin(mech.cycle * 0.15) + 0.6; // for (let i = 0, len = powerUp.length; i < len; ++i) { // ctx.beginPath(); @@ -899,22 +932,22 @@ const game = { mapPath: null, //holds the path for the map to speed up drawing setPaths() { //runs at each new level to store the path for the map since the map doesn't change - game.draw.mapPath = new Path2D(); + simulation.draw.mapPath = new Path2D(); for (let i = 0, len = map.length; i < len; ++i) { let vertices = map[i].vertices; - game.draw.mapPath.moveTo(vertices[0].x, vertices[0].y); + simulation.draw.mapPath.moveTo(vertices[0].x, vertices[0].y); for (let j = 1; j < vertices.length; j += 1) { - game.draw.mapPath.lineTo(vertices[j].x, vertices[j].y); + simulation.draw.mapPath.lineTo(vertices[j].x, vertices[j].y); } - game.draw.mapPath.lineTo(vertices[0].x, vertices[0].y); + simulation.draw.mapPath.lineTo(vertices[0].x, vertices[0].y); } }, mapFill: "#444", bodyFill: "rgba(140,140,140,0.85)", //"#999", bodyStroke: "#222", drawMapPath() { - ctx.fillStyle = game.draw.mapFill; - ctx.fill(game.draw.mapPath); + ctx.fillStyle = simulation.draw.mapFill; + ctx.fill(simulation.draw.mapPath); }, body() { ctx.beginPath(); @@ -927,9 +960,9 @@ const game = { ctx.lineTo(vertices[0].x, vertices[0].y); } ctx.lineWidth = 2; - ctx.fillStyle = game.draw.bodyFill; + ctx.fillStyle = simulation.draw.bodyFill; ctx.fill(); - ctx.strokeStyle = game.draw.bodyStroke; + ctx.strokeStyle = simulation.draw.bodyStroke; ctx.stroke(); }, cons() { @@ -1098,14 +1131,14 @@ const game = { }, constructMapString: [], constructCycle() { - if (game.isConstructionMode && game.constructMouseDownPosition) { + if (simulation.isConstructionMode && simulation.constructMouseDownPosition) { function round(num, round = 25) { return Math.ceil(num / round) * round; } - const x = round(game.constructMouseDownPosition.x) - const y = round(game.constructMouseDownPosition.y) - const dx = Math.max(25, round(game.mouseInGame.x) - x) - const dy = Math.max(25, round(game.mouseInGame.y) - y) + const x = round(simulation.constructMouseDownPosition.x) + const y = round(simulation.constructMouseDownPosition.y) + const dx = Math.max(25, round(simulation.mouseInGame.x) - x) + const dy = Math.max(25, round(simulation.mouseInGame.y) - y) ctx.strokeStyle = "#000" ctx.lineWidth = 2; @@ -1113,39 +1146,39 @@ const game = { } }, outputMapString(string) { - if (string) game.constructMapString.push(string) //store command as a string in the next element of an array + if (string) simulation.constructMapString.push(string) //store command as a string in the next element of an array let out = "" //combine set of map strings to one string let outHTML = "" - for (let i = 0, len = game.constructMapString.length; i < len; i++) { - out += game.constructMapString[i]; - outHTML += "
" + game.constructMapString[i] + "
" + for (let i = 0, len = simulation.constructMapString.length; i < len; i++) { + out += simulation.constructMapString[i]; + outHTML += "
" + simulation.constructMapString[i] + "
" } console.log(out) - game.copyToClipBoard(out) + simulation.copyToClipBoard(out) document.getElementById("construct").innerHTML = outHTML }, enableConstructMode() { - game.isConstructionMode = true; - game.isAutoZoom = false; - game.zoomScale = 2600; - game.setZoom(); + simulation.isConstructionMode = true; + simulation.isAutoZoom = false; + simulation.zoomScale = 2600; + simulation.setZoom(); document.body.addEventListener("mouseup", (e) => { - if (game.testing && game.constructMouseDownPosition) { + if (simulation.testing && simulation.constructMouseDownPosition) { function round(num, round = 25) { return Math.ceil(num / round) * round; } //clean up positions - const x = round(game.constructMouseDownPosition.x) - const y = round(game.constructMouseDownPosition.y) - const dx = Math.max(25, round(game.mouseInGame.x) - x) - const dy = Math.max(25, round(game.mouseInGame.y) - y) + const x = round(simulation.constructMouseDownPosition.x) + const y = round(simulation.constructMouseDownPosition.y) + const dx = Math.max(25, round(simulation.mouseInGame.x) - x) + const dy = Math.max(25, round(simulation.mouseInGame.y) - y) if (e.which === 2) { - game.outputMapString(`spawn.randomMob(${x}, ${y},0.5);`); - } else if (game.mouseInGame.x > game.constructMouseDownPosition.x && game.mouseInGame.y > game.constructMouseDownPosition.y) { //make sure that the width and height are positive + simulation.outputMapString(`spawn.randomMob(${x}, ${y},0.5);`); + } else if (simulation.mouseInGame.x > simulation.constructMouseDownPosition.x && simulation.mouseInGame.y > simulation.constructMouseDownPosition.y) { //make sure that the width and height are positive if (e.which === 1) { //add map - game.outputMapString(`spawn.mapRect(${x}, ${y}, ${dx}, ${dy});`); + simulation.outputMapString(`spawn.mapRect(${x}, ${y}, ${dx}, ${dy});`); //see map in world spawn.mapRect(x, y, dx, dy); @@ -1155,9 +1188,9 @@ const game = { Matter.Body.setStatic(map[len], true); //make static World.add(engine.world, map[len]); //add to world - game.draw.setPaths() //update map graphics + simulation.draw.setPaths() //update map graphics } else if (e.which === 3) { //add body - game.outputMapString(`spawn.bodyRect(${x}, ${y}, ${dx}, ${dy});`); + simulation.outputMapString(`spawn.bodyRect(${x}, ${y}, ${dx}, ${dy});`); //see map in world spawn.bodyRect(x, y, dx, dy); @@ -1169,32 +1202,32 @@ const game = { } } } - game.constructMouseDownPosition.x = undefined - game.constructMouseDownPosition.y = undefined + simulation.constructMouseDownPosition.x = undefined + simulation.constructMouseDownPosition.y = undefined }); - game.constructMouseDownPosition.x = undefined - game.constructMouseDownPosition.y = undefined + simulation.constructMouseDownPosition.x = undefined + simulation.constructMouseDownPosition.y = undefined document.body.addEventListener("mousedown", (e) => { - if (game.testing) { - game.constructMouseDownPosition.x = game.mouseInGame.x - game.constructMouseDownPosition.y = game.mouseInGame.y + if (simulation.testing) { + simulation.constructMouseDownPosition.x = simulation.mouseInGame.x + simulation.constructMouseDownPosition.y = simulation.mouseInGame.y } }); document.body.addEventListener("keydown", (e) => { // e.keyCode z=90 m=77 b=66 shift = 16 c = 67 - if (game.testing && e.keyCode === 90 && game.constructMapString.length) { - if (game.constructMapString[game.constructMapString.length - 1][6] === 'm') { //remove map from current level + if (simulation.testing && e.keyCode === 90 && simulation.constructMapString.length) { + if (simulation.constructMapString[simulation.constructMapString.length - 1][6] === 'm') { //remove map from current level const index = map.length - 1 Matter.World.remove(engine.world, map[index]); map.splice(index, 1); - game.draw.setPaths() //update map graphics - } else if (game.constructMapString[game.constructMapString.length - 1][6] === 'b') { //remove body from current level + simulation.draw.setPaths() //update map graphics + } else if (simulation.constructMapString[simulation.constructMapString.length - 1][6] === 'b') { //remove body from current level const index = body.length - 1 Matter.World.remove(engine.world, body[index]); body.splice(index, 1); } - game.constructMapString.pop(); - game.outputMapString(); + simulation.constructMapString.pop(); + simulation.outputMapString(); } }); } diff --git a/js/spawn.js b/js/spawn.js index 349fe10..a6f3c32 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -28,7 +28,7 @@ const spawn = { spawn.pickList.push(spawn.fullPickList[Math.floor(Math.random() * spawn.fullPickList.length)]); }, spawnChance(chance) { - return Math.random() < chance + 0.07 * game.difficulty && mob.length < -1 + 16 * Math.log10(game.difficulty + 1) + return Math.random() < chance + 0.07 * simulation.difficulty && mob.length < -1 + 16 * Math.log10(simulation.difficulty + 1) }, randomMob(x, y, chance = 1) { if (spawn.spawnChance(chance) || chance === Infinity) { @@ -37,7 +37,7 @@ const spawn = { } }, randomSmallMob(x, y, - num = Math.max(Math.min(Math.round(Math.random() * game.difficulty * 0.2), 4), 0), + num = Math.max(Math.min(Math.round(Math.random() * simulation.difficulty * 0.2), 4), 0), size = 16 + Math.ceil(Math.random() * 15), chance = 1) { if (spawn.spawnChance(chance)) { @@ -48,7 +48,7 @@ const spawn = { } }, randomBoss(x, y, chance = 1) { - if (spawn.spawnChance(chance) && game.difficulty > 2 || chance == Infinity) { + if (spawn.spawnChance(chance) && simulation.difficulty > 2 || chance == Infinity) { //choose from the possible picklist let pick = this.pickList[Math.floor(Math.random() * this.pickList.length)]; //is the pick able to be a boss? @@ -102,7 +102,7 @@ const spawn = { level.exit.x = 5500; level.exit.y = -330; //ramp up damage - for (let i = 0; i < 4; i++) level.difficultyIncrease(game.difficultyMode) + for (let i = 0; i < 4; i++) level.difficultyIncrease(simulation.difficultyMode) //pull in particles @@ -121,7 +121,7 @@ const spawn = { //draw stuff for (let i = 0, len = 22; i < len; i++) { - game.drawList.push({ //add dmg to draw queue + simulation.drawList.push({ //add dmg to draw queue x: this.position.x, y: this.position.y, radius: (i + 1) * 150, @@ -219,9 +219,9 @@ const spawn = { }); } - if (game.difficulty > 60) { + if (simulation.difficulty > 60) { spawn.randomLevelBoss(3000, -1100) - if (game.difficulty > 100) { + if (simulation.difficulty > 100) { spawn.randomLevelBoss(3000, -1300) } } @@ -231,7 +231,7 @@ const spawn = { me.eventHorizonCycleRate = 4 * Math.PI / me.endCycle me.modeSuck = function() { //eventHorizon waves in and out - const eventHorizon = this.eventHorizon * (1 - 0.25 * Math.cos(game.cycle * this.eventHorizonCycleRate)) //0.014 + const eventHorizon = this.eventHorizon * (1 - 0.25 * Math.cos(simulation.cycle * this.eventHorizonCycleRate)) //0.014 //draw darkness ctx.beginPath(); ctx.arc(this.position.x, this.position.y, eventHorizon * 0.2, 0, 2 * Math.PI); @@ -257,7 +257,7 @@ const spawn = { if (Vector.magnitude(Vector.sub(this.position, player.position)) < eventHorizon) { if (mech.energy > 0) mech.energy -= 0.01 if (mech.energy < 0.15) { - mech.damage(0.0004 * game.dmgScale); + mech.damage(0.0004 * simulation.dmgScale); } const angle = Math.atan2(player.position.y - this.position.y, player.position.x - this.position.x); player.force.x -= 0.0017 * Math.cos(angle) * player.mass * (mech.onGround ? 1.7 : 1); @@ -296,7 +296,7 @@ const spawn = { } if (this.cycle < 240) { //damage scales up over 2 seconds to give player time to move const scale = this.cycle / 240 - const dmg = (this.cycle < 120) ? 0 : 0.14 * game.dmgScale * scale + const dmg = (this.cycle < 120) ? 0 : 0.14 * simulation.dmgScale * scale ctx.beginPath(); this.laser(this.vertices[0], this.angle + Math.PI / 6, dmg); this.laser(this.vertices[1], this.angle + 3 * Math.PI / 6, dmg); @@ -329,13 +329,13 @@ const spawn = { ctx.strokeStyle = "rgba(80,0,255,0.07)"; ctx.stroke(); // Draw it } - me.laser = function(where, angle, dmg = 0.14 * game.dmgScale) { + me.laser = function(where, angle, dmg = 0.14 * simulation.dmgScale) { const vertexCollision = function(v1, v1End, domain) { for (let i = 0; i < domain.length; ++i) { let vertices = domain[i].vertices; const len = vertices.length - 1; for (let j = 0; j < len; j++) { - results = game.checkLineIntersection(v1, v1End, vertices[j], vertices[j + 1]); + results = simulation.checkLineIntersection(v1, v1End, vertices[j], vertices[j + 1]); if (results.onLine1 && results.onLine2) { const dx = v1.x - results.x; const dy = v1.y - results.y; @@ -350,7 +350,7 @@ const spawn = { }; } } - results = game.checkLineIntersection(v1, v1End, vertices[0], vertices[len]); + results = simulation.checkLineIntersection(v1, v1End, vertices[0], vertices[len]); if (results.onLine1 && results.onLine2) { const dx = v1.x - results.x; const dy = v1.y - results.y; @@ -385,9 +385,9 @@ const spawn = { vertexCollision(where, look, body); if (!mech.isCloak) vertexCollision(where, look, [player]); if (best.who && best.who === player && mech.immuneCycle < mech.cycle) { - mech.immuneCycle = mech.cycle + 60 + mod.collisionImmuneCycles; //player is immune to collision damage for 30 cycles + mech.immuneCycle = mech.cycle + 60 + tech.collisionImmuneCycles; //player is immune to collision damage for 30 cycles mech.damage(dmg); - game.drawList.push({ //add dmg to draw queue + simulation.drawList.push({ //add dmg to draw queue x: best.x, y: best.y, radius: dmg * 1500, @@ -412,7 +412,7 @@ const spawn = { mobs.spawn(x, y, 4, radius, "#777"); let me = mob[mob.length - 1]; me.g = 0.00015; //required if using 'gravity' - me.accelMag = 0.0008 * game.accelScale; + me.accelMag = 0.0008 * simulation.accelScale; me.groupingRangeMax = 250000 + Math.random() * 100000; me.groupingRangeMin = (radius * 8) * (radius * 8); me.groupingStrength = 0.0005 @@ -454,7 +454,7 @@ const spawn = { mobs.spawn(x, y, 8, radius, "#9ccdc6"); let me = mob[mob.length - 1]; // console.log(`mass=${me.mass}, radius = ${radius}`) - me.accelMag = 0.0005 * game.accelScale; + me.accelMag = 0.0005 * simulation.accelScale; me.memory = 60; me.seeAtDistance2 = 1400000 //1200 vision range Matter.Body.setDensity(me, 0.0005) // normal density is 0.001 // this reduces life by half and decreases knockback @@ -475,7 +475,7 @@ const spawn = { let me = mob[mob.length - 1]; me.isBoss = true; me.isCell = true; - me.accelMag = 0.00015 * game.accelScale; + me.accelMag = 0.00015 * simulation.accelScale; me.memory = 40; me.isVerticesChange = true me.frictionAir = 0.012 @@ -511,7 +511,7 @@ const spawn = { Matter.Body.scale(this, scale, scale); this.radius = Math.sqrt(this.mass * k / Math.PI) } - if (!(game.cycle % this.seePlayerFreq)) { //move away from other mobs + if (!(simulation.cycle % this.seePlayerFreq)) { //move away from other mobs const repelRange = 200 const attractRange = 800 for (let i = 0, len = mob.length; i < len; i++) { @@ -548,7 +548,7 @@ const spawn = { me.isBoss = true; me.frictionAir = 0.01 me.seeAtDistance2 = 1000000; - me.accelMag = 0.0005 * game.accelScale; + me.accelMag = 0.0005 * simulation.accelScale; Matter.Body.setDensity(me, 0.0006); //normal is 0.001 me.collisionFilter.mask = cat.bullet | cat.player me.memory = Infinity; @@ -583,7 +583,7 @@ const spawn = { } }; me.do = function() { - this.stroke = `hsl(0,0%,${80+25*Math.sin(game.cycle*0.01)}%)` + this.stroke = `hsl(0,0%,${80+25*Math.sin(simulation.cycle*0.01)}%)` //steal all power ups for (let i = 0; i < Math.min(powerUp.length, this.vertices.length); i++) { @@ -606,7 +606,7 @@ const spawn = { // Matter.Body.setDensity(me, 0.0007); //extra dense //normal is 0.001 //makes effective life much lower me.friction = 0; me.frictionAir = 0; - me.accelMag = 0.001 * Math.sqrt(game.accelScale); + me.accelMag = 0.001 * Math.sqrt(simulation.accelScale); me.g = me.accelMag * 0.6; //required if using 'gravity' me.memory = 50; spawn.shield(me, x, y); @@ -622,7 +622,7 @@ const spawn = { let me = mob[mob.length - 1]; me.isVerticesChange = true me.big = false; //required for grow - me.accelMag = 0.00045 * game.accelScale; + me.accelMag = 0.00045 * simulation.accelScale; me.collisionFilter.mask = cat.map | cat.body | cat.bullet | cat.player //can't touch other mobs // me.onDeath = function () { //helps collisions functions work better after vertex have been changed // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) @@ -641,7 +641,7 @@ const spawn = { me.frictionAir = 0.006; me.lookTorque = 0.0000008; //controls spin while looking for player me.g = 0.0002; //required if using 'gravity' - me.seePlayerFreq = Math.round((40 + 25 * Math.random()) * game.lookFreqScale); + me.seePlayerFreq = Math.round((40 + 25 * Math.random()) * simulation.lookFreqScale); const springStiffness = 0.00014; const springDampening = 0.0005; @@ -695,17 +695,17 @@ const spawn = { me.g = 0.0017; //required if using 'gravity' me.frictionAir = 0.01; me.restitution = 0; - me.delay = 120 * game.CDScale; + me.delay = 120 * simulation.CDScale; me.randomHopFrequency = 200 + Math.floor(Math.random() * 150); - me.randomHopCD = game.cycle + me.randomHopFrequency; + me.randomHopCD = simulation.cycle + me.randomHopFrequency; spawn.shield(me, x, y); me.do = function() { this.gravity(); this.seePlayerCheck(); this.checkStatus(); if (this.seePlayer.recall) { - if (this.cd < game.cycle && (Matter.Query.collides(this, map).length || Matter.Query.collides(this, body).length)) { - this.cd = game.cycle + this.delay; + if (this.cd < simulation.cycle && (Matter.Query.collides(this, map).length || Matter.Query.collides(this, body).length)) { + this.cd = simulation.cycle + this.delay; const forceMag = (this.accelMag + this.accelMag * Math.random()) * this.mass; const angle = Math.atan2(this.seePlayer.position.y - this.position.y, this.seePlayer.position.x - this.position.x); this.force.x += forceMag * Math.cos(angle); @@ -713,8 +713,8 @@ const spawn = { } } else { //randomly hob if not aware of player - if (this.randomHopCD < game.cycle && (Matter.Query.collides(this, map).length || Matter.Query.collides(this, body).length)) { - this.randomHopCD = game.cycle + this.randomHopFrequency; + if (this.randomHopCD < simulation.cycle && (Matter.Query.collides(this, map).length || Matter.Query.collides(this, body).length)) { + this.randomHopCD = simulation.cycle + this.randomHopFrequency; //slowly change randomHopFrequency after each hop this.randomHopFrequency = Math.max(100, this.randomHopFrequency + (0.5 - Math.random()) * 200); const forceMag = (this.accelMag + this.accelMag * Math.random()) * this.mass * (0.1 + Math.random() * 0.3); @@ -742,9 +742,9 @@ const spawn = { me.look = function() { this.seePlayerByLookingAt(); this.checkStatus(); - if (this.seePlayer.recall && this.cd < game.cycle) { + if (this.seePlayer.recall && this.cd < simulation.cycle) { this.burstDir = Vector.normalise(Vector.sub(this.seePlayer.position, this.position)); - this.cd = game.cycle + 40; + this.cd = simulation.cycle + 40; this.do = this.spin } } @@ -766,9 +766,9 @@ const spawn = { ctx.lineTo(dir.x, dir.y); ctx.stroke(); ctx.setLineDash([]); - if (this.cd < game.cycle) { + if (this.cd < simulation.cycle) { this.fill = this.rememberFill; - this.cd = game.cycle + 180 * game.CDScale + this.cd = simulation.cycle + 180 * simulation.CDScale this.do = this.look this.force = Vector.mult(this.burstDir, this.mass * 0.25); } @@ -781,7 +781,7 @@ const spawn = { me.stroke = "transparent"; //used for drawSneaker me.eventHorizon = radius * 23; //required for blackhole me.seeAtDistance2 = (me.eventHorizon + 400) * (me.eventHorizon + 400); //vision limit is event horizon - me.accelMag = 0.00009 * game.accelScale; + me.accelMag = 0.00009 * simulation.accelScale; me.frictionAir = 0.025; me.collisionFilter.mask = cat.player | cat.bullet me.memory = Infinity; @@ -795,7 +795,7 @@ const spawn = { }); } // this.seePlayerCheckByDistance() - if (!(game.cycle % this.seePlayerFreq)) { + if (!(simulation.cycle % this.seePlayerFreq)) { if (this.distanceToPlayer2() < this.seeAtDistance2) { //&& !mech.isCloak ignore cloak for black holes this.locatePlayer(); if (!this.seePlayer.yes) this.seePlayer.yes = true; @@ -806,7 +806,7 @@ const spawn = { this.checkStatus(); if (this.seePlayer.recall) { //eventHorizon waves in and out - const eventHorizon = this.eventHorizon * (0.93 + 0.17 * Math.sin(game.cycle * 0.011)) + const eventHorizon = this.eventHorizon * (0.93 + 0.17 * Math.sin(simulation.cycle * 0.011)) //accelerate towards the player const forceMag = this.accelMag * this.mass; @@ -832,7 +832,7 @@ const spawn = { if (Vector.magnitude(Vector.sub(this.position, player.position)) < eventHorizon) { if (mech.energy > 0) mech.energy -= 0.004 if (mech.energy < 0.1) { - mech.damage(0.00015 * game.dmgScale); + mech.damage(0.00015 * simulation.dmgScale); } const angle = Math.atan2(player.position.y - this.position.y, player.position.x - this.position.x); player.force.x -= 0.00125 * player.mass * Math.cos(angle) * (mech.onGround ? 1.8 : 1); @@ -859,7 +859,7 @@ const spawn = { me.stroke = "transparent"; //used for drawSneaker me.eventHorizon = 1100; //required for black hole me.seeAtDistance2 = (me.eventHorizon + 1200) * (me.eventHorizon + 1200); //vision limit is event horizon - me.accelMag = 0.00003 * game.accelScale; + me.accelMag = 0.00003 * simulation.accelScale; me.collisionFilter.mask = cat.player | cat.bullet // me.frictionAir = 0.005; me.memory = 1600; @@ -867,7 +867,7 @@ const spawn = { me.onDeath = function() { //applying forces to player doesn't seem to work inside this method, not sure why powerUps.spawnBossPowerUp(this.position.x, this.position.y) - if (game.difficulty > 5) { + if (simulation.difficulty > 5) { //teleport everything to center function toMe(who, where, range) { for (let i = 0, len = who.length; i < len; i++) { @@ -891,7 +891,7 @@ const spawn = { y: this.velocity.y * 0.95 }); } - if (!(game.cycle % this.seePlayerFreq)) { + if (!(simulation.cycle % this.seePlayerFreq)) { if (this.distanceToPlayer2() < this.seeAtDistance2) { //&& !mech.isCloak ignore cloak for black holes this.locatePlayer(); if (!this.seePlayer.yes) this.seePlayer.yes = true; @@ -910,7 +910,7 @@ const spawn = { this.force.y += forceMag * dy / mag; //eventHorizon waves in and out - const eventHorizon = this.eventHorizon * (1 + 0.2 * Math.sin(game.cycle * 0.008)) + const eventHorizon = this.eventHorizon * (1 + 0.2 * Math.sin(simulation.cycle * 0.008)) // zoom camera in and out with the event horizon //draw darkness @@ -938,7 +938,7 @@ const spawn = { if (Vector.magnitude(Vector.sub(this.position, player.position)) < eventHorizon) { if (mech.energy > 0) mech.energy -= 0.006 if (mech.energy < 0.1) { - mech.damage(0.0002 * game.dmgScale); + mech.damage(0.0002 * simulation.dmgScale); } const angle = Math.atan2(player.position.y - this.position.y, player.position.x - this.position.x); player.force.x -= 0.0013 * Math.cos(angle) * player.mass * (mech.onGround ? 1.7 : 1); @@ -970,7 +970,7 @@ const spawn = { me.frictionAir = 0.0065; me.lookTorque = 0.0000008; //controls spin while looking for player me.g = 0.0002; //required if using 'gravity' - me.seePlayerFreq = Math.round((30 + 20 * Math.random()) * game.lookFreqScale); + me.seePlayerFreq = Math.round((30 + 20 * Math.random()) * simulation.lookFreqScale); const springStiffness = 0.00014; const springDampening = 0.0005; @@ -1053,11 +1053,11 @@ const spawn = { me.timeSkipLastCycle = 0 me.eventHorizon = 1800; //required for black hole me.seeAtDistance2 = (me.eventHorizon + 2000) * (me.eventHorizon + 2000); //vision limit is event horizon + 2000 - me.accelMag = 0.0004 * game.accelScale; + me.accelMag = 0.0004 * simulation.accelScale; // me.frictionAir = 0.005; // me.memory = 1600; // Matter.Body.setDensity(me, 0.02); //extra dense //normal is 0.001 //makes effective life much larger - Matter.Body.setDensity(me, 0.0015 + 0.0005 * Math.sqrt(game.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.0015 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger spawn.shield(me, x, y, 1); @@ -1076,12 +1076,12 @@ const spawn = { this.seePlayerCheck(); this.checkStatus(); this.attraction() - if (!game.isTimeSkipping) { + if (!simulation.isTimeSkipping) { const compress = 1 - if (this.timeSkipLastCycle < game.cycle - compress && + if (this.timeSkipLastCycle < simulation.cycle - compress && Vector.magnitude(Vector.sub(this.position, player.position)) < this.eventHorizon) { - this.timeSkipLastCycle = game.cycle - game.timeSkip(compress) + this.timeSkipLastCycle = simulation.cycle + simulation.timeSkip(compress) this.fill = `rgba(0,0,0,${0.4+0.6*Math.random()})` this.stroke = "#014" @@ -1132,7 +1132,7 @@ const spawn = { let me = mob[mob.length - 1]; me.repulsionRange = 73000; //squared me.laserRange = 370; - me.accelMag = 0.0005 * game.accelScale; + me.accelMag = 0.0005 * simulation.accelScale; me.frictionStatic = 0; me.friction = 0; spawn.shield(me, x, y); @@ -1153,7 +1153,7 @@ const spawn = { me.restitution = 0; me.laserPos = me.position; //required for laserTracking me.repulsionRange = 1200000; //squared - me.accelMag = 0.00009 * game.accelScale; + me.accelMag = 0.00009 * simulation.accelScale; me.frictionStatic = 0; me.friction = 0; me.onDamage = function() { @@ -1216,8 +1216,8 @@ const spawn = { me.isBoss = true; me.vertices = Matter.Vertices.rotate(me.vertices, Math.PI, me.position); //make the pointy side of triangle the front Matter.Body.rotate(me, Math.random() * Math.PI * 2); - me.accelMag = 0.0002 * Math.sqrt(game.accelScale); - me.seePlayerFreq = Math.floor(30 * game.lookFreqScale); + me.accelMag = 0.0002 * Math.sqrt(simulation.accelScale); + me.seePlayerFreq = Math.floor(30 * simulation.lookFreqScale); me.memory = 420; me.restitution = 1; me.frictionAir = 0.01; @@ -1247,7 +1247,7 @@ const spawn = { if (this.seePlayer.recall) { //set direction to turn to fire - if (!(game.cycle % this.seePlayerFreq)) { + if (!(simulation.cycle % this.seePlayerFreq)) { this.fireDir = Vector.normalise(Vector.sub(this.seePlayer.position, this.position)); // this.fireDir.y -= Math.abs(this.seePlayer.position.x - this.position.x) / 1600; //gives the bullet an arc } @@ -1272,7 +1272,7 @@ const spawn = { let vertices = domain[i].vertices; const len = vertices.length - 1; for (let j = 0; j < len; j++) { - results = game.checkLineIntersection(v1, v1End, vertices[j], vertices[j + 1]); + results = simulation.checkLineIntersection(v1, v1End, vertices[j], vertices[j + 1]); if (results.onLine1 && results.onLine2) { const dx = v1.x - results.x; const dy = v1.y - results.y; @@ -1289,7 +1289,7 @@ const spawn = { } } } - results = game.checkLineIntersection(v1, v1End, vertices[0], vertices[len]); + results = simulation.checkLineIntersection(v1, v1End, vertices[0], vertices[len]); if (results.onLine1 && results.onLine2) { const dx = v1.x - results.x; const dy = v1.y - results.y; @@ -1327,7 +1327,7 @@ const spawn = { // hitting player if (best.who === player) { if (mech.immuneCycle < mech.cycle) { - const dmg = 0.001 * game.dmgScale; + const dmg = 0.001 * simulation.dmgScale; mech.damage(dmg); //draw damage ctx.fillStyle = color; @@ -1356,7 +1356,7 @@ const spawn = { let me = mob[mob.length - 1]; me.vertices = Matter.Vertices.rotate(me.vertices, Math.PI, me.position); //make the pointy side of triangle the front Matter.Body.rotate(me, Math.random() * Math.PI * 2); - me.accelMag = 0.00007 * game.accelScale; + me.accelMag = 0.00007 * simulation.accelScale; me.onHit = function() { //run this function on hitting player this.explode(); @@ -1384,7 +1384,7 @@ const spawn = { me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) }; - me.rotateVelocity = Math.min(0.0045, 0.0015 * game.accelScale * game.accelScale) * (level.levelsCleared > 8 ? 1 : -1) + me.rotateVelocity = Math.min(0.0045, 0.0015 * simulation.accelScale * simulation.accelScale) * (level.levelsCleared > 8 ? 1 : -1) me.do = function() { this.fill = '#' + Math.random().toString(16).substr(-6); //flash colors this.checkStatus(); @@ -1433,7 +1433,7 @@ const spawn = { let vertices = domain[i].vertices; const len = vertices.length - 1; for (let j = 0; j < len; j++) { - results = game.checkLineIntersection(v1, v1End, vertices[j], vertices[j + 1]); + results = simulation.checkLineIntersection(v1, v1End, vertices[j], vertices[j + 1]); if (results.onLine1 && results.onLine2) { const dx = v1.x - results.x; const dy = v1.y - results.y; @@ -1448,7 +1448,7 @@ const spawn = { }; } } - results = game.checkLineIntersection(v1, v1End, vertices[0], vertices[len]); + results = simulation.checkLineIntersection(v1, v1End, vertices[0], vertices[len]); if (results.onLine1 && results.onLine2) { const dx = v1.x - results.x; const dy = v1.y - results.y; @@ -1483,10 +1483,10 @@ const spawn = { vertexCollision(where, look, body); if (!mech.isCloak) vertexCollision(where, look, [player]); if (best.who && best.who === player && mech.immuneCycle < mech.cycle) { - mech.immuneCycle = mech.cycle + mod.collisionImmuneCycles; //player is immune to collision damage for 30 cycles - const dmg = 0.14 * game.dmgScale; + mech.immuneCycle = mech.cycle + tech.collisionImmuneCycles; //player is immune to collision damage for 30 cycles + const dmg = 0.14 * simulation.dmgScale; mech.damage(dmg); - game.drawList.push({ //add dmg to draw queue + simulation.drawList.push({ //add dmg to draw queue x: best.x, y: best.y, radius: dmg * 1500, @@ -1505,9 +1505,9 @@ const spawn = { mobs.spawn(x, y, 6, radius, "rgb(220,50,205)"); //can't have sides above 6 or collision events don't work (probably because of a convex problem) let me = mob[mob.length - 1]; me.isVerticesChange = true - me.accelMag = 0.0006 * game.accelScale; + me.accelMag = 0.0006 * simulation.accelScale; // me.g = 0.0002; //required if using 'gravity' - me.delay = 360 * game.CDScale; + me.delay = 360 * simulation.CDScale; me.spikeVertex = 0; me.spikeLength = 0; me.isSpikeGrowing = false; @@ -1582,20 +1582,20 @@ const spawn = { striker(x, y, radius = 14 + Math.ceil(Math.random() * 25)) { mobs.spawn(x, y, 5, radius, "rgb(221,102,119)"); let me = mob[mob.length - 1]; - me.accelMag = 0.00034 * game.accelScale; + me.accelMag = 0.00034 * simulation.accelScale; me.g = 0.00015; //required if using 'gravity' me.frictionStatic = 0; me.friction = 0; - me.delay = 90 * game.CDScale; + me.delay = 90 * simulation.CDScale; me.cd = Infinity; Matter.Body.rotate(me, Math.PI * 0.1); spawn.shield(me, x, y); me.onDamage = function() { - this.cd = game.cycle + this.delay; + this.cd = simulation.cycle + this.delay; }; me.do = function() { this.gravity(); - if (!(game.cycle % this.seePlayerFreq)) { // this.seePlayerCheck(); from mobs + if (!(simulation.cycle % this.seePlayerFreq)) { // this.seePlayerCheck(); from mobs if ( this.distanceToPlayer2() < this.seeAtDistance2 && Matter.Query.ray(map, this.position, this.mechPosRange()).length === 0 && @@ -1603,7 +1603,7 @@ const spawn = { !mech.isCloak ) { this.foundPlayer(); - if (this.cd === Infinity) this.cd = game.cycle + this.delay * 0.7; + if (this.cd === Infinity) this.cd = simulation.cycle + this.delay * 0.7; } else if (this.seePlayer.recall) { this.lostPlayer(); this.cd = Infinity @@ -1611,11 +1611,11 @@ const spawn = { } this.checkStatus(); this.attraction(); - if (this.cd < game.cycle) { + if (this.cd < simulation.cycle) { if (this.seePlayer.recall) { const dist = Vector.sub(this.seePlayer.position, this.position); const distMag = Vector.magnitude(dist); - this.cd = game.cycle + this.delay; + this.cd = simulation.cycle + this.delay; ctx.beginPath(); ctx.moveTo(this.position.x, this.position.y); if (distMag < 400) { @@ -1639,7 +1639,7 @@ const spawn = { let me; mobs.spawn(x, y, 5, radius, "transparent"); me = mob[mob.length - 1]; - me.accelMag = 0.0007 * game.accelScale; + me.accelMag = 0.0007 * simulation.accelScale; me.g = 0.0002; //required if using 'gravity' me.stroke = "transparent"; //used for drawSneaker me.alpha = 1; //used in drawSneaker @@ -1690,7 +1690,7 @@ const spawn = { mobs.spawn(x, y, 7, radius, "transparent"); me = mob[mob.length - 1]; me.seeAtDistance2 = 300000; - me.accelMag = 0.00012 * game.accelScale; + me.accelMag = 0.00012 * simulation.accelScale; if (map.length) me.searchTarget = map[Math.floor(Math.random() * (map.length - 1))].position; //required for search Matter.Body.setDensity(me, 0.00065); //normal is 0.001 //makes effective life much lower me.stroke = "transparent"; //used for drawGhost @@ -1753,7 +1753,7 @@ const spawn = { // me.blinkLength = 150 + Math.round(Math.random() * 200); //required for blink // me.isStatic = true; // me.memory = 360; - // me.seePlayerFreq = Math.round((40 + 30 * Math.random()) * game.lookFreqScale); + // me.seePlayerFreq = Math.round((40 + 30 * Math.random()) * simulation.lookFreqScale); // // me.isBig = false; // // me.scaleMag = Math.max(5 - me.mass, 1.75); // me.onDeath = function () { @@ -1763,23 +1763,23 @@ const spawn = { // // } // }; // me.onHit = function () { - // game.timeSkip(120) + // simulation.timeSkip(120) // }; // me.do = function () { // this.seePlayerCheck(); // this.blink(); // //strike by expanding // // if (this.isBig) { - // // if (this.cd - this.delay + 15 < game.cycle) { + // // if (this.cd - this.delay + 15 < simulation.cycle) { // // Matter.Body.scale(this, 1 / this.scaleMag, 1 / this.scaleMag); // // this.isBig = false; // // } // // } else - // if (this.seePlayer.yes && this.cd < game.cycle) { + // if (this.seePlayer.yes && this.cd < simulation.cycle) { // const dist = Vector.sub(this.seePlayer.position, this.position); // const distMag2 = Vector.magnitudeSquared(dist); // if (distMag2 < 80000) { - // this.cd = game.cycle + this.delay; + // this.cd = simulation.cycle + this.delay; // // Matter.Body.scale(this, this.scaleMag, this.scaleMag); // // this.isBig = true; @@ -1792,15 +1792,15 @@ const spawn = { mobs.spawn(x, y, 3, radius, "transparent"); let me = mob[mob.length - 1]; me.isBoss = true; - Matter.Body.setDensity(me, 0.0014 + 0.0003 * Math.sqrt(game.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.0014 + 0.0003 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger me.stroke = "rgba(255,0,200)"; //used for drawGhost me.seeAtDistance2 = 1500000; - me.fireFreq = Math.floor(120 * game.CDScale); + me.fireFreq = Math.floor(120 * simulation.CDScale); me.searchTarget = map[Math.floor(Math.random() * (map.length - 1))].position; //required for search me.hoverElevation = 460 + (Math.random() - 0.5) * 200; //squared me.hoverXOff = (Math.random() - 0.5) * 100; - me.accelMag = Math.floor(10 * (Math.random() + 4.5)) * 0.00001 * game.accelScale; + me.accelMag = Math.floor(10 * (Math.random() + 4.5)) * 0.00001 * simulation.accelScale; me.g = 0.0002; //required if using 'gravity' // gravity called in hoverOverPlayer me.frictionStatic = 0; me.friction = 0; @@ -1834,7 +1834,7 @@ const spawn = { me.fireFreq = 0.007 + Math.random() * 0.005; me.noseLength = 0; me.fireAngle = 0; - me.accelMag = 0.0005 * game.accelScale; + me.accelMag = 0.0005 * simulation.accelScale; me.frictionStatic = 0; me.friction = 0; me.frictionAir = 0.05; @@ -1867,14 +1867,14 @@ const spawn = { me.fireFreq = 0.025; me.noseLength = 0; me.fireAngle = 0; - me.accelMag = 0.005 * game.accelScale; + me.accelMag = 0.005 * simulation.accelScale; me.frictionAir = 0.05; me.lookTorque = 0.000007 * (Math.random() > 0.5 ? -1 : 1); me.fireDir = { x: 0, y: 0 }; - Matter.Body.setDensity(me, 0.03 + 0.0008 * Math.sqrt(game.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.03 + 0.0008 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed @@ -1921,7 +1921,7 @@ const spawn = { this.explode(this.mass * 120); }; me.onDeath = function() { - if (game.difficulty > 4) { + if (simulation.difficulty > 4) { spawn.bullet(this.position.x, this.position.y, this.radius / 3, 5); spawn.bullet(this.position.x, this.position.y, this.radius / 3, 5); spawn.bullet(this.position.x, this.position.y, this.radius / 3, 5); @@ -1983,7 +1983,7 @@ const spawn = { me.fireFreq = 0.006 + Math.random() * 0.002; me.noseLength = 0; me.fireAngle = 0; - me.accelMag = 0.0005 * game.accelScale; + me.accelMag = 0.0005 * simulation.accelScale; me.frictionAir = 0.05; me.torque = 0.0001 * me.inertia; me.fireDir = { @@ -2008,7 +2008,7 @@ const spawn = { //throw a mob/bullet at player if (this.seePlayer.recall) { //set direction to turn to fire - if (!(game.cycle % this.seePlayerFreq)) { + if (!(simulation.cycle % this.seePlayerFreq)) { this.fireDir = Vector.normalise(Vector.sub(this.seePlayer.position, this.position)); // this.fireDir.y -= Math.abs(this.seePlayer.position.x - this.position.x) / 1600; //gives the bullet an arc } @@ -2023,7 +2023,7 @@ const spawn = { } else if (this.noseLength > 1.5) { //fire spawn.sniperBullet(this.vertices[1].x, this.vertices[1].y, 5 + Math.ceil(this.radius / 15), 4); - const v = 20 * game.accelScale; + const v = 20 * simulation.accelScale; Matter.Body.setVelocity(mob[mob.length - 1], { x: this.velocity.x + this.fireDir.x * v + Math.random(), y: this.velocity.y + this.fireDir.y * v + Math.random() @@ -2104,8 +2104,8 @@ const spawn = { launcher(x, y, radius = 30 + Math.ceil(Math.random() * 40)) { mobs.spawn(x, y, 3, radius, "rgb(150,150,255)"); let me = mob[mob.length - 1]; - me.accelMag = 0.00004 * game.accelScale; - me.fireFreq = Math.floor(420 + 90 * Math.random() * game.CDScale) + me.accelMag = 0.00004 * simulation.accelScale; + me.fireFreq = Math.floor(420 + 90 * Math.random() * simulation.CDScale) me.frictionStatic = 0; me.friction = 0; me.frictionAir = 0.02; @@ -2115,7 +2115,7 @@ const spawn = { this.seePlayerCheck(); this.checkStatus(); this.attraction(); - if (this.seePlayer.recall && !(game.cycle % this.fireFreq) && !mech.isBodiesAsleep) { + if (this.seePlayer.recall && !(simulation.cycle % this.fireFreq) && !mech.isBodiesAsleep) { Matter.Body.setAngularVelocity(this, 0.14) //fire a bullet from each vertex for (let i = 0, len = this.vertices.length; i < len; i++) { @@ -2134,15 +2134,15 @@ const spawn = { mobs.spawn(x, y, 6, radius, "rgb(150,150,255)"); let me = mob[mob.length - 1]; me.isBoss = true; - me.accelMag = 0.00008 * game.accelScale; - me.fireFreq = Math.floor(360 * game.CDScale) + me.accelMag = 0.00008 * simulation.accelScale; + me.fireFreq = Math.floor(360 * simulation.CDScale) me.frictionStatic = 0; me.friction = 0; me.frictionAir = 0.02; me.memory = 420; me.repulsionRange = 1200000; //squared spawn.shield(me, x, y, 1); - Matter.Body.setDensity(me, 0.004 + 0.0005 * Math.sqrt(game.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.004 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed @@ -2153,7 +2153,7 @@ const spawn = { this.checkStatus(); this.attraction(); this.repulsion(); - if (this.seePlayer.recall && !(game.cycle % this.fireFreq) && !mech.isBodiesAsleep) { + if (this.seePlayer.recall && !(simulation.cycle % this.fireFreq) && !mech.isBodiesAsleep) { Matter.Body.setAngularVelocity(this, 0.11) //fire a bullet from each vertex for (let i = 0, len = this.vertices.length; i < len; i++) { @@ -2172,9 +2172,9 @@ const spawn = { mobs.spawn(x, y, 5, radius, "rgb(245,180,255)"); let me = mob[mob.length - 1]; me.isBoss = true; - // me.accelMag = 0.00023 * game.accelScale; - me.accelMag = 0.00008 * game.accelScale; - // me.fireFreq = Math.floor(30 * game.CDScale) + // me.accelMag = 0.00023 * simulation.accelScale; + me.accelMag = 0.00008 * simulation.accelScale; + // me.fireFreq = Math.floor(30 * simulation.CDScale) me.canFire = false; me.closestVertex1 = 0; me.closestVertex2 = 1; @@ -2255,7 +2255,7 @@ const spawn = { }; Matter.Body.setDensity(me, 0.000015); //normal is 0.001 me.timeLeft = 420 * (0.8 + 0.4 * Math.random()); - me.accelMag = 0.00017 * game.accelScale; //* (0.8 + 0.4 * Math.random()) + me.accelMag = 0.00017 * simulation.accelScale; //* (0.8 + 0.4 * Math.random()) me.frictionAir = 0.01 //* (0.8 + 0.4 * Math.random()); me.restitution = 0.5; me.leaveBody = false; @@ -2302,10 +2302,10 @@ const spawn = { }; Matter.Body.setDensity(me, 0.0005); //normal is 0.001 me.g = 0.0001; //required if using 'gravity' - me.accelMag = 0.0003 * game.accelScale; + me.accelMag = 0.0003 * simulation.accelScale; me.memory = 30; me.leaveBody = false; - me.seePlayerFreq = Math.round((80 + 50 * Math.random()) * game.lookFreqScale); + me.seePlayerFreq = Math.round((80 + 50 * Math.random()) * simulation.lookFreqScale); me.frictionAir = 0.002; me.do = function() { this.gravity(); @@ -2333,10 +2333,10 @@ const spawn = { mobs.spawn(x, y, 8, radius, "rgb(55,170,170)"); let me = mob[mob.length - 1]; me.isBoss = true; - me.accelMag = 0.00075 * game.accelScale; + me.accelMag = 0.00075 * simulation.accelScale; me.memory = 250; me.laserRange = 500; - Matter.Body.setDensity(me, 0.0015 + 0.0005 * Math.sqrt(game.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.0015 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger spawn.shield(me, x, y, 1); me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) @@ -2356,7 +2356,7 @@ const spawn = { }; //snake tail - const nodes = Math.min(8 + Math.ceil(0.5 * game.difficulty), 40) + const nodes = Math.min(8 + Math.ceil(0.5 * simulation.difficulty), 40) spawn.lineBoss(x + 105, y, "snakeBody", nodes); //constraint boss with first 3 mobs in lineboss consBB[consBB.length] = Constraint.create({ @@ -2387,7 +2387,7 @@ const spawn = { // this.explode(); // }; me.collisionFilter.mask = cat.bullet | cat.player | cat.mob - me.accelMag = 0.0004 * game.accelScale; + me.accelMag = 0.0004 * simulation.accelScale; me.leaveBody = false; me.frictionAir = 0.02; me.isSnakeTail = true; @@ -2418,9 +2418,9 @@ const spawn = { let me = mob[mob.length - 1]; me.isBoss = true; me.g = 0.0001; //required if using 'gravity' - me.accelMag = 0.002 * game.accelScale; + me.accelMag = 0.002 * simulation.accelScale; me.memory = 20; - Matter.Body.setDensity(me, 0.001 + 0.0005 * Math.sqrt(game.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.001 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger spawn.shield(me, x, y, 1); me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) @@ -2433,7 +2433,7 @@ const spawn = { this.attraction(); }; }, - shield(target, x, y, chance = Math.min(0.02 + game.difficulty * 0.005, 0.2)) { + shield(target, x, y, chance = Math.min(0.02 + simulation.difficulty * 0.005, 0.2)) { if (this.allowShields && Math.random() < chance) { mobs.spawn(x, y, 9, target.radius + 30, "rgba(220,220,255,0.9)"); let me = mob[mob.length - 1]; @@ -2526,8 +2526,8 @@ const spawn = { x, y, spawn = "striker", - nodes = Math.min(2 + Math.ceil(Math.random() * (game.difficulty + 2)), 8), - //Math.ceil(Math.random() * 3) + Math.min(4,Math.ceil(game.difficulty/2)), + nodes = Math.min(2 + Math.ceil(Math.random() * (simulation.difficulty + 2)), 8), + //Math.ceil(Math.random() * 3) + Math.min(4,Math.ceil(simulation.difficulty/2)), radius = Math.ceil(Math.random() * 10) + 17, // radius of each node mob sideLength = Math.ceil(Math.random() * 100) + 70, // distance between each node mob stiffness = Math.random() * 0.03 + 0.005 @@ -2560,8 +2560,8 @@ const spawn = { x, y, spawn = "striker", - nodes = Math.min(3 + Math.ceil(Math.random() * game.difficulty + 2), 8), - //Math.ceil(Math.random() * 3) + Math.min(4,Math.ceil(game.difficulty/2)), + nodes = Math.min(3 + Math.ceil(Math.random() * simulation.difficulty + 2), 8), + //Math.ceil(Math.random() * 3) + Math.min(4,Math.ceil(simulation.difficulty/2)), radius = Math.ceil(Math.random() * 10) + 17, l = Math.ceil(Math.random() * 80) + 30, stiffness = Math.random() * 0.06 + 0.01 diff --git a/js/mods.js b/js/tech.js similarity index 72% rename from js/mods.js rename to js/tech.js index 216c682..b1ac5d1 100644 --- a/js/mods.js +++ b/js/tech.js @@ -1,61 +1,61 @@ -const mod = { +const tech = { totalCount: null, setupAllMods() { - for (let i = 0, len = mod.mods.length; i < len; i++) { - mod.mods[i].remove(); - mod.mods[i].isLost = false - mod.mods[i].count = 0 + for (let i = 0, len = tech.tech.length; i < len; i++) { + tech.tech[i].remove(); + tech.tech[i].isLost = false + tech.tech[i].count = 0 } - // mod.nailBotCount = 0; - // mod.foamBotCount = 0; - // mod.boomBotCount = 0; - // mod.laserBotCount = 0; - // mod.orbitalBotCount = 0; - // mod.plasmaBotCount = 0; - mod.armorFromPowerUps = 0; - mod.totalCount = 0; - game.updateModHUD(); + // tech.nailBotCount = 0; + // tech.foamBotCount = 0; + // tech.boomBotCount = 0; + // tech.laserBotCount = 0; + // tech.orbitalBotCount = 0; + // tech.plasmaBotCount = 0; + tech.armorFromPowerUps = 0; + tech.totalCount = 0; + simulation.updateModHUD(); }, removeMod(index) { - mod.mods[index].remove(); - mod.mods[index].count = 0; - game.updateModHUD(); + tech.tech[index].remove(); + tech.tech[index].count = 0; + simulation.updateModHUD(); }, giveMod(index = 'random') { if (index === 'random') { let options = []; - for (let i = 0; i < mod.mods.length; i++) { - if (mod.mods[i].count < mod.mods[i].maxCount && mod.mods[i].allowed()) + for (let i = 0; i < tech.tech.length; i++) { + if (tech.tech[i].count < tech.tech[i].maxCount && tech.tech[i].allowed()) options.push(i); } - // give a random mod from the mods I don't have + // give a random tech from the tech I don't have if (options.length > 0) { let newMod = options[Math.floor(Math.random() * options.length)] - mod.giveMod(newMod) + tech.giveMod(newMod) } } else { if (isNaN(index)) { //find index by name let found = false; - for (let i = 0; i < mod.mods.length; i++) { - if (index === mod.mods[i].name) { + for (let i = 0; i < tech.tech.length; i++) { + if (index === tech.tech[i].name) { index = i; found = true; break; } } - if (!found) return //if name not found don't give any mod + if (!found) return //if name not found don't give any tech } - if (mod.mods[index].isLost) mod.mods[index].isLost = false; //give specific mod - mod.mods[index].effect(); //give specific mod - mod.mods[index].count++ - mod.totalCount++ //used in power up randomization - game.updateModHUD(); + if (tech.tech[index].isLost) tech.tech[index].isLost = false; //give specific tech + tech.tech[index].effect(); //give specific tech + tech.tech[index].count++ + tech.totalCount++ //used in power up randomization + simulation.updateModHUD(); } }, setModToNonRefundable(name) { - for (let i = 0; i < mod.mods.length; i++) { - if (mod.mods.name === name) { - mod.mods[i].isNonRefundable = true; + for (let i = 0; i < tech.tech.length; i++) { + if (tech.tech.name === name) { + tech.tech[i].isNonRefundable = true; return } } @@ -63,20 +63,20 @@ const mod = { // giveBasicMod(index = 'random') { // // if (isNaN(index)) { //find index by name // // let found = false; - // // for (let i = 0; i < mod.mods.length; i++) { - // // if (index === mod.mods[i].name) { + // // for (let i = 0; i < tech.tech.length; i++) { + // // if (index === tech.tech[i].name) { // // index = i; // // found = true; // // break; // // } // // } - // // if (!found) return //if name not found don't give any mod + // // if (!found) return //if name not found don't give any tech // // } - // mod.basicMods[index].effect(); //give specific mod - // mod.mods[index].count++ - // mod.totalCount++ //used in power up randomization - // game.updateModHUD(); + // tech.basicMods[index].effect(); //give specific tech + // tech.tech[index].count++ + // tech.totalCount++ //used in power up randomization + // simulation.updateModHUD(); // }, haveGunCheck(name) { @@ -84,7 +84,7 @@ const mod = { !build.isCustomSelection && b.inventory.length > 2 && name !== b.guns[b.activeGun].name && - Math.random() > 2 / (b.inventory.length + mod.isGunCycle * 3) //lower chance of mods specific to a gun if you have lots of guns + Math.random() > 2 / (b.inventory.length + tech.isGunCycle * 3) //lower chance of tech specific to a gun if you have lots of guns ) { return false } @@ -96,45 +96,45 @@ const mod = { }, damageFromMods() { let dmg = mech.fieldDamage - // if (mod.aimDamage>1) - if (mod.isLowEnergyDamage) dmg *= 1 + Math.max(0, 1 - mech.energy) * 0.5 - if (mod.isMaxEnergyMod) dmg *= 1.4 - if (mod.isEnergyNoAmmo) dmg *= 1.5 - if (mod.isDamageForGuns) dmg *= 1 + 0.07 * b.inventory.length - if (mod.isLowHealthDmg) dmg *= 1 + 0.6 * Math.max(0, 1 - mech.health) - if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2; - if (mod.isEnergyLoss) dmg *= 1.5; - if (mod.isAcidDmg && mech.health > 1) dmg *= 1.4; - if (mod.restDamage > 1 && player.speed < 1) dmg *= mod.restDamage - if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 9; - if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038 - if (mod.isRerollDamage) dmg *= 1 + 0.04 * powerUps.reroll.rerolls - if (mod.isOneGun && b.inventory.length < 2) dmg *= 1.25 - if (mod.isNoFireDamage && mech.cycle > mech.fireCDcycle + 120) dmg *= 1.66 - if (mod.isSpeedDamage) dmg *= 1 + Math.min(0.4, player.speed * 0.013) - if (mod.isBotDamage) dmg *= 1 + 0.02 * mod.totalBots() - return dmg * mod.slowFire * mod.aimDamage + // if (tech.aimDamage>1) + if (tech.isLowEnergyDamage) dmg *= 1 + Math.max(0, 1 - mech.energy) * 0.5 + if (tech.isMaxEnergyMod) dmg *= 1.4 + if (tech.isEnergyNoAmmo) dmg *= 1.5 + if (tech.isDamageForGuns) dmg *= 1 + 0.07 * b.inventory.length + if (tech.isLowHealthDmg) dmg *= 1 + 0.6 * Math.max(0, 1 - mech.health) + if (tech.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2; + if (tech.isEnergyLoss) dmg *= 1.5; + if (tech.isAcidDmg && mech.health > 1) dmg *= 1.4; + if (tech.restDamage > 1 && player.speed < 1) dmg *= tech.restDamage + if (tech.isEnergyDamage) dmg *= 1 + mech.energy / 9; + if (tech.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038 + if (tech.isRerollDamage) dmg *= 1 + 0.04 * powerUps.reroll.rerolls + if (tech.isOneGun && b.inventory.length < 2) dmg *= 1.25 + if (tech.isNoFireDamage && mech.cycle > mech.fireCDcycle + 120) dmg *= 1.66 + if (tech.isSpeedDamage) dmg *= 1 + Math.min(0.4, player.speed * 0.013) + if (tech.isBotDamage) dmg *= 1 + 0.02 * tech.totalBots() + return dmg * tech.slowFire * tech.aimDamage }, duplicationChance() { - return (mod.isBayesian ? 0.2 : 0) + mod.cancelCount * 0.04 + mod.duplicateChance + mech.duplicateChance + return (tech.isBayesian ? 0.2 : 0) + tech.cancelCount * 0.04 + tech.duplicateChance + mech.duplicateChance }, totalBots() { - return mod.foamBotCount + mod.nailBotCount + mod.laserBotCount + mod.boomBotCount + mod.plasmaBotCount + mod.orbitBotCount + return tech.foamBotCount + tech.nailBotCount + tech.laserBotCount + tech.boomBotCount + tech.plasmaBotCount + tech.orbitBotCount }, - mods: [{ + tech: [{ name: "electrolytes", description: "increase damage by 1%
for every 9 stored energy", maxCount: 1, count: 0, allowed() { - return mech.maxEnergy > 1 || mod.isEnergyRecovery || mod.isPiezo || mod.energySiphon > 0 + return mech.maxEnergy > 1 || tech.isEnergyRecovery || tech.isPiezo || tech.energySiphon > 0 }, requires: "increased energy regen or max energy", effect: () => { - mod.isEnergyDamage = true + tech.isEnergyDamage = true }, remove() { - mod.isEnergyDamage = false; + tech.isEnergyDamage = false; } }, { @@ -143,14 +143,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return (mod.haveGunCheck("nail gun") && mod.isIceCrystals) || mod.haveGunCheck("laser") || mech.fieldUpgrades[mech.fieldMode].name === "plasma torch" || mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || mech.fieldUpgrades[mech.fieldMode].name === "pilot wave" + return (tech.haveGunCheck("nail gun") && tech.isIceCrystals) || tech.haveGunCheck("laser") || mech.fieldUpgrades[mech.fieldMode].name === "plasma torch" || mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || mech.fieldUpgrades[mech.fieldMode].name === "pilot wave" }, requires: "energy based damage", effect() { - mod.isEnergyNoAmmo = true; + tech.isEnergyNoAmmo = true; }, remove() { - mod.isEnergyNoAmmo = false; + tech.isEnergyNoAmmo = false; } }, { @@ -159,14 +159,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isEnergyHealth + return !tech.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { - mod.isEnergyLoss = true; + tech.isEnergyLoss = true; }, remove() { - mod.isEnergyLoss = false; + tech.isEnergyLoss = false; } }, { @@ -175,15 +175,15 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isEnergyLoss && mech.maxEnergy === 1 && !mod.isMissileField && !mod.isSporeField && !mod.isRewindAvoidDeath + return tech.isEnergyLoss && mech.maxEnergy === 1 && !tech.isMissileField && !tech.isSporeField && !tech.isRewindAvoidDeath }, requires: "exothermic process, not max energy increase, CPT, missile or spore nano-scale", effect() { - mod.isMaxEnergyMod = true; + tech.isMaxEnergyMod = true; mech.setMaxEnergy() }, remove() { - mod.isMaxEnergyMod = false; + tech.isMaxEnergyMod = false; mech.setMaxEnergy() } }, @@ -193,14 +193,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isEnergyLoss && mech.maxEnergy < 1.1 + return tech.isEnergyLoss && mech.maxEnergy < 1.1 }, requires: "exothermic process", effect() { - mod.isLowEnergyDamage = true; + tech.isLowEnergyDamage = true; }, remove() { - mod.isLowEnergyDamage = false; + tech.isLowEnergyDamage = false; } }, { @@ -213,10 +213,10 @@ const mod = { }, requires: "base movement speed", effect: () => { - mod.restDamage += 0.25 + tech.restDamage += 0.25 }, remove() { - mod.restDamage = 1; + tech.restDamage = 1; } }, { @@ -229,10 +229,10 @@ const mod = { }, requires: "", effect() { - mod.isFarAwayDmg = true; //used in mob.damage() + tech.isFarAwayDmg = true; //used in mob.damage() }, remove() { - mod.isFarAwayDmg = false; + tech.isFarAwayDmg = false; } }, { @@ -245,10 +245,10 @@ const mod = { }, requires: "health above 100", effect() { - mod.isAcidDmg = true; + tech.isAcidDmg = true; }, remove() { - mod.isAcidDmg = false; + tech.isAcidDmg = false; } }, { @@ -261,10 +261,10 @@ const mod = { }, requires: "no more than 1 gun", effect() { - mod.isOneGun = true; + tech.isOneGun = true; }, remove() { - mod.isOneGun = false; + tech.isOneGun = false; } }, { @@ -277,10 +277,10 @@ const mod = { }, requires: "health below 60", effect() { - mod.isLowHealthDmg = true; //used in mob.damage() + tech.isLowHealthDmg = true; //used in mob.damage() }, remove() { - mod.isLowHealthDmg = false; + tech.isLowHealthDmg = false; } }, { @@ -293,10 +293,10 @@ const mod = { }, requires: "some harm reduction", effect() { - mod.isHarmDamage = true; + tech.isHarmDamage = true; }, remove() { - mod.isHarmDamage = false; + tech.isHarmDamage = false; } }, { @@ -309,10 +309,10 @@ const mod = { }, requires: "at least 4 rerolls", effect() { - mod.isRerollDamage = true; + tech.isRerollDamage = true; }, remove() { - mod.isRerollDamage = false; + tech.isRerollDamage = false; } }, { @@ -324,11 +324,11 @@ const mod = { return true }, effect() { - mod.slowFire = 1.2 + tech.slowFire = 1.2 b.setFireCD(); }, remove() { - mod.slowFire = 1; + tech.slowFire = 1; b.setFireCD(); } }, @@ -338,17 +338,17 @@ const mod = { maxCount: 1, count: 0, allowed() { - return powerUps.reroll.rerolls === 0 && !mod.manyWorlds + return powerUps.reroll.rerolls === 0 && !tech.manyWorlds }, requires: "no rerolls", effect() { - mod.isRerollHaste = true; - mod.rerollHaste = 0.33; + tech.isRerollHaste = true; + tech.rerollHaste = 0.33; b.setFireCD(); }, remove() { - mod.isRerollHaste = false; - mod.rerollHaste = 1; + tech.isRerollHaste = false; + tech.rerollHaste = 1; b.setFireCD(); } }, @@ -362,11 +362,11 @@ const mod = { }, requires: "", effect() { - mod.fireRate *= 0.7 + tech.fireRate *= 0.7 b.setFireCD(); }, remove() { - mod.fireRate = 1; + tech.fireRate = 1; b.setFireCD(); } }, @@ -380,10 +380,10 @@ const mod = { }, requires: "not wormhole", effect() { - mod.throwChargeRate = 2 + tech.throwChargeRate = 2 }, remove() { - mod.throwChargeRate = 1 + tech.throwChargeRate = 1 } }, { @@ -392,14 +392,14 @@ const mod = { maxCount: 9, count: 0, allowed() { - return mod.haveGunCheck("missiles") || mod.isIncendiary || (mod.haveGunCheck("grenades") && !mod.isNeutronBomb) || mod.haveGunCheck("vacuum bomb") || mod.isPulseLaser || mod.isMissileField || mod.boomBotCount > 1 || mod.isFlechetteExplode + return tech.haveGunCheck("missiles") || tech.isIncendiary || (tech.haveGunCheck("grenades") && !tech.isNeutronBomb) || tech.haveGunCheck("vacuum bomb") || tech.isPulseLaser || tech.isMissileField || tech.boomBotCount > 1 || tech.isFlechetteExplode }, requires: "an explosive damage source", effect: () => { - mod.explosiveRadius += 0.2; + tech.explosiveRadius += 0.2; }, remove() { - mod.explosiveRadius = 1; + tech.explosiveRadius = 1; } }, { @@ -408,14 +408,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("missiles") || mod.isIncendiary || (mod.haveGunCheck("grenades") && !mod.isNeutronBomb) || mod.haveGunCheck("vacuum bomb") || mod.isPulseLaser || mod.isMissileField || mod.boomBotCount > 1 || mod.isFlechetteExplode + return tech.haveGunCheck("missiles") || tech.isIncendiary || (tech.haveGunCheck("grenades") && !tech.isNeutronBomb) || tech.haveGunCheck("vacuum bomb") || tech.isPulseLaser || tech.isMissileField || tech.boomBotCount > 1 || tech.isFlechetteExplode }, requires: "an explosive damage source", effect: () => { - mod.isSmallExplosion = true; + tech.isSmallExplosion = true; }, remove() { - mod.isSmallExplosion = false; + tech.isSmallExplosion = false; } }, { @@ -424,14 +424,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("missiles") || mod.isIncendiary || (mod.haveGunCheck("grenades") && !mod.isNeutronBomb) || mod.haveGunCheck("vacuum bomb") || mod.isPulseLaser || mod.isMissileField || mod.isFlechetteExplode + return tech.haveGunCheck("missiles") || tech.isIncendiary || (tech.haveGunCheck("grenades") && !tech.isNeutronBomb) || tech.haveGunCheck("vacuum bomb") || tech.isPulseLaser || tech.isMissileField || tech.isFlechetteExplode }, requires: "an explosive damage source", effect: () => { - mod.isExplosionHarm = true; + tech.isExplosionHarm = true; }, remove() { - mod.isExplosionHarm = false; + tech.isExplosionHarm = false; } }, { @@ -441,14 +441,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("missiles") || mod.isIncendiary || (mod.haveGunCheck("grenades") && !mod.isNeutronBomb) || mod.haveGunCheck("vacuum bomb") || mod.isMissileField || mod.isExplodeMob || mod.isFlechetteExplode || mod.isPulseLaser + return tech.haveGunCheck("missiles") || tech.isIncendiary || (tech.haveGunCheck("grenades") && !tech.isNeutronBomb) || tech.haveGunCheck("vacuum bomb") || tech.isMissileField || tech.isExplodeMob || tech.isFlechetteExplode || tech.isPulseLaser }, requires: "an explosive damage source", effect: () => { - mod.isImmuneExplosion = true; + tech.isImmuneExplosion = true; }, remove() { - mod.isImmuneExplosion = false; + tech.isImmuneExplosion = false; } }, { @@ -457,14 +457,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return (mod.haveGunCheck("missiles") || mod.isIncendiary || (mod.haveGunCheck("grenades") && !mod.isNeutronBomb) || mod.haveGunCheck("vacuum bomb") || mod.isPulseLaser || mod.isMissileField || mod.boomBotCount > 1 || mod.isFlechetteExplode) && !mod.sporesOnDeath && !mod.nailsDeathMob && !mod.isBotSpawner + return (tech.haveGunCheck("missiles") || tech.isIncendiary || (tech.haveGunCheck("grenades") && !tech.isNeutronBomb) || tech.haveGunCheck("vacuum bomb") || tech.isPulseLaser || tech.isMissileField || tech.boomBotCount > 1 || tech.isFlechetteExplode) && !tech.sporesOnDeath && !tech.nailsDeathMob && !tech.isBotSpawner }, - requires: "an explosive damage source, no other mob death mods", + requires: "an explosive damage source, no other mob death tech", effect: () => { - mod.isExplodeMob = true; + tech.isExplodeMob = true; }, remove() { - mod.isExplodeMob = false; + tech.isExplodeMob = false; } }, { @@ -473,19 +473,19 @@ const mod = { maxCount: 3, count: 0, allowed() { - return mod.nailsDeathMob || mod.sporesOnDeath || mod.isExplodeMob || mod.isBotSpawner + return tech.nailsDeathMob || tech.sporesOnDeath || tech.isExplodeMob || tech.isBotSpawner }, - requires: "any mob death mod", + requires: "any mob death tech", effect: () => { - mod.mobSpawnWithHealth *= 0.89 + tech.mobSpawnWithHealth *= 0.89 //set all mobs at full health to 0.85 for (let i = 0; i < mob.length; i++) { - if (mob.health > mod.mobSpawnWithHealth) mob.health = mod.mobSpawnWithHealth + if (mob.health > tech.mobSpawnWithHealth) mob.health = tech.mobSpawnWithHealth } }, remove() { - mod.mobSpawnWithHealth = 1; + tech.mobSpawnWithHealth = 1; } }, { @@ -494,17 +494,17 @@ const mod = { maxCount: 9, count: 0, allowed() { - return !mod.nailsDeathMob && !mod.isExplodeMob && !mod.isBotSpawner + return !tech.nailsDeathMob && !tech.isExplodeMob && !tech.isBotSpawner }, - requires: "no other mob death mods", + requires: "no other mob death tech", effect() { - mod.sporesOnDeath += 0.09; + tech.sporesOnDeath += 0.09; for (let i = 0; i < 8; i++) { b.spore(mech.pos) } }, remove() { - mod.sporesOnDeath = 0; + tech.sporesOnDeath = 0; } }, { @@ -513,14 +513,14 @@ const mod = { maxCount: 9, count: 0, allowed() { - return !mod.sporesOnDeath && !mod.isExplodeMob && !mod.isBotSpawner + return !tech.sporesOnDeath && !tech.isExplodeMob && !tech.isBotSpawner }, - requires: "no other mob death mods", + requires: "no other mob death tech", effect: () => { - mod.nailsDeathMob++ + tech.nailsDeathMob++ }, remove() { - mod.nailsDeathMob = 0; + tech.nailsDeathMob = 0; } }, { @@ -529,14 +529,14 @@ const mod = { maxCount: 3, count: 0, allowed() { - return mod.totalBots() > 0 && !mod.sporesOnDeath && !mod.nailsDeathMob && !mod.isExplodeMob + return tech.totalBots() > 0 && !tech.sporesOnDeath && !tech.nailsDeathMob && !tech.isExplodeMob }, - requires: "a bot and no other mob death mods", + requires: "a bot and no other mob death tech", effect() { - mod.isBotSpawner += 0.20; + tech.isBotSpawner += 0.20; }, remove() { - mod.isBotSpawner = 0; + tech.isBotSpawner = 0; } }, { @@ -549,11 +549,11 @@ const mod = { }, requires: "", effect() { - mod.nailBotCount++; + tech.nailBotCount++; b.nailBot(); }, remove() { - mod.nailBotCount -= this.count; + tech.nailBotCount -= this.count; } }, { @@ -562,17 +562,17 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.nailBotCount > 1 + return tech.nailBotCount > 1 }, requires: "2 or more nail bots", effect() { - mod.isNailBotUpgrade = true + tech.isNailBotUpgrade = true for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'nail') bullet[i].isUpgraded = true } }, remove() { - mod.isNailBotUpgrade = false + tech.isNailBotUpgrade = false for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'nail') bullet[i].isUpgraded = false } @@ -588,11 +588,11 @@ const mod = { }, requires: "", effect() { - mod.foamBotCount++; + tech.foamBotCount++; b.foamBot(); }, remove() { - mod.foamBotCount -= this.count; + tech.foamBotCount -= this.count; } }, { @@ -601,17 +601,17 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.foamBotCount > 1 + return tech.foamBotCount > 1 }, requires: "2 or more foam bots", effect() { - mod.isFoamBotUpgrade = true + tech.isFoamBotUpgrade = true for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'foam') bullet[i].isUpgraded = true } }, remove() { - mod.isFoamBotUpgrade = false + tech.isFoamBotUpgrade = false for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'foam') bullet[i].isUpgraded = false } @@ -627,11 +627,11 @@ const mod = { }, requires: "", effect() { - mod.boomBotCount++; + tech.boomBotCount++; b.boomBot(); }, remove() { - mod.boomBotCount -= this.count; + tech.boomBotCount -= this.count; } }, { @@ -640,17 +640,17 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.boomBotCount > 1 + return tech.boomBotCount > 1 }, requires: "2 or more boom bots", effect() { - mod.isBoomBotUpgrade = true + tech.isBoomBotUpgrade = true for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'boom') bullet[i].isUpgraded = true } }, remove() { - mod.isBoomBotUpgrade = false + tech.isBoomBotUpgrade = false for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'boom') bullet[i].isUpgraded = false } @@ -666,11 +666,11 @@ const mod = { }, requires: "maximum energy above 50%", effect() { - mod.laserBotCount++; + tech.laserBotCount++; b.laserBot(); }, remove() { - mod.laserBotCount -= this.count; + tech.laserBotCount -= this.count; } }, { @@ -679,17 +679,17 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.laserBotCount > 1 + return tech.laserBotCount > 1 }, requires: "2 or more laser bots", effect() { - mod.isLaserBotUpgrade = true + tech.isLaserBotUpgrade = true for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'laser') bullet[i].isUpgraded = true } }, remove() { - mod.isLaserBotUpgrade = false + tech.isLaserBotUpgrade = false for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'laser') bullet[i].isUpgraded = false } @@ -706,10 +706,10 @@ const mod = { requires: "", effect() { b.orbitBot(); - mod.orbitBotCount++; + tech.orbitBotCount++; }, remove() { - mod.orbitBotCount -= this.count; + tech.orbitBotCount -= this.count; } }, { @@ -718,12 +718,12 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.orbitBotCount > 1 + return tech.orbitBotCount > 1 }, requires: "2 or more orbital bots", effect() { - mod.isOrbitBotUpgrade = true - const range = 190 + 60 * mod.isOrbitBotUpgrade + tech.isOrbitBotUpgrade = true + const range = 190 + 60 * tech.isOrbitBotUpgrade for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'orbit') { bullet[i].isUpgraded = true @@ -734,8 +734,8 @@ const mod = { }, remove() { - mod.isOrbitBotUpgrade = false - const range = 190 + 60 * mod.isOrbitBotUpgrade + tech.isOrbitBotUpgrade = false + const range = 190 + 60 * tech.isOrbitBotUpgrade for (let i = 0; i < bullet.length; i++) { if (bullet[i].botType === 'orbit') { bullet[i].range = range @@ -754,11 +754,12 @@ const mod = { }, requires: "at least 6 rerolls", effect() { - mod.isRerollBots = true; + tech.isRerollBots = true; powerUps.reroll.changeRerolls(0) + simulation.makeTextLog(`mech.rerolls = 0`) }, remove() { - mod.isRerollBots = false; + tech.isRerollBots = false; } }, { @@ -767,14 +768,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.totalBots() > 5 && !mod.isEnergyHealth + return tech.totalBots() > 5 && !tech.isEnergyHealth }, requires: "5 or more bots", effect() { - mod.isBotArmor = true + tech.isBotArmor = true }, remove() { - mod.isBotArmor = false + tech.isBotArmor = false } }, { name: "network effect", @@ -782,14 +783,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.totalBots() > 6 + return tech.totalBots() > 6 }, requires: "6 or more bots", effect() { - mod.isBotDamage = true + tech.isBotDamage = true }, remove() { - mod.isBotDamage = false + tech.isBotDamage = false } }, { @@ -797,40 +798,40 @@ const mod = { description: "duplicate your permanent bots
remove all of your guns", maxCount: 1, count: 0, - // isNonRefundable: true, + isNonRefundable: true, isCustomHide: true, allowed() { - return mod.totalBots() > 3 + return tech.totalBots() > 3 }, requires: "at least 3 bots", effect() { b.removeAllGuns(); - game.makeGunHUD(); + simulation.makeGunHUD(); //double bots - for (let i = 0; i < mod.nailBotCount; i++) { + for (let i = 0; i < tech.nailBotCount; i++) { b.nailBot(); } - mod.nailBotCount *= 2 - for (let i = 0; i < mod.laserBotCount; i++) { + tech.nailBotCount *= 2 + for (let i = 0; i < tech.laserBotCount; i++) { b.laserBot(); } - mod.laserBotCount *= 2 - for (let i = 0; i < mod.foamBotCount; i++) { + tech.laserBotCount *= 2 + for (let i = 0; i < tech.foamBotCount; i++) { b.foamBot(); } - mod.foamBotCount *= 2 - for (let i = 0; i < mod.boomBotCount; i++) { + tech.foamBotCount *= 2 + for (let i = 0; i < tech.boomBotCount; i++) { b.boomBot(); } - mod.boomBotCount *= 2 - for (let i = 0; i < mod.plasmaBotCount; i++) { + tech.boomBotCount *= 2 + for (let i = 0; i < tech.plasmaBotCount; i++) { b.plasmaBot(); } - mod.plasmaBotCount *= 2 - for (let i = 0; i < mod.orbitBotCount; i++) { + tech.plasmaBotCount *= 2 + for (let i = 0; i < tech.orbitBotCount; i++) { b.orbitBot(); } - mod.orbitBotCount *= 2 + tech.orbitBotCount *= 2 }, remove() {} }, @@ -844,13 +845,13 @@ const mod = { }, requires: "some harm reduction", effect() { - mod.isDroneOnDamage = true; + tech.isDroneOnDamage = true; for (let i = 0; i < 4; i++) { b.drone() //spawn drone } }, remove() { - mod.isDroneOnDamage = false; + tech.isDroneOnDamage = false; } }, { @@ -859,15 +860,15 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.duplicationChance() > 0 + return tech.duplicationChance() > 0 }, requires: "some power up duplication", effect() { - mod.isMineDrop = true; - if (mod.isMineDrop) b.mine(mech.pos, { x: 0, y: 0 }, 0, mod.isMineAmmoBack) + tech.isMineDrop = true; + if (tech.isMineDrop) b.mine(mech.pos, { x: 0, y: 0 }, 0, tech.isMineAmmoBack) }, remove() { - mod.isMineDrop = false; + tech.isMineDrop = false; } }, { @@ -880,13 +881,13 @@ const mod = { }, requires: "", effect() { // good with melee builds, content skipping builds - mod.squirrelFx += 0.2; - mod.squirrelJump += 0.09; + tech.squirrelFx += 0.2; + tech.squirrelJump += 0.09; mech.setMovement() }, remove() { - mod.squirrelFx = 1; - mod.squirrelJump = 1; + tech.squirrelFx = 1; + tech.squirrelJump = 1; mech.setMovement() } }, @@ -896,14 +897,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mech.Fx > 0.016 && !mod.isEnergyHealth + return mech.Fx > 0.016 && !tech.isEnergyHealth }, requires: "speed increase, not mass-energy equivalence", effect() { - mod.isSpeedHarm = true + tech.isSpeedHarm = true }, remove() { - mod.isSpeedHarm = false + tech.isSpeedHarm = false } }, { @@ -916,10 +917,10 @@ const mod = { }, requires: "speed increase", effect() { - mod.isSpeedDamage = true + tech.isSpeedDamage = true }, remove() { - mod.isSpeedDamage = false + tech.isSpeedDamage = false } }, { @@ -932,11 +933,11 @@ const mod = { }, requires: "", effect() { - mod.collisionImmuneCycles += 30; - mech.immuneCycle = mech.cycle + mod.collisionImmuneCycles; //player is immune to collision damage for 30 cycles + tech.collisionImmuneCycles += 30; + mech.immuneCycle = mech.cycle + tech.collisionImmuneCycles; //player is immune to collision damage for 30 cycles }, remove() { - mod.collisionImmuneCycles = 25; + tech.collisionImmuneCycles = 25; } }, { @@ -945,14 +946,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return (mod.totalBots() > 1 || mod.haveGunCheck("drone") || mod.haveGunCheck("mine") || mod.haveGunCheck("spores") || mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing") && !mod.isEnergyHealth + return (tech.totalBots() > 1 || tech.haveGunCheck("drones") || tech.haveGunCheck("mine") || tech.haveGunCheck("spores") || mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing") && !tech.isEnergyHealth }, requires: "drones, spores, mines, or bots", effect() { - mod.isNoFireDefense = true + tech.isNoFireDefense = true }, remove() { - mod.isNoFireDefense = false + tech.isNoFireDefense = false } }, { @@ -961,14 +962,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isNoFireDefense + return tech.isNoFireDefense }, requires: "decorrelation", effect() { - mod.isNoFireDamage = true + tech.isNoFireDamage = true }, remove() { - mod.isNoFireDamage = false + tech.isNoFireDamage = false } }, { @@ -977,14 +978,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isEnergyHealth && mech.harmReduction() < 1 + return !tech.isEnergyHealth && mech.harmReduction() < 1 }, requires: "some harm reduction", effect() { - mod.isHarmArmor = true; + tech.isHarmArmor = true; }, remove() { - mod.isHarmArmor = false; + tech.isHarmArmor = false; } }, { @@ -993,14 +994,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return game.fpsCapDefault > 45 && !mod.isRailTimeSlow + return simulation.fpsCapDefault > 45 && !tech.isRailTimeSlow }, requires: "FPS above 45", effect() { - mod.isSlowFPS = true; + tech.isSlowFPS = true; }, remove() { - mod.isSlowFPS = false; + tech.isSlowFPS = false; } }, { @@ -1009,14 +1010,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isSlowFPS + return tech.isSlowFPS }, requires: "clock gating", effect() { - mod.isHarmFreeze = true; + tech.isHarmFreeze = true; }, remove() { - mod.isHarmFreeze = false; + tech.isHarmFreeze = false; } }, @@ -1026,14 +1027,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isStunField || mod.isPulseStun || mod.oneSuperBall || mod.isHarmFreeze || mod.isIceField || mod.isIceCrystals || mod.isSporeFreeze || mod.isAoESlow || mod.isFreezeMobs || mod.haveGunCheck("ice IX") || mod.isCloakStun || mod.orbitBotCount > 1 || mod.isWormholeDamage + return tech.isStunField || tech.isPulseStun || tech.oneSuperBall || tech.isHarmFreeze || tech.isIceField || tech.isIceCrystals || tech.isSporeFreeze || tech.isAoESlow || tech.isFreezeMobs || tech.haveGunCheck("ice IX") || tech.isCloakStun || tech.orbitBotCount > 1 || tech.isWormholeDamage }, requires: "a freezing or stunning effect", effect() { - mod.isFreezeHarmImmune = true; + tech.isFreezeHarmImmune = true; }, remove() { - mod.isFreezeHarmImmune = false; + tech.isFreezeHarmImmune = false; } }, { @@ -1042,14 +1043,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isEnergyRecovery || mod.isPiezo || mod.energySiphon > 0 || mod.isRailEnergyGain || mod.isWormholeEnergy || mod.iceEnergy > 0 + return tech.isEnergyRecovery || tech.isPiezo || tech.energySiphon > 0 || tech.isRailEnergyGain || tech.isWormholeEnergy || tech.iceEnergy > 0 }, requires: "a source of overfilled energy", effect() { - mod.overfillDrain = 0.85 + tech.overfillDrain = 0.85 }, remove() { - mod.overfillDrain = 0.75 + tech.overfillDrain = 0.75 } }, { @@ -1058,14 +1059,14 @@ const mod = { maxCount: 1, count: 0, allowed() { //&& (mech.fieldUpgrades[mech.fieldMode].name !== "nano-scale manufacturing" || mech.maxEnergy > 1) - return mech.maxEnergy > 0.99 && mech.fieldUpgrades[mech.fieldMode].name !== "standing wave harmonics" && !mod.isEnergyHealth && !mod.isRewindGun + return mech.maxEnergy > 0.99 && mech.fieldUpgrades[mech.fieldMode].name !== "standing wave harmonics" && !tech.isEnergyHealth && !tech.isRewindGun }, requires: "not standing wave, mass-energy, piezo, max energy reduction, CPT gun", effect() { - mod.isRewindAvoidDeath = true; + tech.isRewindAvoidDeath = true; }, remove() { - mod.isRewindAvoidDeath = false; + tech.isRewindAvoidDeath = false; } }, { @@ -1074,14 +1075,14 @@ const mod = { maxCount: 3, count: 0, allowed() { - return mod.isRewindAvoidDeath || mod.isRewindEnergy + return tech.isRewindAvoidDeath || tech.isRewindEnergy }, requires: "CPT", effect() { - mod.isRewindBot++; + tech.isRewindBot++; }, remove() { - mod.isRewindBot = 0; + tech.isRewindBot = 0; } }, { @@ -1090,14 +1091,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isRewindAvoidDeath + return tech.isRewindAvoidDeath }, requires: "CPT", effect() { - mod.isRewindGrenade = true; + tech.isRewindGrenade = true; }, remove() { - mod.isRewindGrenade = false; + tech.isRewindGrenade = false; } }, { @@ -1106,15 +1107,15 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isEnergyHealth + return !tech.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { - mod.isPiezo = true; + tech.isPiezo = true; mech.energy += 4; }, remove() { - mod.isPiezo = false; + tech.isPiezo = false; } }, { @@ -1123,16 +1124,16 @@ const mod = { maxCount: 1, count: 0, allowed() { - return (mod.iceEnergy || mod.isWormholeEnergy || mod.isPiezo || mod.isRailEnergyGain) && mod.energyRegen !== 0.004 + return (tech.iceEnergy || tech.isWormholeEnergy || tech.isPiezo || tech.isRailEnergyGain) && tech.energyRegen !== 0.004 }, requires: "piezoelectricity, Penrose, half-wave, or thermoelectric, but not time crystals", effect: () => { - mod.energyRegen = 0; - mech.fieldRegen = mod.energyRegen; + tech.energyRegen = 0; + mech.fieldRegen = tech.energyRegen; }, remove() { - mod.energyRegen = 0.001; - mech.fieldRegen = mod.energyRegen; + tech.energyRegen = 0.001; + mech.fieldRegen = tech.energyRegen; } }, { @@ -1141,7 +1142,7 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isEnergyLoss && !mod.isPiezo && !mod.isRewindAvoidDeath && !mod.isRewindGun && !mod.isSpeedHarm && mech.fieldUpgrades[mech.fieldMode].name !== "negative mass field" + return !tech.isEnergyLoss && !tech.isPiezo && !tech.isRewindAvoidDeath && !tech.isRewindGun && !tech.isSpeedHarm && mech.fieldUpgrades[mech.fieldMode].name !== "negative mass field" }, requires: "not exothermic process, piezoelectricity, CPT, 1st law, negative mass", effect: () => { @@ -1150,11 +1151,11 @@ const mod = { document.getElementById("health").style.display = "none" document.getElementById("health-bg").style.display = "none" document.getElementById("dmg").style.backgroundColor = "#0cf"; - mod.isEnergyHealth = true; + tech.isEnergyHealth = true; mech.displayHealth(); }, remove() { - mod.isEnergyHealth = false; + tech.isEnergyHealth = false; document.getElementById("health").style.display = "inline" document.getElementById("health-bg").style.display = "inline" document.getElementById("dmg").style.backgroundColor = "#f67"; @@ -1169,19 +1170,19 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isEnergyHealth + return tech.isEnergyHealth }, requires: "mass-energy equivalence", effect() { - mod.healGiveMaxEnergy = true; //mod.healMaxEnergyBonus given from heal power up + tech.healGiveMaxEnergy = true; //tech.healMaxEnergyBonus given from heal power up powerUps.heal.color = "#0ae" for (let i = 0; i < powerUp.length; i++) { //find active heal power ups and adjust color live if (powerUp[i].name === "heal") powerUp[i].color = powerUps.heal.color } }, remove() { - mod.healGiveMaxEnergy = false; - mod.healMaxEnergyBonus = 0 + tech.healGiveMaxEnergy = false; + tech.healMaxEnergyBonus = 0 powerUps.heal.color = "#0eb" for (let i = 0; i < powerUp.length; i++) { //find active heal power ups and adjust color live if (powerUp[i].name === "heal") powerUp[i].color = powerUps.heal.color @@ -1200,11 +1201,11 @@ const mod = { effect() { // mech.maxEnergy += 0.5 // mech.energy += 0.5 - mod.bonusEnergy += 0.5 + tech.bonusEnergy += 0.5 mech.setMaxEnergy() }, remove() { - mod.bonusEnergy = 0; + tech.bonusEnergy = 0; mech.setMaxEnergy() } }, @@ -1214,14 +1215,14 @@ const mod = { maxCount: 9, count: 0, allowed() { - return mod.damageFromMods() > 1 + return tech.damageFromMods() > 1 }, requires: "some increased damage", effect() { - mod.energySiphon += 0.06; + tech.energySiphon += 0.06; }, remove() { - mod.energySiphon = 0; + tech.energySiphon = 0; } }, { @@ -1234,10 +1235,10 @@ const mod = { }, requires: "max energy >= 1", effect() { - mod.isEnergyRecovery = true; + tech.isEnergyRecovery = true; }, remove() { - mod.isEnergyRecovery = false; + tech.isEnergyRecovery = false; } }, { @@ -1246,14 +1247,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isEnergyHealth + return !tech.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { - mod.isHealthRecovery = true; + tech.isHealthRecovery = true; }, remove() { - mod.isHealthRecovery = false; + tech.isHealthRecovery = false; } }, { @@ -1262,14 +1263,14 @@ const mod = { maxCount: 9, count: 0, allowed() { - return !mod.isEnergyHealth && mod.damageFromMods() > 1 + return !tech.isEnergyHealth && tech.damageFromMods() > 1 }, requires: "some increased damage, not mass-energy equivalence", effect() { - mod.healthDrain += 0.01; + tech.healthDrain += 0.01; }, remove() { - mod.healthDrain = 0; + tech.healthDrain = 0; } }, { @@ -1278,16 +1279,16 @@ const mod = { maxCount: 9, count: 0, allowed() { - return !mod.isEnergyHealth + return !tech.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { - mod.bonusHealth += 0.5 + tech.bonusHealth += 0.5 mech.addHealth(0.50) mech.setMaxHealth(); }, remove() { - mod.bonusHealth = 0 + tech.bonusHealth = 0 mech.setMaxHealth(); } @@ -1298,15 +1299,15 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isEnergyHealth + return !tech.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { - mod.isArmorFromPowerUps = true; //tracked by mod.armorFromPowerUps + tech.isArmorFromPowerUps = true; //tracked by tech.armorFromPowerUps }, remove() { - mod.isArmorFromPowerUps = false; - // mod.armorFromPowerUps = 0; //this is now reset in mod.setupAllMods(); + tech.isArmorFromPowerUps = false; + // tech.armorFromPowerUps = 0; //this is now reset in tech.setupAllMods(); mech.setMaxHealth(); } }, @@ -1316,14 +1317,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isArmorFromPowerUps + return tech.isArmorFromPowerUps }, requires: "inductive coupling", effect() { - mod.isEndLevelPowerUp = true; + tech.isEndLevelPowerUp = true; }, remove() { - mod.isEndLevelPowerUp = false; + tech.isEndLevelPowerUp = false; } }, { @@ -1332,14 +1333,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mech.maxHealth > 1 || mod.isArmorFromPowerUps + return mech.maxHealth > 1 || tech.isArmorFromPowerUps }, requires: "increased max health", effect() { - mod.isHealLowHealth = true; + tech.isHealLowHealth = true; }, remove() { - mod.isHealLowHealth = false; + tech.isHealLowHealth = false; } }, { @@ -1348,19 +1349,19 @@ const mod = { maxCount: 3, count: 0, allowed() { - return (mech.health < 0.7 || build.isCustomSelection) && !mod.isEnergyHealth + return (mech.health < 0.7 || build.isCustomSelection) && !tech.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { - mod.largerHeals++; + tech.largerHeals++; }, remove() { - mod.largerHeals = 1; + tech.largerHeals = 1; } }, { name: "anthropic principle", - nameInfo: "", + nameInfo: "", addNameInfo() { setTimeout(function() { powerUps.reroll.changeRerolls(0) @@ -1374,14 +1375,14 @@ const mod = { }, requires: "at least 1 reroll", effect() { - mod.isDeathAvoid = true; - mod.isDeathAvoidedThisLevel = false; + tech.isDeathAvoid = true; + tech.isDeathAvoidedThisLevel = false; setTimeout(function() { powerUps.reroll.changeRerolls(0) }, 1000); }, remove() { - mod.isDeathAvoid = false; + tech.isDeathAvoid = false; } }, { @@ -1394,187 +1395,189 @@ const mod = { }, requires: "", effect() { - mod.isShieldAmmo = true; + tech.isShieldAmmo = true; }, remove() { - mod.isShieldAmmo = false; + tech.isShieldAmmo = false; } }, { name: "Bayesian statistics", - description: "20% chance to duplicate spawned power ups
after a collision, eject one of your mods", + description: "20% chance to duplicate spawned power ups
after a collision, eject 1 tech", maxCount: 1, count: 0, allowed() { - return mod.duplicationChance() < 1 + return tech.duplicationChance() < 1 }, requires: "below 100% duplication chance", effect: () => { - mod.isBayesian = true - game.draw.powerUp = game.draw.powerUpBonus //change power up draw + tech.isBayesian = true + simulation.draw.powerUp = simulation.draw.powerUpBonus //change power up draw }, remove() { - mod.isBayesian = false - if (mod.duplicationChance() === 0) game.draw.powerUp = game.draw.powerUpNormal + tech.isBayesian = false + if (tech.duplicationChance() === 0) simulation.draw.powerUp = simulation.draw.powerUpNormal } }, { name: "stimulated emission", - description: "7% chance to duplicate spawned power ups", + description: "6% chance to duplicate spawned power ups", maxCount: 9, count: 0, allowed() { - return mod.duplicationChance() < 1 + return tech.duplicationChance() < 1 }, requires: "below 100% duplication chance", effect() { - mod.duplicateChance += 0.07 - game.draw.powerUp = game.draw.powerUpBonus //change power up draw + tech.duplicateChance += 0.06 + simulation.draw.powerUp = simulation.draw.powerUpBonus //change power up draw }, remove() { - mod.duplicateChance = 0 - if (mod.duplicationChance() === 0) game.draw.powerUp = game.draw.powerUpNormal + tech.duplicateChance = 0 + if (tech.duplicationChance() === 0) simulation.draw.powerUp = simulation.draw.powerUpNormal } }, { name: "futures exchange", - description: "clicking × to cancel a mod, field, or gun
increases power up duplication chance by 4%", + description: "clicking × to cancel a field, tech, or gun
increases power up duplication chance by 4%", maxCount: 1, count: 0, allowed() { - return mod.duplicationChance() < 1 && !mod.isDeterminism + return tech.duplicationChance() < 1 && !tech.isDeterminism }, requires: "below 100% duplication chance, not determinism", effect() { - mod.isCancelDuplication = true - mod.cancelCount = 0 - game.draw.powerUp = game.draw.powerUpBonus //change power up draw + tech.isCancelDuplication = true + tech.cancelCount = 0 + simulation.draw.powerUp = simulation.draw.powerUpBonus //change power up draw }, remove() { - mod.isCancelDuplication = false - mod.cancelCount = 0 - if (mod.duplicationChance() === 0) game.draw.powerUp = game.draw.powerUpNormal + tech.isCancelDuplication = false + tech.cancelCount = 0 + if (tech.duplicationChance() === 0) simulation.draw.powerUp = simulation.draw.powerUpNormal } }, { name: "commodities exchange", - description: "clicking × to cancel a mod, field, or gun
spawns 6 heals, ammo, or rerolls", + description: "clicking × to cancel a field, tech, or gun
spawns 6 heals, ammo, or rerolls", maxCount: 1, count: 0, allowed() { - return mod.duplicationChance() > 0 && !mod.isDeterminism + return tech.duplicationChance() > 0 && !tech.isDeterminism }, requires: "a chance to duplicate power ups, not determinism", effect() { - mod.isCancelRerolls = true + tech.isCancelRerolls = true }, remove() { - mod.isCancelRerolls = false + tech.isCancelRerolls = false } }, { - name: "reallocation", - description: "convert 1 random mod into 3 new guns
recursive mods lose all stacks", + name: "exchange symmetry", + description: "convert 1 a random tech into 3 new guns
recursive tech lose all stacks", maxCount: 1, count: 0, isNonRefundable: true, isCustomHide: true, allowed() { - return (mod.totalCount > 3) && !mod.isSuperDeterminism + return (tech.totalCount > 3) && !tech.isSuperDeterminism }, - requires: "at least 1 mod, a chance to duplicate power ups", + requires: "at least 1 tech, a chance to duplicate power ups", effect: () => { - const have = [] //find which mods you have - for (let i = 0; i < mod.mods.length; i++) { - if (mod.mods[i].count > 0) have.push(i) + const have = [] //find which tech you have + for (let i = 0; i < tech.tech.length; i++) { + if (tech.tech[i].count > 0) have.push(i) } const choose = have[Math.floor(Math.random() * have.length)] - game.makeTextLog(`
  ${mod.mods[choose].name} removed by reallocation`, 300) - for (let i = 0; i < mod.mods[choose].count; i++) { + simulation.makeTextLog(`tech.remove("${tech.tech[choose].name}")`) + for (let i = 0; i < tech.tech[choose].count; i++) { powerUps.spawn(mech.pos.x, mech.pos.y, "gun"); } powerUps.spawn(mech.pos.x, mech.pos.y, "gun"); powerUps.spawn(mech.pos.x, mech.pos.y, "gun"); - mod.mods[choose].count = 0; - mod.mods[choose].remove(); // remove a random mod form the list of mods you have - mod.mods[choose].isLost = true - game.updateModHUD(); + tech.tech[choose].count = 0; + tech.tech[choose].remove(); // remove a random tech form the list of tech you have + tech.tech[choose].isLost = true + simulation.updateModHUD(); }, remove() {} }, { name: "monte carlo experiment", - description: "spawn 2 mods
50% chance to remove 1 random mod", + description: "spawn 2 tech
remove 1 random tech", maxCount: 1, count: 0, isNonRefundable: true, isCustomHide: true, allowed() { - return (mod.totalCount > 3) && !mod.isSuperDeterminism && mod.duplicationChance() > 0 + return (tech.totalCount > 3) && !tech.isSuperDeterminism && tech.duplicationChance() > 0 }, - requires: "at least 1 mod, a chance to duplicate power ups", + requires: "at least 1 tech, a chance to duplicate power ups", effect: () => { - const have = [] //find which mods you have - for (let i = 0; i < mod.mods.length; i++) { - if (mod.mods[i].count > 0) have.push(i) + const have = [] //find which tech you have + for (let i = 0; i < tech.tech.length; i++) { + if (tech.tech[i].count > 0) have.push(i) } const choose = have[Math.floor(Math.random() * have.length)] - game.makeTextLog(`
  ${mod.mods[choose].name} removed by monte carlo experiment`, 300) - for (let i = 0; i < mod.mods[choose].count; i++) { - powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); + simulation.makeTextLog(`tech.remove("${tech.tech[choose].name}")`) + for (let i = 0; i < tech.tech[choose].count; i++) { + powerUps.spawn(mech.pos.x, mech.pos.y, "tech"); } - powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); - mod.mods[choose].count = 0; - mod.mods[choose].remove(); // remove a random mod form the list of mods you have - mod.mods[choose].isLost = true - game.updateModHUD(); + powerUps.spawn(mech.pos.x, mech.pos.y, "tech"); + tech.tech[choose].count = 0; + tech.tech[choose].remove(); // remove a random tech form the list of tech you have + tech.tech[choose].isLost = true + simulation.updateModHUD(); }, remove() {} }, { - name: "exchange symmetry", - description: `use a reroll to spawn 1 mod
with double your duplication chance`, + name: "strange attractor", + description: `use 2 rerolls to spawn 1 tech
with double your duplication chance`, maxCount: 1, count: 0, isNonRefundable: true, isCustomHide: true, allowed() { - return !mod.isSuperDeterminism && mod.duplicationChance() > 0 && powerUps.reroll.rerolls > 1 + return !tech.isSuperDeterminism && tech.duplicationChance() > 0 && powerUps.reroll.rerolls > 1 }, - requires: "at least 1 mod and 1 reroll, a chance to duplicate power ups", + requires: "at least 1 tech and 1 reroll, a chance to duplicate power ups", effect: () => { - powerUps.reroll.changeRerolls(-1) - const chanceStore = mod.duplicateChance - mod.duplicateChance = (mod.isBayesian ? 0.2 : 0) + mod.cancelCount * 0.04 + mech.duplicateChance + mod.duplicateChance * 2 //increase duplication chance to simulate doubling all 3 sources of duplication chance - powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); - mod.duplicateChance = chanceStore + powerUps.reroll.changeRerolls(-2) + simulation.makeTextLog(`mech.rerolls -= 2 +
${powerUps.reroll.rerolls}`) + const chanceStore = tech.duplicateChance + tech.duplicateChance = (tech.isBayesian ? 0.2 : 0) + tech.cancelCount * 0.04 + mech.duplicateChance + tech.duplicateChance * 2 //increase duplication chance to simulate doubling all 3 sources of duplication chance + powerUps.spawn(mech.pos.x, mech.pos.y, "tech"); + tech.duplicateChance = chanceStore }, remove() {} }, { name: "entanglement", - nameInfo: "", + nameInfo: "", addNameInfo() { setTimeout(function() { - game.boldActiveGunHUD(); + simulation.boldActiveGunHUD(); }, 1000); }, description: "while your first gun is equipped
reduce harm by 13% for each of your guns", maxCount: 1, count: 0, allowed() { - return b.inventory.length > 1 && !mod.isEnergyHealth + return b.inventory.length > 1 && !tech.isEnergyHealth }, requires: "at least 2 guns", effect() { - mod.isEntanglement = true + tech.isEntanglement = true setTimeout(function() { - game.boldActiveGunHUD(); + simulation.boldActiveGunHUD(); }, 1000); }, remove() { - mod.isEntanglement = false; + tech.isEntanglement = false; } }, { @@ -1587,10 +1590,10 @@ const mod = { }, requires: "at least 2 guns", effect() { - mod.isDamageForGuns = true; + tech.isDamageForGuns = true; }, remove() { - mod.isDamageForGuns = false; + tech.isDamageForGuns = false; } }, { @@ -1600,17 +1603,17 @@ const mod = { count: 0, isNonRefundable: true, allowed() { - return mod.isDamageForGuns + return tech.isDamageForGuns }, requires: "arsenal", effect() { - mod.isGunCycle = true; + tech.isGunCycle = true; for (let i = 0; i < 5; i++) { powerUps.spawn(mech.pos.x, mech.pos.y, "gun"); } }, remove() { - mod.isGunCycle = false; + tech.isGunCycle = false; } }, { @@ -1619,14 +1622,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isEnergyNoAmmo + return !tech.isEnergyNoAmmo }, requires: "not exciton-lattice", effect() { - mod.isAmmoForGun = true; + tech.isAmmoForGun = true; }, remove() { - mod.isAmmoForGun = false; + tech.isAmmoForGun = false; } }, { @@ -1636,14 +1639,14 @@ const mod = { count: 0, isNonRefundable: true, allowed() { - return mod.isAmmoForGun + return tech.isAmmoForGun }, requires: "logistics", effect() { for (let i = 0; i < b.guns.length; i++) { if (b.guns[i].have) b.guns[i].ammo = Math.floor(2 * b.guns[i].ammo) } - game.makeGunHUD(); + simulation.makeGunHUD(); }, remove() {} }, @@ -1653,14 +1656,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isEnergyHealth && !mod.isEnergyNoAmmo + return !tech.isEnergyHealth && !tech.isEnergyNoAmmo }, requires: "not mass-energy equivalence
not exciton-lattice", effect: () => { - mod.isAmmoFromHealth = true; + tech.isAmmoFromHealth = true; }, remove() { - mod.isAmmoFromHealth = false; + tech.isAmmoFromHealth = false; } }, { @@ -1673,10 +1676,10 @@ const mod = { }, requires: "", effect() { - mod.isCrouchAmmo = true + tech.isCrouchAmmo = true }, remove() { - mod.isCrouchAmmo = false; + tech.isCrouchAmmo = false; } }, { @@ -1685,86 +1688,86 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isCrouchAmmo && !mod.isEnergyHealth + return tech.isCrouchAmmo && !tech.isEnergyHealth }, requires: "desublimated ammunition
not mass-energy equivalence", effect() { - mod.isTurret = true + tech.isTurret = true }, remove() { - mod.isTurret = false; + tech.isTurret = false; } }, { name: "cardinality", - description: "mods, fields, and guns have 5 choices", + description: "tech, fields, and guns have 5 choices", maxCount: 1, count: 0, allowed() { - return !mod.isDeterminism + return !tech.isDeterminism }, requires: "not determinism", effect: () => { - mod.isExtraChoice = true; + tech.isExtraChoice = true; }, remove() { - mod.isExtraChoice = false; + tech.isExtraChoice = false; } }, { name: "determinism", - description: "spawn 5 mods
mods, fields, and guns have only 1 choice", + description: "spawn 5 tech
tech, fields, and guns have only 1 choice", maxCount: 1, count: 0, isNonRefundable: true, allowed() { - return !mod.isExtraChoice && !mod.isCancelDuplication && !mod.isCancelRerolls + return !tech.isExtraChoice && !tech.isCancelDuplication && !tech.isCancelRerolls }, requires: "not cardinality, not futures or commodities exchanges", effect: () => { - mod.isDeterminism = true; + tech.isDeterminism = true; for (let i = 0; i < 5; i++) { //if you change the six also change it in Born rule - powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); + powerUps.spawn(mech.pos.x, mech.pos.y, "tech"); } }, remove() { - mod.isDeterminism = false; + tech.isDeterminism = false; } }, { name: "superdeterminism", - description: "spawn 7 mods
rerolls, guns, and fields no longer spawn", + description: "spawn 7 tech
rerolls, guns, and fields no longer spawn", maxCount: 1, count: 0, isNonRefundable: true, allowed() { - return mod.isDeterminism && !mod.manyWorlds + return tech.isDeterminism && !tech.manyWorlds }, requires: "determinism", effect: () => { - mod.isSuperDeterminism = true; + tech.isSuperDeterminism = true; for (let i = 0; i < 7; i++) { //if you change the six also change it in Born rule - powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); + powerUps.spawn(mech.pos.x, mech.pos.y, "tech"); } }, remove() { - mod.isSuperDeterminism = false; + tech.isSuperDeterminism = false; } }, { name: "many-worlds", - description: "after choosing a mod, field, or gun
if you have no rerolls spawn 2", + description: "after choosing a field, tech, or gun
if you have no rerolls spawn 2", maxCount: 1, count: 0, allowed() { - return powerUps.reroll.rerolls === 0 && !mod.isSuperDeterminism && !mod.isRerollHaste + return powerUps.reroll.rerolls === 0 && !tech.isSuperDeterminism && !tech.isRerollHaste }, requires: "not superdeterminism or Ψ(t) collapse
no rerolls", effect: () => { - mod.manyWorlds = true; + tech.manyWorlds = true; }, remove() { - mod.manyWorlds = false; + tech.manyWorlds = false; } }, { @@ -1773,34 +1776,34 @@ const mod = { maxCount: 1, count: 0, allowed() { - return (powerUps.reroll.rerolls > 1 || build.isCustomSelection) && !mod.isSuperDeterminism && !mod.isRerollHaste + return (powerUps.reroll.rerolls > 1 || build.isCustomSelection) && !tech.isSuperDeterminism && !tech.isRerollHaste }, requires: "not superdeterminism or Ψ(t) collapse
at least 2 rerolls", effect() { - mod.renormalization = true; + tech.renormalization = true; }, remove() { - mod.renormalization = false; + tech.renormalization = false; } }, { name: "erase", - description: "rerolled or canceled mods will not reoccur
spawn 4 rerolls", + description: "rerolled or canceled tech will not reoccur
spawn 4 rerolls", maxCount: 1, count: 0, allowed() { - return (powerUps.reroll.rerolls > 5 || build.isCustomSelection) && !mod.isDeterminism + return (powerUps.reroll.rerolls > 5 || build.isCustomSelection) && !tech.isDeterminism }, requires: "not determinism, at least 4 rerolls", effect() { - mod.isBanish = true + tech.isBanish = true for (let i = 0; i < 4; i++) { powerUps.spawn(mech.pos.x, mech.pos.y, "reroll", false); } }, remove() { - mod.isBanish = false - powerUps.mod.banishLog = [] //reset banish log + tech.isBanish = false + powerUps.tech.banishLog = [] //reset banish log } }, { @@ -1813,40 +1816,40 @@ const mod = { }, requires: "at least 2 rerolls", effect() { - mod.isImmortal = true; + tech.isImmortal = true; for (let i = 0; i < 4; i++) { powerUps.spawn(mech.pos.x, mech.pos.y, "reroll", false); } }, remove() { - mod.isImmortal = false; + tech.isImmortal = false; } }, { name: "Born rule", - description: "remove all current mods
spawn new mods to replace them", + description: "remove all current tech
spawn new tech to replace them", maxCount: 1, count: 0, // isNonRefundable: true, isCustomHide: true, allowed() { - return (mod.totalCount > 6) + return (tech.totalCount > 6) }, - requires: "more than 6 mods", + requires: "more than 6 tech", effect: () => { //remove active bullets //to get rid of bots for (let i = 0; i < bullet.length; ++i) Matter.World.remove(engine.world, bullet[i]); bullet = []; - let count = 0 //count mods - for (let i = 0, len = mod.mods.length; i < len; i++) { // spawn new mods power ups - if (!mod.mods[i].isNonRefundable) count += mod.mods[i].count + let count = 0 //count tech + for (let i = 0, len = tech.tech.length; i < len; i++) { // spawn new tech power ups + if (!tech.tech[i].isNonRefundable) count += tech.tech[i].count } - if (mod.isDeterminism) count -= 3 //remove the bonus mods - if (mod.isSuperDeterminism) count -= 2 //remove the bonus mods + if (tech.isDeterminism) count -= 3 //remove the bonus tech + if (tech.isSuperDeterminism) count -= 2 //remove the bonus tech - mod.setupAllMods(); // remove all mods - for (let i = 0; i < count; i++) { // spawn new mods power ups - powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); + tech.setupAllMods(); // remove all tech + for (let i = 0; i < count; i++) { // spawn new tech power ups + powerUps.spawn(mech.pos.x, mech.pos.y, "tech"); } //have state is checked in mech.death() }, @@ -1858,14 +1861,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isSuperDeterminism && !mod.isPerpetualHeal && !mod.isPerpetualAmmo && !mod.isPerpetualStun + return !tech.isSuperDeterminism && !tech.isPerpetualHeal && !tech.isPerpetualAmmo && !tech.isPerpetualStun }, requires: "only 1 perpetual effect, not superdeterminism", effect() { - mod.isPerpetualReroll = true + tech.isPerpetualReroll = true }, remove() { - mod.isPerpetualReroll = false + tech.isPerpetualReroll = false } }, { @@ -1874,14 +1877,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isPerpetualReroll && !mod.isPerpetualAmmo && !mod.isPerpetualStun + return !tech.isPerpetualReroll && !tech.isPerpetualAmmo && !tech.isPerpetualStun }, requires: "only 1 perpetual effect", effect() { - mod.isPerpetualHeal = true + tech.isPerpetualHeal = true }, remove() { - mod.isPerpetualHeal = false + tech.isPerpetualHeal = false } }, { @@ -1890,14 +1893,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isPerpetualReroll && !mod.isPerpetualHeal && !mod.isPerpetualReroll && !mod.isPerpetualStun && !mod.isEnergyNoAmmo + return !tech.isPerpetualReroll && !tech.isPerpetualHeal && !tech.isPerpetualReroll && !tech.isPerpetualStun && !tech.isEnergyNoAmmo }, requires: "only 1 perpetual effect, not exciton lattice", effect() { - mod.isPerpetualAmmo = true + tech.isPerpetualAmmo = true }, remove() { - mod.isPerpetualAmmo = false + tech.isPerpetualAmmo = false } }, { @@ -1906,19 +1909,19 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isPerpetualReroll && !mod.isPerpetualHeal && !mod.isPerpetualAmmo + return !tech.isPerpetualReroll && !tech.isPerpetualHeal && !tech.isPerpetualAmmo }, requires: "only 1 perpetual effect", effect() { - mod.isPerpetualStun = true + tech.isPerpetualStun = true }, remove() { - mod.isPerpetualStun = false + tech.isPerpetualStun = false } }, //************************************************** //************************************************** gun - //************************************************** mods + //************************************************** tech //************************************************** { name: "CPT gun", @@ -1927,16 +1930,16 @@ const mod = { maxCount: 1, count: 0, allowed() { - return (mod.totalBots() > 5 || mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || mech.fieldUpgrades[mech.fieldMode].name === "plasma torch" || mech.fieldUpgrades[mech.fieldMode].name === "pilot wave") && !mod.isEnergyHealth && !mod.isRewindAvoidDeath //build.isCustomSelection || + return (tech.totalBots() > 5 || mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || mech.fieldUpgrades[mech.fieldMode].name === "plasma torch" || mech.fieldUpgrades[mech.fieldMode].name === "pilot wave") && !tech.isEnergyHealth && !tech.isRewindAvoidDeath //build.isCustomSelection || }, requires: "bots > 5, plasma torch, nano-scale, pilot wave, not mass-energy equivalence, CPT", effect() { - mod.isRewindGun = true + tech.isRewindGun = true b.guns.push(b.gunRewind) b.giveGuns("CPT gun"); }, remove() { - if (mod.isRewindGun) { + if (tech.isRewindGun) { b.removeGun("CPT gun", true) // for (let i = 0; i < b.guns.length; i++) { // if (b.guns[i].name === "CPT gun") { @@ -1952,13 +1955,13 @@ const mod = { // } else { // b.activeGun = null; // } - // game.makeGunHUD(); + // simulation.makeGunHUD(); // b.guns.splice(i, 1) //also remove CPT gun from gun pool array // break // } // } - mod.isRewindGun = false + tech.isRewindGun = false } } }, @@ -1969,14 +1972,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return ((mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isMissileField || mod.isIceField)) || mod.haveGunCheck("drones") || mod.haveGunCheck("super balls") || mod.haveGunCheck("nail gun") || mod.haveGunCheck("shotgun")) && !mod.isIceCrystals && !mod.isNailCrit && !mod.isNailShot && !mod.isNailPoison + return ((mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(tech.isSporeField || tech.isMissileField || tech.isIceField)) || tech.haveGunCheck("drones") || tech.haveGunCheck("super balls") || tech.haveGunCheck("nail gun") || tech.haveGunCheck("shotgun")) && !tech.isIceCrystals && !tech.isNailCrit && !tech.isNailShot && !tech.isNailPoison }, requires: "drones, super balls, nail gun, shotgun", effect() { - mod.isIncendiary = true + tech.isIncendiary = true }, remove() { - mod.isIncendiary = false; + tech.isIncendiary = false; } }, { @@ -1986,14 +1989,14 @@ const mod = { maxCount: 9, count: 0, allowed() { - return (mod.haveGunCheck("grenades") && !mod.isNeutronBomb) || mod.haveGunCheck("missiles") || mod.haveGunCheck("rail gun") || (mod.haveGunCheck("shotgun") && mod.isSlugShot) || mod.throwChargeRate > 1 + return (tech.haveGunCheck("grenades") && !tech.isNeutronBomb) || tech.haveGunCheck("missiles") || tech.haveGunCheck("rail gun") || (tech.haveGunCheck("shotgun") && tech.isSlugShot) || tech.throwChargeRate > 1 }, requires: "grenades, missiles, rail gun, shotgun slugs, or mass driver", effect() { - mod.fragments++ + tech.fragments++ }, remove() { - mod.fragments = 0 + tech.fragments = 0 } }, { @@ -2003,14 +2006,14 @@ const mod = { maxCount: 3, count: 0, allowed() { - return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || mod.haveGunCheck("spores") || mod.haveGunCheck("drones") || mod.haveGunCheck("missiles") || mod.haveGunCheck("foam") || mod.haveGunCheck("wave beam") || mod.haveGunCheck("ice IX") || mod.isNeutronBomb + return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || tech.haveGunCheck("spores") || tech.haveGunCheck("drones") || tech.haveGunCheck("missiles") || tech.haveGunCheck("foam") || tech.haveGunCheck("wave beam") || tech.haveGunCheck("ice IX") || tech.isNeutronBomb }, requires: "drones, spores, missiles, foam
wave beam, ice IX, neutron bomb", effect() { - mod.isBulletsLastLonger += 0.3 + tech.isBulletsLastLonger += 0.3 }, remove() { - mod.isBulletsLastLonger = 1; + tech.isBulletsLastLonger = 1; } }, { @@ -2020,14 +2023,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isBulletsLastLonger > 1 + return tech.isBulletsLastLonger > 1 }, requires: "Lorentzian topology", effect() { - mod.isDamageFromBulletCount = true + tech.isDamageFromBulletCount = true }, remove() { - mod.isDamageFromBulletCount = false + tech.isDamageFromBulletCount = false } }, { @@ -2037,33 +2040,33 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("nail gun") && !mod.nailInstantFireRate && !mod.isIncendiary + return tech.haveGunCheck("nail gun") && !tech.nailInstantFireRate && !tech.isIncendiary }, requires: "nail gun, not incendiary, not powder-actuated", effect() { - mod.isIceCrystals = true; + tech.isIceCrystals = true; for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "nail gun") { b.guns[i].ammoPack = Infinity b.guns[i].recordedAmmo = b.guns[i].ammo b.guns[i].ammo = Infinity - game.updateGunHUD(); + simulation.updateGunHUD(); break; } } }, remove() { - if (mod.isIceCrystals) { + if (tech.isIceCrystals) { for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "nail gun") { b.guns[i].ammoPack = b.guns[i].defaultAmmoPack; if (b.guns[i].recordedAmmo) b.guns[i].ammo = b.guns[i].recordedAmmo - game.updateGunHUD(); + simulation.updateGunHUD(); break; } } } - mod.isIceCrystals = false; + tech.isIceCrystals = false; } }, { @@ -2073,14 +2076,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("nail gun") && !mod.isIncendiary + return tech.haveGunCheck("nail gun") && !tech.isIncendiary }, requires: "nail gun, not incendiary", effect() { - mod.isNailCrit = true + tech.isNailCrit = true }, remove() { - mod.isNailCrit = false + tech.isNailCrit = false } }, { @@ -2090,14 +2093,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("nail gun") + return tech.haveGunCheck("nail gun") }, requires: "nail gun", effect() { - mod.nailFireRate = true + tech.nailFireRate = true }, remove() { - mod.nailFireRate = false + tech.nailFireRate = false } }, { @@ -2107,14 +2110,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("nail gun") && mod.nailFireRate && !mod.isIceCrystals + return tech.haveGunCheck("nail gun") && tech.nailFireRate && !tech.isIceCrystals }, requires: "nail gun and pneumatic actuator", effect() { - mod.nailInstantFireRate = true + tech.nailInstantFireRate = true }, remove() { - mod.nailInstantFireRate = false + tech.nailInstantFireRate = false } }, { @@ -2124,11 +2127,11 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("shotgun") + return tech.haveGunCheck("shotgun") }, requires: "shotgun", effect() { - mod.isShotgunImmune = true; + tech.isShotgunImmune = true; //cut current ammo by 1/2 for (i = 0, len = b.guns.length; i < len; i++) { //find which gun @@ -2137,7 +2140,7 @@ const mod = { break; } } - game.updateGunHUD(); + simulation.updateGunHUD(); for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "shotgun") { @@ -2147,7 +2150,7 @@ const mod = { } }, remove() { - mod.isShotgunImmune = false; + tech.isShotgunImmune = false; for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "shotgun") { b.guns[i].ammoPack = b.guns[i].defaultAmmoPack; @@ -2163,14 +2166,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("shotgun") && !mod.isIncendiary && !mod.isSlugShot + return tech.haveGunCheck("shotgun") && !tech.isIncendiary && !tech.isSlugShot }, requires: "shotgun", effect() { - mod.isNailShot = true; + tech.isNailShot = true; }, remove() { - mod.isNailShot = false; + tech.isNailShot = false; } }, { @@ -2180,14 +2183,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("shotgun") && !mod.isNailShot + return tech.haveGunCheck("shotgun") && !tech.isNailShot }, requires: "shotgun", effect() { - mod.isSlugShot = true; + tech.isSlugShot = true; }, remove() { - mod.isSlugShot = false; + tech.isSlugShot = false; } }, { @@ -2197,14 +2200,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("shotgun") + return tech.haveGunCheck("shotgun") }, requires: "shotgun", effect() { - mod.isShotgunRecoil = true; + tech.isShotgunRecoil = true; }, remove() { - mod.isShotgunRecoil = false; + tech.isShotgunRecoil = false; } }, { @@ -2214,14 +2217,14 @@ const mod = { maxCount: 9, count: 0, allowed() { - return mod.haveGunCheck("super balls") && !mod.oneSuperBall + return tech.haveGunCheck("super balls") && !tech.oneSuperBall }, - requires: "super balls, but not the mod super ball", + requires: "super balls, but not the tech super ball", effect() { - mod.superBallNumber++ + tech.superBallNumber++ }, remove() { - mod.superBallNumber = 4; + tech.superBallNumber = 4; } }, { @@ -2231,14 +2234,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("super balls") && mod.superBallNumber === 4 + return tech.haveGunCheck("super balls") && tech.superBallNumber === 4 }, requires: "super balls, but not super duper", effect() { - mod.oneSuperBall = true; + tech.oneSuperBall = true; }, remove() { - mod.oneSuperBall = false; + tech.oneSuperBall = false; } }, { @@ -2248,14 +2251,14 @@ const mod = { maxCount: 9, count: 0, allowed() { - return mod.haveGunCheck("super balls") + return tech.haveGunCheck("super balls") }, requires: "super balls", effect() { - mod.bulletSize += 0.15 + tech.bulletSize += 0.15 }, remove() { - mod.bulletSize = 1; + tech.bulletSize = 1; } }, { @@ -2265,11 +2268,11 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("flechettes") + return tech.haveGunCheck("flechettes") }, requires: "flechettes", effect() { - mod.isFlechetteMultiShot = true; + tech.isFlechetteMultiShot = true; //cut current ammo by 1/3 for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "flechettes") { @@ -2284,10 +2287,10 @@ const mod = { break } } - game.updateGunHUD(); + simulation.updateGunHUD(); }, remove() { - if (mod.isFlechetteMultiShot) { + if (tech.isFlechetteMultiShot) { for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "flechettes") { b.guns[i].ammo = Math.ceil(b.guns[i].ammo * 3); @@ -2299,10 +2302,10 @@ const mod = { b.guns[i].ammoPack = b.guns[i].defaultAmmoPack; break } - game.updateGunHUD(); + simulation.updateGunHUD(); } } - mod.isFlechetteMultiShot = false; + tech.isFlechetteMultiShot = false; } }, { @@ -2312,14 +2315,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("flechettes") && !mod.isFastDot + return tech.haveGunCheck("flechettes") && !tech.isFastDot }, requires: "flechettes", effect() { - mod.isSlowDot = true; + tech.isSlowDot = true; }, remove() { - mod.isSlowDot = false; + tech.isSlowDot = false; } }, { @@ -2329,14 +2332,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("flechettes") && !mod.isSlowDot + return tech.haveGunCheck("flechettes") && !tech.isSlowDot }, requires: "flechettes", effect() { - mod.isFastDot = true; + tech.isFastDot = true; }, remove() { - mod.isFastDot = false; + tech.isFastDot = false; } }, { @@ -2346,14 +2349,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("flechettes") && !mod.pierce + return tech.haveGunCheck("flechettes") && !tech.pierce }, requires: "flechettes and not piercing needles", effect() { - mod.isFlechetteExplode = true + tech.isFlechetteExplode = true }, remove() { - mod.isFlechetteExplode = false + tech.isFlechetteExplode = false } }, { @@ -2363,14 +2366,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("flechettes") || mod.isNailPoison || mod.isHeavyWater || mod.isWormholeDamage || mod.isNeutronBomb + return tech.haveGunCheck("flechettes") || tech.isNailPoison || tech.isHeavyWater || tech.isWormholeDamage || tech.isNeutronBomb }, requires: "radiation damage source", effect() { - mod.isRadioactive = true + tech.isRadioactive = true }, remove() { - mod.isRadioactive = false + tech.isRadioactive = false } }, { @@ -2380,14 +2383,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("flechettes") && !mod.isFlechetteExplode + return tech.haveGunCheck("flechettes") && !tech.isFlechetteExplode }, requires: "flechettes and not supercritical fission", effect() { - mod.pierce = true; + tech.pierce = true; }, remove() { - mod.pierce = false; + tech.pierce = false; } }, { @@ -2397,14 +2400,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("wave beam") && !mod.isExtruder + return tech.haveGunCheck("wave beam") && !tech.isExtruder }, requires: "wave beam", effect() { - mod.waveHelix = 2 + tech.waveHelix = 2 }, remove() { - mod.waveHelix = 1 + tech.waveHelix = 1 } }, { @@ -2414,16 +2417,16 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("wave beam") && !mod.isWaveReflect && !mod.isExtruder + return tech.haveGunCheck("wave beam") && !tech.isWaveReflect && !tech.isExtruder }, requires: "wave beam", effect() { - mod.waveSpeedMap = 3 //needs to be 3 to stop bound state require check - mod.waveSpeedBody = 1.9 + tech.waveSpeedMap = 3 //needs to be 3 to stop bound state require check + tech.waveSpeedBody = 1.9 }, remove() { - mod.waveSpeedMap = 0.08 - mod.waveSpeedBody = 0.25 + tech.waveSpeedMap = 0.08 + tech.waveSpeedBody = 0.25 } }, { @@ -2433,14 +2436,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("wave beam") && mod.waveSpeedMap !== 3 && !mod.isExtruder + return tech.haveGunCheck("wave beam") && tech.waveSpeedMap !== 3 && !tech.isExtruder }, requires: "wave beam", effect() { - mod.isWaveReflect = true + tech.isWaveReflect = true }, remove() { - mod.isWaveReflect = false + tech.isWaveReflect = false } }, { @@ -2450,14 +2453,14 @@ const mod = { maxCount: 6, count: 0, allowed() { - return mod.haveGunCheck("missiles") || mod.isMissileField + return tech.haveGunCheck("missiles") || tech.isMissileField }, requires: "missiles", effect() { - mod.recursiveMissiles++ + tech.recursiveMissiles++ }, remove() { - mod.recursiveMissiles = 0; + tech.recursiveMissiles = 0; } }, { @@ -2467,14 +2470,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("missiles") + return tech.haveGunCheck("missiles") }, requires: "missiles", effect() { - mod.is3Missiles = true; + tech.is3Missiles = true; }, remove() { - mod.is3Missiles = false; + tech.is3Missiles = false; } }, { @@ -2484,15 +2487,15 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("grenades") && !mod.isVacuumBomb && !mod.isNeutronBomb + return tech.haveGunCheck("grenades") }, - requires: "grenades, not vacuum bomb, neutron", + requires: "grenades", effect() { - mod.isRPG = true; + tech.isRPG = true; b.setGrenadeMode() }, remove() { - mod.isRPG = false; + tech.isRPG = false; b.setGrenadeMode() } }, @@ -2503,15 +2506,15 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("grenades") && !mod.isRPG && !mod.isNeutronBomb + return tech.haveGunCheck("grenades") && !tech.isNeutronBomb }, - requires: "grenades, not rocket-propelled", + requires: "grenades, not neutron bomb", effect() { - mod.isVacuumBomb = true; + tech.isVacuumBomb = true; b.setGrenadeMode() }, remove() { - mod.isVacuumBomb = false; + tech.isVacuumBomb = false; b.setGrenadeMode() } }, @@ -2522,15 +2525,15 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("grenades") && !mod.isRPG && !mod.fragments && !mod.isVacuumBomb + return tech.haveGunCheck("grenades") && !tech.fragments && !tech.isVacuumBomb }, - requires: "grenades, not rocket-propelled or fragmentation", + requires: "grenades, not fragmentation", effect() { - mod.isNeutronBomb = true; + tech.isNeutronBomb = true; b.setGrenadeMode() }, remove() { - mod.isNeutronBomb = false; + tech.isNeutronBomb = false; b.setGrenadeMode() } }, @@ -2541,14 +2544,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isNeutronBomb + return tech.isNeutronBomb }, requires: "neutron bomb", effect() { - mod.isNeutronImmune = true + tech.isNeutronImmune = true }, remove() { - mod.isNeutronImmune = false + tech.isNeutronImmune = false } }, { @@ -2558,14 +2561,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isNeutronBomb + return tech.isNeutronBomb }, requires: "neutron bomb", effect() { - mod.isNeutronSlow = true + tech.isNeutronSlow = true }, remove() { - mod.isNeutronSlow = false + tech.isNeutronSlow = false } }, { @@ -2575,31 +2578,31 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("mine") && !mod.isMineSentry + return tech.haveGunCheck("mine") && !tech.isMineSentry }, requires: "mine, not sentry", effect() { - mod.isMineAmmoBack = true; + tech.isMineAmmoBack = true; }, remove() { - mod.isMineAmmoBack = false; + tech.isMineAmmoBack = false; } }, { name: "sentry", - description: "mines are modified to target mobs with nails
mines last about 12 seconds", + description: "mines target mobs with nails over time
mines last about 12 seconds", isGunMod: true, maxCount: 1, count: 0, allowed() { - return (mod.haveGunCheck("mine") && !mod.isMineAmmoBack) || mod.isMineDrop + return (tech.haveGunCheck("mine") && !tech.isMineAmmoBack) || tech.isMineDrop }, requires: "mine, not mine reclamation", effect() { - mod.isMineSentry = true; + tech.isMineSentry = true; }, remove() { - mod.isMineSentry = false; + tech.isMineSentry = false; } }, { @@ -2609,14 +2612,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isMineDrop + mod.nailBotCount + mod.fragments + mod.nailsDeathMob / 2 + (mod.haveGunCheck("mine") + mod.isNailShot + (mod.haveGunCheck("nail gun") && !mod.isIncendiary)) * 2 > 1 + return tech.isMineDrop + tech.nailBotCount + tech.fragments + tech.nailsDeathMob / 2 + (tech.haveGunCheck("mine") + tech.isNailShot + (tech.haveGunCheck("nail gun") && !tech.isIncendiary)) * 2 > 1 }, requires: "nails", effect() { - mod.isNailPoison = true; + tech.isNailPoison = true; }, remove() { - mod.isNailPoison = false; + tech.isNailPoison = false; } }, { @@ -2626,14 +2629,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isMineDrop + mod.nailBotCount + mod.fragments + mod.nailsDeathMob / 2 + (mod.haveGunCheck("mine") + mod.isNailShot + (mod.haveGunCheck("nail gun") && !mod.isIncendiary)) * 2 > 1 + return tech.isMineDrop + tech.nailBotCount + tech.fragments + tech.nailsDeathMob / 2 + (tech.haveGunCheck("mine") + tech.isNailShot + (tech.haveGunCheck("nail gun") && !tech.isIncendiary)) * 2 > 1 }, requires: "nails", effect() { - mod.biggerNails += 0.33 + tech.biggerNails += 0.33 }, remove() { - mod.biggerNails = 1 + tech.biggerNails = 1 } }, { @@ -2643,14 +2646,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("spores") + return tech.haveGunCheck("spores") }, requires: "spores", effect() { - mod.isSporeGrowth = true + tech.isSporeGrowth = true }, remove() { - mod.isSporeGrowth = false + tech.isSporeGrowth = false } }, { @@ -2660,14 +2663,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("spores") || mod.sporesOnDeath > 0 || mod.isSporeField + return tech.haveGunCheck("spores") || tech.sporesOnDeath > 0 || tech.isSporeField }, requires: "spores", effect() { - mod.isFastSpores = true + tech.isFastSpores = true }, remove() { - mod.isFastSpores = false + tech.isFastSpores = false } }, { @@ -2678,14 +2681,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("spores") || mod.sporesOnDeath > 0 || mod.isSporeField + return tech.haveGunCheck("spores") || tech.sporesOnDeath > 0 || tech.isSporeField }, requires: "spores", effect() { - mod.isSporeFreeze = true + tech.isSporeFreeze = true }, remove() { - mod.isSporeFreeze = false + tech.isSporeFreeze = false } }, { @@ -2695,14 +2698,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("spores") || mod.sporesOnDeath > 0 || mod.isSporeField + return tech.haveGunCheck("spores") || tech.sporesOnDeath > 0 || tech.isSporeField }, requires: "spores", effect() { - mod.isSporeFollow = true + tech.isSporeFollow = true }, remove() { - mod.isSporeFollow = false + tech.isSporeFollow = false } }, { @@ -2712,14 +2715,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return (mod.haveGunCheck("spores") || mod.sporesOnDeath > 0 || mod.isSporeField) && !mod.isEnergyHealth + return (tech.haveGunCheck("spores") || tech.sporesOnDeath > 0 || tech.isSporeField) && !tech.isEnergyHealth }, requires: "spores", effect() { - mod.isMutualism = true + tech.isMutualism = true }, remove() { - mod.isMutualism = false + tech.isMutualism = false } }, { @@ -2729,14 +2732,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("drones") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isMissileField || mod.isIceField)) + return tech.haveGunCheck("drones") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(tech.isSporeField || tech.isMissileField || tech.isIceField)) }, requires: "drones", effect() { - mod.isFastDrones = true + tech.isFastDrones = true }, remove() { - mod.isFastDrones = false + tech.isFastDrones = false } }, { @@ -2746,14 +2749,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isArmorFromPowerUps && (mod.haveGunCheck("drones") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isMissileField || mod.isIceField))) + return !tech.isArmorFromPowerUps && (tech.haveGunCheck("drones") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(tech.isSporeField || tech.isMissileField || tech.isIceField))) }, requires: "drones", effect() { - mod.isDroneGrab = true + tech.isDroneGrab = true }, remove() { - mod.isDroneGrab = false + tech.isDroneGrab = false } }, { @@ -2763,14 +2766,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("ice IX") || mod.isIceCrystals || mod.isSporeFreeze || mod.isIceField + return tech.haveGunCheck("ice IX") || tech.isIceCrystals || tech.isSporeFreeze || tech.isIceField }, requires: "a freeze effect", effect() { - mod.isAoESlow = true + tech.isAoESlow = true }, remove() { - mod.isAoESlow = false + tech.isAoESlow = false } }, { @@ -2780,14 +2783,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return (mod.haveGunCheck("ice IX") || mod.isIceField) && !mod.iceEnergy + return (tech.haveGunCheck("ice IX") || tech.isIceField) && !tech.iceEnergy }, requires: "ice IX", effect() { - mod.isHeavyWater = true + tech.isHeavyWater = true }, remove() { - mod.isHeavyWater = false; + tech.isHeavyWater = false; } }, { @@ -2797,14 +2800,14 @@ const mod = { maxCount: 9, count: 0, allowed() { - return (mod.haveGunCheck("ice IX") || mod.isIceField) && !mod.isHeavyWater + return (tech.haveGunCheck("ice IX") || tech.isIceField) && !tech.isHeavyWater }, requires: "ice IX", effect() { - mod.iceEnergy++ + tech.iceEnergy++ }, remove() { - mod.iceEnergy = 0; + tech.iceEnergy = 0; } }, { @@ -2814,14 +2817,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("foam") || mod.foamBotCount > 1 + return tech.haveGunCheck("foam") || tech.foamBotCount > 1 }, requires: "foam", effect() { - mod.isFoamGrowOnDeath = true + tech.isFoamGrowOnDeath = true }, remove() { - mod.isFoamGrowOnDeath = false; + tech.isFoamGrowOnDeath = false; } }, { @@ -2831,14 +2834,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("foam") || mod.foamBotCount > 2 + return tech.haveGunCheck("foam") || tech.foamBotCount > 2 }, requires: "foam", effect() { - mod.isFastFoam = true + tech.isFastFoam = true }, remove() { - mod.isFastFoam = false; + tech.isFastFoam = false; } }, // { @@ -2847,14 +2850,14 @@ const mod = { // maxCount: 1, // count: 0, // allowed() { - // return mod.haveGunCheck("foam") || mod.foamBotCount > 2 + // return tech.haveGunCheck("foam") || tech.foamBotCount > 2 // }, // requires: "foam", // effect() { - // mod.isLargeFoam = true + // tech.isLargeFoam = true // }, // remove() { - // mod.isLargeFoam = false; + // tech.isLargeFoam = false; // } // }, // { @@ -2863,16 +2866,16 @@ const mod = { // maxCount: 1, // count: 0, // allowed() { - // return game.fpsCapDefault > 45 && mod.haveGunCheck("rail gun") && !mod.isSlowFPS && !mod.isCapacitor + // return simulation.fpsCapDefault > 45 && tech.haveGunCheck("rail gun") && !tech.isSlowFPS && !tech.isCapacitor // }, // requires: "rail gun and FPS above 45", // effect() { - // mod.isRailTimeSlow = true; + // tech.isRailTimeSlow = true; // }, // remove() { - // mod.isRailTimeSlow = false; - // game.fpsCap = game.fpsCapDefault - // game.fpsInterval = 1000 / game.fpsCap; + // tech.isRailTimeSlow = false; + // simulation.fpsCap = simulation.fpsCapDefault + // simulation.fpsInterval = 1000 / simulation.fpsCap; // } // }, { @@ -2882,14 +2885,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("rail gun") + return tech.haveGunCheck("rail gun") }, requires: "rail gun", effect() { - mod.isRailEnergyGain = true; + tech.isRailEnergyGain = true; }, remove() { - mod.isRailEnergyGain = false; + tech.isRailEnergyGain = false; } }, { @@ -2899,14 +2902,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("rail gun") + return tech.haveGunCheck("rail gun") }, requires: "rail gun", effect() { - mod.isRailAreaDamage = true; + tech.isRailAreaDamage = true; }, remove() { - mod.isRailAreaDamage = false; + tech.isRailAreaDamage = false; } }, { @@ -2916,14 +2919,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("rail gun") + return tech.haveGunCheck("rail gun") }, requires: "rail gun", effect() { - mod.isCapacitor = true; + tech.isCapacitor = true; }, remove() { - mod.isCapacitor = false; + tech.isCapacitor = false; } }, { @@ -2933,14 +2936,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("laser") || mod.laserBotCount > 1 + return tech.haveGunCheck("laser") || tech.laserBotCount > 1 }, requires: "laser", effect() { - mod.isLaserDiode = 0.63; //100%-37% + tech.isLaserDiode = 0.63; //100%-37% }, remove() { - mod.isLaserDiode = 1; + tech.isLaserDiode = 1; } }, { @@ -2950,18 +2953,18 @@ const mod = { maxCount: 9, count: 0, allowed() { - return mod.haveGunCheck("laser") && !mod.isWideLaser && !mod.isPulseLaser && !mod.historyLaser + return tech.haveGunCheck("laser") && !tech.isWideLaser && !tech.isPulseLaser && !tech.historyLaser }, requires: "laser, not wide beam", effect() { - mod.laserReflections++; - mod.laserDamage += 0.08; //base is 0.12 - mod.laserFieldDrain += 0.0008 //base is 0.002 + tech.laserReflections++; + tech.laserDamage += 0.08; //base is 0.12 + tech.laserFieldDrain += 0.0008 //base is 0.002 }, remove() { - mod.laserReflections = 2; - mod.laserDamage = 0.16; - mod.laserFieldDrain = 0.0016; + tech.laserReflections = 2; + tech.laserDamage = 0.16; + tech.laserFieldDrain = 0.0016; } }, { @@ -2971,17 +2974,17 @@ const mod = { maxCount: 9, count: 0, allowed() { - return mod.haveGunCheck("laser") && !mod.isWideLaser && !mod.isPulseAim && !mod.historyLaser + return tech.haveGunCheck("laser") && !tech.isWideLaser && !tech.isPulseAim && !tech.historyLaser }, requires: "laser, not specular reflection", effect() { - mod.beamSplitter++ + tech.beamSplitter++ for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() } }, remove() { - mod.beamSplitter = 0 + tech.beamSplitter = 0 for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() } @@ -2994,19 +2997,19 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("laser") && mod.laserReflections < 3 && !mod.beamSplitter && !mod.isPulseLaser + return tech.haveGunCheck("laser") && tech.laserReflections < 3 && !tech.beamSplitter && !tech.isPulseLaser }, requires: "laser, not specular reflection
not diffraction grating", effect() { - if (mod.wideLaser === 0) mod.wideLaser = 3 - mod.isWideLaser = true; + if (tech.wideLaser === 0) tech.wideLaser = 3 + tech.isWideLaser = true; for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() } }, remove() { - mod.wideLaser = 0 - mod.isWideLaser = false; + tech.wideLaser = 0 + tech.isWideLaser = false; for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() } @@ -3019,20 +3022,20 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("laser") && mod.isWideLaser + return tech.haveGunCheck("laser") && tech.isWideLaser }, requires: "laser, not specular reflection
not diffraction grating", effect() { - mod.wideLaser = 4 + tech.wideLaser = 4 for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() } }, remove() { - if (mod.isWideLaser) { - mod.wideLaser = 3 + if (tech.isWideLaser) { + tech.wideLaser = 3 } else { - mod.wideLaser = 0 + tech.wideLaser = 0 } for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() @@ -3046,19 +3049,19 @@ const mod = { maxCount: 9, count: 0, allowed() { - return mod.haveGunCheck("laser") && mod.laserReflections < 3 && !mod.beamSplitter && !mod.isPulseLaser + return tech.haveGunCheck("laser") && tech.laserReflections < 3 && !tech.beamSplitter && !tech.isPulseLaser }, requires: "laser, not specular reflection
not diffraction grating", effect() { this.description = `add 10 more laser beams into into your past` - mod.historyLaser++ + tech.historyLaser++ for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() } }, remove() { this.description = "laser beam is spread into your recent past
increase total laser damage by 200%" - mod.historyLaser = 0 + tech.historyLaser = 0 for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() } @@ -3071,17 +3074,17 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.haveGunCheck("laser") && mod.laserReflections < 3 && !mod.isWideLaser && !mod.historyLaser + return tech.haveGunCheck("laser") && tech.laserReflections < 3 && !tech.isWideLaser && !tech.historyLaser }, requires: "laser, not specular reflection, not diffuse", effect() { - mod.isPulseLaser = true; + tech.isPulseLaser = true; for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() } }, remove() { - mod.isPulseLaser = false; + tech.isPulseLaser = false; for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod() } @@ -3094,14 +3097,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isPulseLaser + return tech.isPulseLaser }, requires: "pulse", effect() { - mod.isPulseStun = true; + tech.isPulseStun = true; }, remove() { - mod.isPulseStun = false; + tech.isPulseStun = false; } }, { @@ -3111,19 +3114,19 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isPulseLaser && !mod.beamSplitter + return tech.isPulseLaser && !tech.beamSplitter }, requires: "pulse", effect() { - mod.isPulseAim = true; + tech.isPulseAim = true; }, remove() { - mod.isPulseAim = false; + tech.isPulseAim = false; } }, //************************************************** //************************************************** field - //************************************************** mods + //************************************************** tech //************************************************** { name: "bremsstrahlung radiation", @@ -3136,10 +3139,10 @@ const mod = { }, requires: "standing wave harmonics", effect() { - mod.blockDmg += 0.75 //if you change this value also update the for loop in the electricity graphics in mech.pushMass + tech.blockDmg += 0.75 //if you change this value also update the for loop in the electricity graphics in mech.pushMass }, remove() { - mod.blockDmg = 0; + tech.blockDmg = 0; } }, { @@ -3172,10 +3175,10 @@ const mod = { }, requires: "perfect diamagnetism", effect() { - mod.isStunField += 60; + tech.isStunField += 60; }, remove() { - mod.isStunField = 0; + tech.isStunField = 0; } }, { @@ -3189,10 +3192,10 @@ const mod = { }, requires: "perfect diamagnetism", effect() { - mod.isPerfectBrake = true; + tech.isPerfectBrake = true; }, remove() { - mod.isPerfectBrake = false; + tech.isPerfectBrake = false; } }, { @@ -3202,14 +3205,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mod.isStunField || mod.oneSuperBall || mod.isCloakStun || mod.orbitBotCount > 1 || mod.isPerpetualStun + return tech.isStunField || tech.oneSuperBall || tech.isCloakStun || tech.orbitBotCount > 1 || tech.isPerpetualStun }, requires: "a stun effect", effect() { - mod.isCrit = true; + tech.isCrit = true; }, remove() { - mod.isCrit = false; + tech.isCrit = false; } }, { @@ -3223,11 +3226,11 @@ const mod = { }, requires: "nano-scale manufacturing", effect: () => { - mod.isMassEnergy = true // used in mech.grabPowerUp + tech.isMassEnergy = true // used in mech.grabPowerUp mech.energy += 3 }, remove() { - mod.isMassEnergy = false; + tech.isMassEnergy = false; } }, { @@ -3259,51 +3262,51 @@ const mod = { isNonRefundable: true, isCustomHide: true, allowed() { - return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isNailBotUpgrade && mod.isFoamBotUpgrade && mod.isBoomBotUpgrade && mod.isLaserBotUpgrade && mod.isOrbitBotUpgrade) + return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(tech.isNailBotUpgrade && tech.isFoamBotUpgrade && tech.isBoomBotUpgrade && tech.isLaserBotUpgrade && tech.isOrbitBotUpgrade) }, requires: "nano-scale manufacturing", effect: () => { mech.energy = 0.01; //fill array of available bots const notUpgradedBots = [] - if (!mod.isNailBotUpgrade) notUpgradedBots.push(() => { - mod.giveMod("nail-bot upgrade") - mod.setModToNonRefundable("nail-bot upgrade") + if (!tech.isNailBotUpgrade) notUpgradedBots.push(() => { + tech.giveMod("nail-bot upgrade") + tech.setModToNonRefundable("nail-bot upgrade") for (let i = 0; i < 2; i++) { b.nailBot() - mod.nailBotCount++; + tech.nailBotCount++; } }) - if (!mod.isFoamBotUpgrade) notUpgradedBots.push(() => { - mod.giveMod("foam-bot upgrade") - mod.setModToNonRefundable("foam-bot upgrade") + if (!tech.isFoamBotUpgrade) notUpgradedBots.push(() => { + tech.giveMod("foam-bot upgrade") + tech.setModToNonRefundable("foam-bot upgrade") for (let i = 0; i < 2; i++) { b.foamBot() - mod.foamBotCount++; + tech.foamBotCount++; } }) - if (!mod.isBoomBotUpgrade) notUpgradedBots.push(() => { - mod.giveMod("boom-bot upgrade") - mod.setModToNonRefundable("boom-bot upgrade") + if (!tech.isBoomBotUpgrade) notUpgradedBots.push(() => { + tech.giveMod("boom-bot upgrade") + tech.setModToNonRefundable("boom-bot upgrade") for (let i = 0; i < 2; i++) { b.boomBot() - mod.boomBotCount++; + tech.boomBotCount++; } }) - if (!mod.isLaserBotUpgrade) notUpgradedBots.push(() => { - mod.giveMod("laser-bot upgrade") - mod.setModToNonRefundable("laser-bot upgrade") + if (!tech.isLaserBotUpgrade) notUpgradedBots.push(() => { + tech.giveMod("laser-bot upgrade") + tech.setModToNonRefundable("laser-bot upgrade") for (let i = 0; i < 2; i++) { b.laserBot() - mod.laserBotCount++; + tech.laserBotCount++; } }) - if (!mod.isOrbitBotUpgrade) notUpgradedBots.push(() => { - mod.giveMod("orbital-bot upgrade") - mod.setModToNonRefundable("orbital-bot upgrade") + if (!tech.isOrbitBotUpgrade) notUpgradedBots.push(() => { + tech.giveMod("orbital-bot upgrade") + tech.setModToNonRefundable("orbital-bot upgrade") for (let i = 0; i < 2; i++) { b.orbitBot() - mod.orbitBotCount++; + tech.orbitBotCount++; } }) //choose random function from the array and run it @@ -3318,14 +3321,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mech.maxEnergy > 0.99 && mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isMissileField || mod.isIceField || mod.isFastDrones || mod.isDroneGrab) + return mech.maxEnergy > 0.99 && mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(tech.isMissileField || tech.isIceField || tech.isFastDrones || tech.isDroneGrab) }, requires: "nano-scale manufacturing", effect() { - mod.isSporeField = true; + tech.isSporeField = true; }, remove() { - mod.isSporeField = false; + tech.isSporeField = false; } }, { @@ -3335,14 +3338,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mech.maxEnergy > 0.99 && mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isIceField || mod.isFastDrones || mod.isDroneGrab) + return mech.maxEnergy > 0.99 && mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(tech.isSporeField || tech.isIceField || tech.isFastDrones || tech.isDroneGrab) }, requires: "nano-scale manufacturing", effect() { - mod.isMissileField = true; + tech.isMissileField = true; }, remove() { - mod.isMissileField = false; + tech.isMissileField = false; } }, { @@ -3352,14 +3355,14 @@ const mod = { maxCount: 1, count: 0, allowed() { - return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isMissileField || mod.isFastDrones || mod.isDroneGrab) + return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(tech.isSporeField || tech.isMissileField || tech.isFastDrones || tech.isDroneGrab) }, requires: "nano-scale manufacturing", effect() { - mod.isIceField = true; + tech.isIceField = true; }, remove() { - mod.isIceField = false; + tech.isIceField = false; } }, { @@ -3373,10 +3376,10 @@ const mod = { }, requires: "negative mass field", effect() { - mod.isHarmReduce = true + tech.isHarmReduce = true }, remove() { - mod.isHarmReduce = false; + tech.isHarmReduce = false; } }, { @@ -3390,10 +3393,10 @@ const mod = { }, requires: "negative mass field", effect() { - mod.isAnnihilation = true + tech.isAnnihilation = true }, remove() { - mod.isAnnihilation = false; + tech.isAnnihilation = false; } }, { @@ -3407,10 +3410,10 @@ const mod = { }, requires: "pilot wave, negative mass field, time dilation field", effect() { - mod.isFreezeMobs = true + tech.isFreezeMobs = true }, remove() { - mod.isFreezeMobs = false + tech.isFreezeMobs = false } }, // { @@ -3420,14 +3423,14 @@ const mod = { // maxCount: 1, // count: 0, // allowed() { - // return mech.fieldUpgrades[mech.fieldMode].name === "plasma torch" && !mod.isEnergyHealth + // return mech.fieldUpgrades[mech.fieldMode].name === "plasma torch" && !tech.isEnergyHealth // }, // requires: "plasma torch, not mass-energy equivalence", // effect() { - // mod.isPlasmaRange += 0.27; + // tech.isPlasmaRange += 0.27; // }, // remove() { - // mod.isPlasmaRange = 1; + // tech.isPlasmaRange = 1; // } // }, { @@ -3441,10 +3444,10 @@ const mod = { }, requires: "plasma torch", effect() { - mod.isPlasmaRange += 0.27; + tech.isPlasmaRange += 0.27; }, remove() { - mod.isPlasmaRange = 1; + tech.isPlasmaRange = 1; } }, { @@ -3458,11 +3461,11 @@ const mod = { }, requires: "plasma torch", effect() { - mod.plasmaBotCount++; + tech.plasmaBotCount++; b.plasmaBot(); }, remove() { - mod.plasmaBotCount = 0; + tech.plasmaBotCount = 0; } }, { @@ -3476,10 +3479,10 @@ const mod = { }, requires: "plasma torch", effect() { - mod.isExtruder = true; + tech.isExtruder = true; }, remove() { - mod.isExtruder = false; + tech.isExtruder = false; } }, { @@ -3493,11 +3496,11 @@ const mod = { }, requires: "time dilation field", effect() { - mod.isTimeSkip = true; + tech.isTimeSkip = true; b.setFireCD(); }, remove() { - mod.isTimeSkip = false; + tech.isTimeSkip = false; b.setFireCD(); } }, @@ -3512,14 +3515,14 @@ const mod = { }, requires: "time dilation field", effect() { - mod.fastTime = 1.40; - mod.fastTimeJump = 1.11; + tech.fastTime = 1.40; + tech.fastTimeJump = 1.11; mech.setMovement(); b.setFireCD(); }, remove() { - mod.fastTime = 1; - mod.fastTimeJump = 1; + tech.fastTime = 1; + tech.fastTimeJump = 1; mech.setMovement(); b.setFireCD(); } @@ -3531,16 +3534,16 @@ const mod = { maxCount: 1, count: 0, allowed() { - return (mech.fieldUpgrades[mech.fieldMode].name === "time dilation field" || mech.fieldUpgrades[mech.fieldMode].name === "pilot wave") && mod.energyRegen !== 0; + return (mech.fieldUpgrades[mech.fieldMode].name === "time dilation field" || mech.fieldUpgrades[mech.fieldMode].name === "pilot wave") && tech.energyRegen !== 0; }, requires: "time dilation field", effect: () => { - mod.energyRegen = 0.004; - mech.fieldRegen = mod.energyRegen; + tech.energyRegen = 0.004; + mech.fieldRegen = tech.energyRegen; }, remove() { - mod.energyRegen = 0.001; - mech.fieldRegen = mod.energyRegen; + tech.energyRegen = 0.001; + mech.fieldRegen = tech.energyRegen; } }, { @@ -3554,10 +3557,10 @@ const mod = { }, requires: "metamaterial cloaking", effect() { - mod.isIntangible = true; + tech.isIntangible = true; }, remove() { - mod.isIntangible = false; + tech.isIntangible = false; } }, { @@ -3571,10 +3574,10 @@ const mod = { }, requires: "metamaterial cloaking", effect() { - mod.isCloakStun = true; + tech.isCloakStun = true; }, remove() { - mod.isCloakStun = false; + tech.isCloakStun = false; } }, { @@ -3588,11 +3591,11 @@ const mod = { }, requires: "metamaterial cloaking", effect() { - mod.aimDamage = 1.5 + tech.aimDamage = 1.5 b.setFireCD(); }, remove() { - mod.aimDamage = 1 + tech.aimDamage = 1 b.setFireCD(); } }, @@ -3607,10 +3610,10 @@ const mod = { }, requires: "wormhole", effect() { - mod.isWormholeDamage = true + tech.isWormholeDamage = true }, remove() { - mod.isWormholeDamage = false + tech.isWormholeDamage = false } }, { @@ -3624,10 +3627,10 @@ const mod = { }, requires: "wormhole", effect() { - mod.isWormholeEnergy = true + tech.isWormholeEnergy = true }, remove() { - mod.isWormholeEnergy = false + tech.isWormholeEnergy = false } }, { @@ -3641,10 +3644,10 @@ const mod = { }, requires: "wormhole", effect() { - mod.isWormSpores = true + tech.isWormSpores = true }, remove() { - mod.isWormSpores = false + tech.isWormSpores = false } }, { @@ -3658,12 +3661,12 @@ const mod = { }, requires: "wormhole", effect() { - mod.isWormBullets = true + tech.isWormBullets = true powerUps.spawn(mech.pos.x, mech.pos.y, "gun"); powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); }, remove() { - mod.isWormBullets = false + tech.isWormBullets = false } }, { @@ -3693,7 +3696,7 @@ const mod = { isNonRefundable: true, isCustomHide: true, allowed() { - return !mod.isEnergyNoAmmo + return !tech.isEnergyNoAmmo }, requires: "not exciton lattice", effect() { @@ -3712,7 +3715,7 @@ const mod = { isNonRefundable: true, isCustomHide: true, allowed() { - return !mod.isSuperDeterminism + return !tech.isSuperDeterminism }, requires: "not superdeterminism", effect() { @@ -3731,7 +3734,7 @@ const mod = { isNonRefundable: true, isCustomHide: true, allowed() { - return !mod.isSuperDeterminism + return !tech.isSuperDeterminism }, requires: "not superdeterminism", effect() { @@ -3748,7 +3751,7 @@ const mod = { isNonRefundable: true, isCustomHide: true, allowed() { - return !mod.isSuperDeterminism + return !tech.isSuperDeterminism }, requires: "not superdeterminism", effect() { @@ -3758,7 +3761,7 @@ const mod = { remove() {} }, ], - //variables use for gun mod upgrades + //variables use for gun tech upgrades fireRate: null, bulletSize: null, energySiphon: null, diff --git a/style.css b/style.css index 4b84895..0750829 100644 --- a/style.css +++ b/style.css @@ -42,6 +42,10 @@ a { color: #08c; } +em { + opacity: 0.7; +} + #splash { user-select: none; position: absolute; @@ -272,11 +276,11 @@ summary { background-color: hsl(218, 100%, 76%); } -.build-mod-selected { +.build-tech-selected { background-color: hsl(253, 100%, 84%); } -.build-mod-selected:hover { +.build-tech-selected:hover { background-color: hsl(253, 100%, 81%); } @@ -313,7 +317,7 @@ summary { width: 100%; height: 100%; display: none; - /* background-color also set in mass-energy mod */ + /* background-color also set in mass-energy tech */ background-color: #f67; opacity: 0; transition: opacity 1s; @@ -376,8 +380,9 @@ summary { left: 15px; z-index: 2; font-size: 23px; - color: #111; + color: #222; background-color: rgba(255, 255, 255, 0.4); + line-height: 120%; user-select: none; pointer-events: none; padding: 0px 5px 0px 5px; @@ -394,7 +399,7 @@ summary { color: #000; text-align: right; opacity: 0.7; - line-height: 140%; + /* line-height: 140%; */ background-color: rgba(190, 210, 245, 0.25); user-select: none; pointer-events: none; @@ -403,16 +408,16 @@ summary { /*border: 2px solid rgba(0, 0, 0, 0.4);*/ } -#mods { +#tech { position: absolute; top: 60px; right: 15px; z-index: 2; font-size: 20px; - color: #000; + color: #222; text-align: right; opacity: 0.35; - line-height: 140%; + line-height: 130%; background-color: rgba(255, 255, 255, 0.4); user-select: none; pointer-events: none; @@ -424,28 +429,67 @@ summary { #text-log { z-index: 2; position: absolute; - bottom: 20px; - left: 20px; + bottom: 10px; + left: 10px; padding: 10px; - border-radius: 10px; - line-height: 150%; - font-size: 1.25em; - color: #000; - background-color: rgba(255, 255, 255, 0.23); - opacity: 0; + border-radius: 4px; + line-height: 140%; + font-size: 1.15em; + color: #555; + background-color: rgba(255, 255, 255, 0.5); transition: opacity 0.5s; pointer-events: none; user-select: none; } -em { - opacity: 0.7; +/* color for in game console output */ + +.color-text { + color: #000; } -.mouse-icon { - margin-bottom: -20px; +.color-var { + color: hsl(253, 100%, 58%); } +.color-symbol { + color: hsl(290, 100%, 40%); +} + +.color-gun { + color: hsl(218, 100%, 58%); +} + +/* colors for pause, selection and custom */ + +/* #text-log { + z-index: 2; + position: absolute; + bottom: 4px; + left: 6px; + line-height: 130%; + font-size: 1.2em; + color: rgb(237, 15, 148); + transition: opacity 1s; + pointer-events: none; + user-select: none; +} + +.color-text { + color: rgb(0, 164, 164); +} + +.color-symbol { + color: #fff; +} + +.color-gun { + color: hsl(218, 100%, 70%); +} */ + + + + .color-f { color: #0ad; letter-spacing: 1px; @@ -565,7 +609,7 @@ em { margin-bottom: -15px; } -.circle-gun-mod { +.circle-gun-tech { box-shadow: 0 0 0 3px #025; } @@ -583,7 +627,7 @@ em { background: #0cf; } -.mod { +.tech { /* background: rgb(116, 102, 238); */ /* background: hsl(253, 57%, 52%); */ background: hsl(255, 100%, 71%); @@ -607,9 +651,7 @@ em { background: #f7b; } -.dice { - font-size: 45px; - vertical-align: -5px; +.reroll-select { float: right; } diff --git a/todo.txt b/todo.txt index 448008d..b35e05c 100644 --- a/todo.txt +++ b/todo.txt @@ -1,16 +1,17 @@ ******************************************************** NEXT PATCH ******************************************************** -added a crouch check to prevent move the head when it's already out of position -also using setPosition to move player head instead of translate - +updated in game console style and all messages to match real game commands +new names inline with lore, mod -> tech, game -> simulation + this is probably going to cause many minor bugs, so let me know what you find +new reroll display in power up selection + +tech: rocket-propelled now works with all grenade tech ******************************************************** BUGS ******************************************************** check for crouch after rewind CPT, tesseract -mod and mob are too similar - (always) make it so that when you are immune to harm you can either jump on mobs or you pass through them (always) is there a way to check if the player is stuck inside the map or block @@ -26,6 +27,7 @@ mod and mob are too similar this fix was added and it is working for some cases maybe move the fix to once a second? bug fix - rewrite crouch to not translate the player height, but instead switch between 2 sensors + 2nd bug fix, no reports so far! might be fixed! (intermittent, but almost every time) bug - capping the fps causes random slow downs, that can be fixed with pause @@ -37,8 +39,31 @@ mod and mob are too similar ******************************************************** TODO ******************************************************** +rename + health > integrity, unity + heal > also integrity, unity + level > world? + reroll > resample, reset, retry, remeasure + +in game console + make all commands actually work + input.key commands don't work + rewrite to not be a console command? + add commands + death, max health, max energy, rewind + +mechanic: use gun swap as an active ability for several mods + ideas? + trigger damage immunity for 3 seconds, but drain energy? + push away nearby mobs, but drain energy + produce ammo, but take 1 damage + + CPT gun seems a bit weak right now. How to buff the gun? +mod nail gun: slow and accurate +mod foam: fast and inaccurate + mob ability bombs/bullets that suck in player mod where you can't stop firing, how to code? @@ -193,6 +218,8 @@ field - one block orbits you, it can protect you a bit and do collision damage repeat map in vertical and horizontal space or at least vertical space camera looks strange when you teleport player with a high velocity +new status effect: weakness, mobs do 75% les damage + graphic indication? new status effect: fear - push mob away from player for a time @@ -387,40 +414,36 @@ AI doesn't know about: modern pop culture outside the lab -in game console - output all console.log code //find starter code for this at the end of index.js - style - make it look like a computer terminal - track multiple lines, like your vocoder program - messages about heal, ammo, mods, that just list internal computer code - example: a heal would be mech.health += 12 - mono space font - square edges - black text on bottom right with no background? - or white text, or yellow - message after selecting each new (mod / gun / field) - put messages in (mod / gun / field) method - at start of run - write custom dialogue for field / guns / mods used in last game - you'd have to store an array of guns/fields/mod used last game - n-gon escape simulation ${random seed} - say something about what mobs types are queued up, and level order - **all communication should be from scientists watching the simulation; the robot shouldn't talk** - talking about the robot, watching - trying to communicate with the robot? but how - lines: - I think it's planing to escape - Why is it attacking those shapes? - Are those shapes supposed to be us? +scientist console text: + 2 scientists (each one a different color text) + at the start of each level listen to text conversation from the two colors of text strings also + talking about the robot, watching + trying to communicate with the robot? but how + random lines: + say something about what mobs types are queued up, and level order + I think it's planing to escape + Why is it attacking those shapes? + Are those shapes supposed to be us? - -add an ending to the game - maybe the game ending should ask you to open the console and type in some commands like in the end of doki doki - mirror ending (if no cheats) - level after final boss battle is the intro level, but flipped left right, with a fake player - damage the fake player to end the game - message about go outside - no ending (if cheats) - game goes on forever - also game goes on if player attacks, the fake player - game never ends if you have used cheats \ No newline at end of file +ending outline + if no cheats + after final boss is cleared, player enters a level with no mobs + level maybe has some environmental damage, so player has an option to die at any time + player can see text output between two colors of text strings (scientists) + audio.ambient(current time and date)
"text" + player reads a conversation between the two colors of text + first time win on east or normal they talk about: + how many runs the player has done + they guess why + they reveal the player is running simulations, and it isn't real + they ask the player to communicate + jump twice if you understand + they ask the player to enter console commands + give ammo or mods or something + They tell the play a console command to permenantly enable custom and testing mode (in local storage) + players can use this command in the future to enable custom and testing without beating the game even if local storage is wiped + they then tell the player the command to increase the difficulty and the command to restart the game. + If you win on hard or why: + they give the player and option to exit the simulation and entre the real world + simulation.exit() + This wipes all local storage, and closes the browser tab