From 8dacb023c07b1bcdf4624c2f662235671c9fad1a Mon Sep 17 00:00:00 2001 From: landgreen Date: Sun, 28 Jul 2024 19:40:19 -0700 Subject: [PATCH] wikipedia JUNK: wikipedia - After you get a new tech you have 7 seconds to study before a quiz, 4 research if you aces the quiz. this code for this works 80% of the time every time renamed propagator->Verlet integration it's now a skin tech 1.6->3x damage slightly increased the time skip amount on some skins the feet will hang lower while player is in the air on some skins the upper legs are skinnier mouse over on orbs for tech, field, and gun has a tooltip with text added keyword CSS style for "bot" added an aura around powerUpBoss so you can kinda see it inside walls quenching just gives max health from over healing instead of damaging you first depolarization does 0.5->0.4x damage when on cooldown many-worlds spawns a tech and also 3 coupling at the start of each new level dynamic equilibrium does 1.15x more damage and only stacks to 9->3 orbital bots collide with a 1.2x larger range Zectron no longer drains energy when balls hit you, but the balls still stop supply chain just gives a gun and a flat 10 ammo polyurethane foam will only trigger up to 55 total foam per harpoon to prevent a huge number of foam bubbles causing lag no cap for super balls for now fixed bug with planned obsolescence + instant tech fixed bug with ice crystal nucleation applied science gives each gunTech with a short delay this helps with sorting and maybe other rare bugs fixed bug with delivery drones and path integration you can no longer deflect snakeBoss, but it moves a bit slower --- ...ropagator.webp => Verlet integration.webp} | Bin js/bullet.js | 38 +- js/engine.js | 2 +- js/index.js | 34 +- js/level.js | 260 ++++++----- js/lore.js | 30 +- js/mob.js | 4 +- js/player.js | 275 +++++++---- js/powerup.js | 73 +-- js/simulation.js | 10 +- js/spawn.js | 103 ++--- js/tech.js | 429 +++++++++++------- style.css | 73 +-- todo.txt | 52 ++- 14 files changed, 799 insertions(+), 584 deletions(-) rename img/{propagator.webp => Verlet integration.webp} (100%) diff --git a/img/propagator.webp b/img/Verlet integration.webp similarity index 100% rename from img/propagator.webp rename to img/Verlet integration.webp diff --git a/js/bullet.js b/js/bullet.js index d6c7c81..052abf1 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -94,7 +94,7 @@ const b = { } }, outOfAmmo() { //triggers after firing when you have NO ammo - simulation.makeTextLog(`${b.guns[b.activeGun].name}.ammo: 0`); + simulation.inGameConsole(`${b.guns[b.activeGun].name}.ammo: 0`); m.fireCDcycle = m.cycle + 30; //fire cooldown if (tech.isAmmoFromHealth) { const amount = 0.02 @@ -198,7 +198,7 @@ const b = { } if (gunTechPool.length) { const index = Math.floor(Math.random() * gunTechPool.length) - simulation.makeTextLog(`tech.giveTech("${tech.tech[gunTechPool[index]].name}")`) + simulation.inGameConsole(`tech.giveTech("${tech.tech[gunTechPool[index]].name}")`) tech.giveTech(gunTechPool[index]) // choose from the gun pool } else { tech.giveTech() //get normal tech if you can't find any gun tech @@ -1839,6 +1839,7 @@ const b = { minDmgSpeed: 4, lookFrequency: Math.floor(7 + Math.random() * 3), density: tech.harpoonDensity, //0.001 is normal for blocks, 0.004 is normal for harpoon, 0.004*6 when buffed + foamSpawned: 0, beforeDmg(who) { if (tech.isShieldPierce && who.isShielded) { //disable shields who.isShielded = false @@ -1861,11 +1862,12 @@ const b = { } } } - if (tech.isFoamBall) { - for (let i = 0, len = Math.min(30, 2 + 2 * Math.sqrt(this.mass)); i < len; i++) { - const radius = 5 + 8 * Math.random() + if (tech.isFoamBall && this.foamSpawned < 55) { + for (let i = 0, len = Math.min(30, 2 + 3 * Math.sqrt(this.mass)); i < len; i++) { + const radius = 5 + 9 * Math.random() const velocity = { x: Math.max(0.5, 2 - radius * 0.1), y: 0 } b.foam(this.position, Vector.rotate(velocity, 6.28 * Math.random()), radius) + this.foamSpawned++ } } if (tech.isHarpoonPowerUp && simulation.cycle - 480 < tech.harpoonPowerUpCycle) { @@ -3203,7 +3205,7 @@ const b = { bullet[bullet.length - 1].isMutualismActive = true } }, - delayDrones(where, droneCount = 1) { + delayDrones(where, droneCount = 1, deliveryCount = 0) { let respawnDrones = () => { if (droneCount > 0) { requestAnimationFrame(respawnDrones); @@ -3213,7 +3215,7 @@ const b = { b.droneRadioactive({ x: where.x + 50 * (Math.random() - 0.5), y: where.y + 50 * (Math.random() - 0.5) }, 0) } else { b.drone({ x: where.x + 50 * (Math.random() - 0.5), y: where.y + 50 * (Math.random() - 0.5) }, 0) - if (tech.isDroneGrab && deliveryCount > 0) { + if (tech.isDroneGrab && deliveryCount > 0) { // const who = bullet[bullet.length - 1] who.isImproved = true; const SCALE = 2.25 @@ -3747,7 +3749,7 @@ const b = { bullet[me] = Bodies.polygon(where.x, where.y, 12, radius, b.fireAttributes(dir, false)); Composite.add(engine.world, bullet[me]); //add bullet to world Matter.Body.setVelocity(bullet[me], velocity); - bullet[me].calcDensity = function () { return 0.0007 + 0.0007 * tech.isSuperHarm + 0.0004 * tech.isBulletTeleport } + bullet[me].calcDensity = function () { return 0.0007 + 0.0007 * tech.isSuperHarm + 0.0007 * tech.isBulletTeleport } Matter.Body.setDensity(bullet[me], bullet[me].calcDensity()); bullet[me].endCycle = simulation.cycle + Math.floor(270 + 90 * Math.random()); bullet[me].minDmgSpeed = 0; @@ -3760,15 +3762,15 @@ const b = { this.force.y += this.mass * gravity;; if (Matter.Query.collides(this, [player]).length) { this.endCycle = 0 - m.energy -= 0.04 - if (m.energy < 0) m.energy = 0 - simulation.drawList.push({ //add dmg to draw queue - x: this.position.x, - y: this.position.y, - radius: radius, - color: "#0ad", - time: 15 - }); + // m.energy -= 0.04 + // if (m.energy < 0) m.energy = 0 + // simulation.drawList.push({ //add dmg to draw queue + // x: this.position.x, + // y: this.position.y, + // radius: radius, + // color: "#0ad", + // time: 15 + // }); } } bullet[me].cycle = 0 @@ -5660,7 +5662,7 @@ const b = { phase: 2 * Math.PI * Math.random(), do() { if (!m.isCloak) { //if time dilation isn't active - const size = 33 + const size = 40 q = Matter.Query.region(mob, { min: { x: this.position.x - size, diff --git a/js/engine.js b/js/engine.js index c6ef3d9..59427d0 100644 --- a/js/engine.js +++ b/js/engine.js @@ -118,7 +118,7 @@ function collisionChecks(event) { if (tech.isCollisionRealitySwitch && m.alive) { m.switchWorlds() simulation.trails(90) - simulation.makeTextLog(`simulation.amplitude = ${Math.random()}`); + simulation.inGameConsole(`simulation.amplitude = ${Math.random()}`); } if (tech.isPiezo) m.energy += 20.48; if (tech.isCouplingNoHit && m.coupling > 0) { diff --git a/js/index.js b/js/index.js index 86003be..5275bee 100644 --- a/js/index.js +++ b/js/index.js @@ -13,7 +13,7 @@ Math.hash = s => { // document.getElementById("seed").placeholder = Math.initialSeed = Math.floor(Date.now() % 100000) //random every time: just the time in milliseconds UTC window.addEventListener('error', error => { - simulation.makeTextLog(`ERROR: ${error.message} ${error.filename}:${error.lineno}`) + simulation.inGameConsole(`ERROR: ${error.message} ${error.filename}:${error.lineno}`) }); document.getElementById("seed").placeholder = Math.initialSeed = String(Math.floor(Date.now() % 100000)) @@ -138,7 +138,7 @@ function beforeUnloadEventListener(event) { event.preventDefault(); if (tech.isExitPrompt) { tech.damage *= 1.25 - simulation.makeTextLog(`damage *= ${1.25}`) + simulation.inGameConsole(`damage *= ${1.25}`) if (Math.random() < 0.25) { removeEventListener('beforeunload', beforeUnloadEventListener); } @@ -456,15 +456,15 @@ const build = { generatePauseLeft() { //left side let botText = "" - if (tech.nailBotCount) botText += `
nail-bots ${tech.nailBotCount}` - if (tech.orbitBotCount) botText += `
orbital-bots ${tech.orbitBotCount}` - if (tech.boomBotCount) botText += `
boom-bots ${tech.boomBotCount}` - if (tech.laserBotCount) botText += `
laser-bots ${tech.laserBotCount}` - if (tech.foamBotCount) botText += `
foam-bots ${tech.foamBotCount}` - if (tech.soundBotCount) botText += `
sound-bots ${tech.soundBotCount}` - if (tech.dynamoBotCount) botText += `
dynamo-bots ${tech.dynamoBotCount}` - if (tech.plasmaBotCount) botText += `
plasma-bots ${tech.plasmaBotCount}` - if (tech.missileBotCount) botText += `
missile-bots ${tech.missileBotCount}` + if (tech.nailBotCount) botText += `
nail-bots ${tech.nailBotCount}` + if (tech.orbitBotCount) botText += `
orbital-bots ${tech.orbitBotCount}` + if (tech.boomBotCount) botText += `
boom-bots ${tech.boomBotCount}` + if (tech.laserBotCount) botText += `
laser-bots ${tech.laserBotCount}` + if (tech.foamBotCount) botText += `
foam-bots ${tech.foamBotCount}` + if (tech.soundBotCount) botText += `
sound-bots ${tech.soundBotCount}` + if (tech.dynamoBotCount) botText += `
dynamo-bots ${tech.dynamoBotCount}` + if (tech.plasmaBotCount) botText += `
plasma-bots ${tech.plasmaBotCount}` + if (tech.missileBotCount) botText += `
missile-bots ${tech.missileBotCount}` // ${b.activeGun === null || b.activeGun === undefined ? "undefined" : b.guns[b.activeGun].name} (${b.activeGun === null || b.activeGun === undefined ? "0" : b.guns[b.activeGun].ammo}) @@ -497,6 +497,7 @@ const build = { ${m.coupling ? `
` + m.couplingDescription(m.coupling) + ` from ${(m.coupling).toFixed(0)} ${powerUps.orb.coupling(1)}` : ""}
duplication ${(tech.duplicationChance() * 100).toFixed(0)}% JUNK ${(100 * tech.junkChance).toFixed(0)}% +${botText}

${level.levelAnnounce()} position (${player.position.x.toFixed(0)}, ${player.position.y.toFixed(0)}) @@ -504,7 +505,6 @@ ${m.coupling ? `
` + m.couplingDescription(m.c mouse (${simulation.mouseInGame.x.toFixed(0)}, ${simulation.mouseInGame.y.toFixed(0)})
cycles ${m.cycle} velocity (${player.velocity.x.toFixed(2)}, ${player.velocity.y.toFixed(2)}) -${botText}
mobs ${mob.length} (${spawn.pickList[0]}, ${spawn.pickList[0]}) blocks ${body.length}
bullets ${bullet.length} @@ -784,7 +784,7 @@ ${simulation.isCheating ? "

lore disabled" : ""}
-
       ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""} +
        ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""} ${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() : tech.tech[i].description}` }, gunTechText(i) { @@ -1100,7 +1100,7 @@ ${simulation.isCheating ? "

lore disabled" : ""} // url += `&level=${Math.abs(Number(document.getElementById("starting-level").value))}` // alert('n-gon build URL copied to clipboard.\nPaste into browser address bar.') } else { - simulation.makeTextLog("n-gon build URL copied to clipboard.
Paste into browser address bar.") + simulation.inGameConsole("n-gon build URL copied to clipboard.
Paste into browser address bar.") } console.log('n-gon build URL copied to clipboard.\nPaste into browser address bar.') console.log(url) @@ -1465,14 +1465,14 @@ window.addEventListener("keydown", function (event) { case input.key.testing: if (m.alive && localSettings.loreCount > 0 && !simulation.paused && !build.isExperimentSelection) { if (simulation.difficultyMode > 4) { - simulation.makeTextLog("testing mode disabled for this difficulty"); + simulation.inGameConsole("testing mode disabled for this difficulty"); break } if (simulation.testing) { simulation.testing = false; simulation.loop = simulation.normalLoop if (simulation.isConstructionMode) document.getElementById("construct").style.display = 'none' - simulation.makeTextLog("", 0); + simulation.inGameConsole("", 0); } else { simulation.testing = true; simulation.loop = simulation.testingLoop @@ -1480,7 +1480,7 @@ window.addEventListener("keydown", function (event) { if (simulation.isConstructionMode) { document.getElementById("construct").style.display = 'inline' } else { - simulation.makeTextLog( + simulation.inGameConsole( ` diff --git a/js/level.js b/js/level.js index 3c7c368..7a65370 100644 --- a/js/level.js +++ b/js/level.js @@ -28,7 +28,7 @@ const level = { // tech.tech[297].frequency = 100 // tech.addJunkTechToPool(0.5) // m.couplingChange(10) - // m.setField("plasma torch") //1 standing wave 2 perfect diamagnetism 3 negative mass 4 molecular assembler 5 plasma torch 6 time dilation 7 metamaterial cloaking 8 pilot wave 9 wormhole 10 grappling hook + // m.setField("grappling hook") //1 standing wave 2 perfect diamagnetism 3 negative mass 4 molecular assembler 5 plasma torch 6 time dilation 7 metamaterial cloaking 8 pilot wave 9 wormhole 10 grappling hook // m.energy = 0 // powerUps.research.count = 3 // tech.isHookWire = true @@ -37,34 +37,29 @@ const level = { // m.damage(0.1); // b.giveGuns("super balls") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser // b.giveGuns("shotgun") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser - // b.giveGuns("wave") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser - // b.giveGuns("wave") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser + // b.giveGuns("laser") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser // tech.laserColor = "#fff" // tech.laserColorAlpha = "rgba(255, 255, 255, 0.5)" // b.guns[8].ammo = 100000000 // requestAnimationFrame(() => { tech.giveTech("stimulated emission") }); // tech.giveTech("1st ionization energy") - // for (let i = 0; i < 1; ++i) tech.giveTech("booby trap") - // for (let i = 0; i < 1; ++i) tech.giveTech("obsolescence") - // for (let i = 0; i < 1; ++i) tech.giveTech("brainstorming") - // requestAnimationFrame(() => { for (let i = 0; i < 3; i++) tech.giveTech("mechatronics") }); - // requestAnimationFrame(() => { for (let i = 0; i < 1; i++) tech.giveTech("eternalism") }); - // for (let i = 0; i < 2; i++) tech.giveTech("technical debt") + // for (let i = 0; i < 1; ++i) tech.giveTech("emergence") + // for (let i = 0; i < 1; ++i) tech.giveTech("foam-bot") + // for (let i = 0; i < 1; ++i) tech.giveTech("Bitter electromagnet") + // requestAnimationFrame(() => { for (let i = 0; i < 1; i++) tech.giveTech("wikipedia") }); + // requestAnimationFrame(() => { for (let i = 0; i < 1; i++) tech.giveTech("field coupling") }); + // for (let i = 0; i < 1; i++) tech.giveTech("Verlet integration") // m.lastKillCycle = m.cycle - // for (let i = 0; i < 1; ++i) tech.giveTech("determinism") - // for (let i = 0; i < 3; i++) powerUps.directSpawn(450, -50, "tech"); + // for (let i = 0; i < 1; i++) powerUps.directSpawn(450, -50, "tech"); // for (let i = 0; i < 1; i++) powerUps.directSpawn(m.pos.x, m.pos.y - 50, "difficulty", false); // spawn.mapRect(575, -700, 25, 425); //block mob line of site on testing - // level.flocculation(); + // level.testing(); level[simulation.isTraining ? "walk" : "initial"]() //normal starting level ************************************************** - // for (let i = 0; i < 1; ++i) spawn.snakeBoss(1900, -500) - // for (let i = 0; i < 2; i++) spawn.ghoster(level.exit.x, level.exit.y) //ghosters need to spawn after the map loads - // simulation.isAutoZoom = false; //look in close - // simulation.zoomScale *= 0.5; - // simulation.setZoom(); + // for (let i = 0; i < 1; ++i) spawn.powerUpBoss(1900, -500) + // for (let i = 0; i < 3; i++) spawn.starter(1900, -500) //ghosters need to spawn after the map loads // for (let i = 0; i < 1; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "entanglement"); // for (let i = 0; i < 2; ++i) powerUps.directSpawn(m.pos.x + 450, m.pos.y + 50 * Math.random(), "boost"); @@ -103,7 +98,7 @@ const level = { } if (!simulation.isTraining) { document.title = "n-gon: " + level.levelAnnounce(); - simulation.makeTextLog(`level.onLevel = "${level.levels[level.onLevel]}"`); + simulation.inGameConsole(`level.onLevel = "${level.levels[level.onLevel]}"`); } simulation.setupCamera(player.position); simulation.setZoom(); @@ -151,13 +146,14 @@ const level = { } if (tech.isGunChoice && Number.isInteger(tech.buffedGun) && b.inventory.length) { var gun = b.guns[b.inventory[tech.buffedGun]].name - simulation.makeTextLog(`pigeonhole principle: ${(1.3 * Math.max(0, b.inventory.length)).toFixed(2)}xdamage for ${gun}`, 600); + simulation.inGameConsole(`pigeonhole principle: ${(1.3 * Math.max(0, b.inventory.length)).toFixed(2)}xdamage for ${gun}`, 600); } if (tech.isSwitchReality && level.levelsCleared !== 0) { - simulation.makeTextLog(`simulation.amplitude = ${Math.random()}`); + simulation.inGameConsole(`simulation.amplitude = ${Math.random()}`); m.switchWorlds() simulation.trails() - powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "tech", false); + powerUps.spawn(player.position.x + 50, player.position.y - Math.random() * 50, "tech", false); + powerUps.spawnDelay("coupling", 3); } if (tech.isHealLowHealth) { const len = tech.isEnergyHealth ? 5 * Math.max(0, m.maxEnergy - m.energy) : 5 * Math.max(0, m.maxHealth - m.health) @@ -169,22 +165,22 @@ const level = { const ammoPerOrb = b.guns[b.activeGun].ammoPack const a = Math.ceil(rate * b.guns[b.activeGun].ammo / ammoPerOrb) powerUps.spawnDelay("ammo", a, 4); - simulation.makeTextLog(`${(rate * 100).toFixed(0)}%interest on ammo= ${a > 20 ? a + powerUps.orb.ammo(1) : powerUps.orb.ammo(a)}`) + simulation.inGameConsole(`${(rate * 100).toFixed(0)}%interest on ammo= ${a > 20 ? a + powerUps.orb.ammo(1) : powerUps.orb.ammo(a)}`) } if (powerUps.research.count > 0) { const r = Math.ceil(rate * powerUps.research.count) - simulation.makeTextLog(`${(rate * 100).toFixed(0)}%interest on research= ${r > 20 ? r + powerUps.orb.research(1) : powerUps.orb.research(r)}`) + simulation.inGameConsole(`${(rate * 100).toFixed(0)}%interest on research= ${r > 20 ? r + powerUps.orb.research(1) : powerUps.orb.research(r)}`) powerUps.spawnDelay("research", r, 4); } if (m.coupling > 0) { const c = Math.ceil(rate * m.coupling) powerUps.spawnDelay("coupling", c, 4); - simulation.makeTextLog(`${(rate * 100).toFixed(0)}%interest on coupling= ${c > 20 ? c + powerUps.orb.coupling(1) : powerUps.orb.coupling(c)}`) + simulation.inGameConsole(`${(rate * 100).toFixed(0)}%interest on coupling= ${c > 20 ? c + powerUps.orb.coupling(1) : powerUps.orb.coupling(c)}`) } const healPerOrb = (powerUps.heal.size() / 40 / (simulation.healScale ** 0.25)) ** 2 const h = Math.ceil(rate * m.health / healPerOrb) powerUps.spawnDelay("heal", h, 4); - simulation.makeTextLog(`${(rate * 100).toFixed(0)}%interest on health= ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`) + simulation.inGameConsole(`${(rate * 100).toFixed(0)}%interest on health= ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`) // trying to spawn smaller heals // const healPerOrb = (powerUps.heal.size() / 40 / (simulation.healScale ** 0.25)) ** 2 @@ -194,18 +190,20 @@ const level = { // const overHeal = h - Math.floor(h) // powerUps.spawn(m.pos.x, m.pos.y, "heal", true, null, Math.max(0.25, overHeal) * 40 * (simulation.healScale ** 0.25)) // if (h > healPerOrb) powerUps.spawnDelay("heal", h); - // simulation.makeTextLog(`${(Math.ceil(tech.interestRate * 100)).toFixed(0)}%interest on health= ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`) + // simulation.inGameConsole(`${(Math.ceil(tech.interestRate * 100)).toFixed(0)}%interest on health= ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`) } - if (tech.ejectOld > 0) { + if (tech.isEjectOld) { let index = null //find oldest tech that you have for (let i = 0; i < tech.tech.length; i++) { - if (tech.tech[i].count > 0) index = i + if (tech.tech[i].count > 0 && !tech.tech[i].isInstant) { + index = i + } } + console.log(index) if (index) { //eject it const effect = Math.pow(1.1, tech.tech[index].count) - simulation.makeTextLog(`${(effect).toFixed(2)}xdamage//from obsolescence`, 360) + simulation.inGameConsole(`${(effect).toFixed(2)}xdamage//from obsolescence`, 360) tech.damage *= effect - tech.ejectOld *= effect powerUps.ejectTech(index) } } @@ -213,7 +211,7 @@ const level = { trainingText(say) { simulation.lastLogTime = 0; //clear previous messages simulation.isTextLogOpen = true - simulation.makeTextLog(`supervised.learning(${(Date.now() / 1000).toFixed(0)} s):
${say}
`, Infinity) + simulation.inGameConsole(`supervised.learning(${(Date.now() / 1000).toFixed(0)} s):
${say}
`, Infinity) simulation.isTextLogOpen = false }, trainingBackgroundColor: "#e1e1e1", @@ -279,8 +277,8 @@ const level = { } }, announceMobTypes() { - simulation.makeTextLog(`spawn.${spawn.pickList[0]}(x,y)`) - simulation.makeTextLog(`spawn.${spawn.pickList[1]}(x,y)`) + simulation.inGameConsole(`spawn.${spawn.pickList[0]}(x,y)`) + simulation.inGameConsole(`spawn.${spawn.pickList[1]}(x,y)`) }, disableExit: false, nextLevel() { @@ -443,7 +441,7 @@ const level = { if (index !== -1) { level.communityLevels.splice(index, 1); // console.log('removed level:', remove[i]) - requestAnimationFrame(() => { simulation.makeTextLog(`banned level: ${remove[i]}`); }); + requestAnimationFrame(() => { simulation.inGameConsole(`banned level: ${remove[i]}`); }); } } // console.log('community levels after', level.communityLevels) @@ -454,7 +452,7 @@ const level = { if (index !== -1) { level.playableLevels.splice(index, 1); // console.log('removed level:', remove[i]) - requestAnimationFrame(() => { simulation.makeTextLog(`banned level: ${remove[i]}`); }); + requestAnimationFrame(() => { simulation.inGameConsole(`banned level: ${remove[i]}`); }); } } // console.log('Landgreen levels after', level.playableLevels) @@ -628,7 +626,7 @@ const level = { let text = `

training

- Begin the guided tutorial that shows you how to use your ${powerUps.field.gun()} and ${powerUps.orb.gun()}. + Begin the guided tutorial that shows you how to use your ${powerUps.field()} and ${powerUps.orb.gun()}.

play

@@ -2531,8 +2529,8 @@ const level = { //bonus power ups for clearing runs in the last game if (!simulation.isCheating && localSettings.levelsClearedLastGame > 1) { for (let i = 0; i < localSettings.levelsClearedLastGame / 3; i++) powerUps.spawn(2095 + 2 * Math.random(), -1270 - 50 * i, "tech", false); //spawn a tech for levels cleared in last game - simulation.makeTextLog(`for (let i = 0; i < localSettings.levelsClearedLastGame / 3; i++)`); - simulation.makeTextLog(`{ powerUps.spawn(m.pos.x, m.pos.y, "tech") //simulation superposition}`); + simulation.inGameConsole(`for (let i = 0; i < localSettings.levelsClearedLastGame / 3; i++)`); + simulation.inGameConsole(`{ powerUps.spawn(m.pos.x, m.pos.y, "tech") //simulation superposition}`); localSettings.levelsClearedLastGame = 0 //after getting bonus power ups reset run history if (localSettings.isAllowed) localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage } @@ -2981,7 +2979,7 @@ const level = { if (gateButton.isUp) { gateButton.query(); if (!gateButton.isUp) { - simulation.makeTextLog(`station gate opened`, 360); + simulation.inGameConsole(`station gate opened`, 360); if (stationNumber > 0) { if (!isExitOpen && gatesOpenRight < stationNumber) level.newLevelOrPhase() //run some new level tech effects gatesOpenRight = stationNumber @@ -2993,7 +2991,7 @@ const level = { gatesOpenRight = stationNumber } if (Math.abs(stationNumber) > 0 && ((Math.abs(stationNumber) + 1) % stationList.length) === 0) { - simulation.makeTextLog(`level exit opened`, 360); + simulation.inGameConsole(`level exit opened`, 360); isExitOpen = true; } } @@ -8574,7 +8572,7 @@ const level = { }, stronghold() { // player made level by Francois 👑 from discord - simulation.makeTextLog(`stronghold by Francois`); + simulation.inGameConsole(`stronghold by Francois`); const boost1 = level.boost(1470, -250, 1080) const boost2 = level.boost(-370, 0, 800) @@ -8744,7 +8742,7 @@ const level = { powerUps.addResearchToLevel() //needs to run after mobs are spawned }, basement() { // player made level by Francois 👑 from discord - simulation.makeTextLog(`basement by Francois`); + simulation.inGameConsole(`basement by Francois`); let button, door, buttonDoor, buttonPlateformEnd, doorPlateform let isLevelReversed = Math.random(); if (isLevelReversed < 0.7) { @@ -9028,7 +9026,7 @@ const level = { powerUps.chooseRandomPowerUp(3100, 1630); }, // detours() { //by Francois from discord - // simulation.makeTextLog(`detours by Francois`); + // simulation.inGameConsole(`detours by Francois`); // level.setPosToSpawn(0, 0); //lower start // level.exit.y = 150; // spawn.mapRect(level.enter.x, 45, 100, 20); @@ -9341,7 +9339,7 @@ const level = { // } // }, house() { //by Francois from discord - simulation.makeTextLog(`house by Francois`); + simulation.inGameConsole(`house by Francois`); const rotor = level.rotor(4251, -325, 120, 20, 200, 0, 0.01, 0, -0.0001); const hazard = level.hazard(4350, -1000, 300, 110); const doorBedroom = level.door(1152, -1150, 25, 250, 250); @@ -9817,7 +9815,7 @@ const level = { } }, perplex() { //by Oranger from discord - simulation.makeTextLog(`perplex by Oranger`); + simulation.inGameConsole(`perplex by Oranger`); document.body.style.backgroundColor = "#dcdcde"; level.setPosToSpawn(-600, 400); spawn.mapRect(level.enter.x, level.enter.y + 20, 100, 20); @@ -10003,7 +10001,7 @@ const level = { spawn.secondaryBossChance(7725, 2275) }, coliseum() { - simulation.makeTextLog(`coliseum by iNoobBoi`); + simulation.inGameConsole(`coliseum by iNoobBoi`); level.custom = () => { level.exit.drawAndCheck(); @@ -10154,7 +10152,7 @@ const level = { spawn.secondaryBossChance(6600, 600) }, crossfire() { - simulation.makeTextLog(`crossfire by iNoobBoi`); + simulation.inGameConsole(`crossfire by iNoobBoi`); //*1.5 //Level Setup @@ -10319,7 +10317,7 @@ const level = { spawn.debris(9300, -900, 400, debrisCount); }, vats() { // Made by Dablux#6610 on Discord - simulation.makeTextLog(`vats by Dablux`); + simulation.inGameConsole(`vats by Dablux`); simulation.zoomScale = 1500; level.setPosToSpawn(4400, -1060) @@ -10761,7 +10759,7 @@ const level = { } }, ngon() { //make by Oranger - simulation.makeTextLog(`"ngon" by Oranger`); + simulation.inGameConsole(`"ngon" by Oranger`); document.body.style.backgroundColor = "#dcdcde"; let needGravity = []; @@ -11166,7 +11164,7 @@ const level = { } }, tunnel() { // by Scarlettt - simulation.makeTextLog(`tunnel by Scarlettt`); + simulation.inGameConsole(`tunnel by Scarlettt`); level.custom = () => { level.exit.drawAndCheck(); @@ -11640,7 +11638,7 @@ const level = { } }, run() { - simulation.makeTextLog(`run by iNoobBoi`); + simulation.inGameConsole(`run by iNoobBoi`); addPartToMap = (len) => { //adds new map elements to the level while the level is already running //don't forget to run simulation.draw.setPaths() after you all the the elements so they show up visually map[len].collisionFilter.category = cat.map; @@ -11689,14 +11687,14 @@ const level = { addPartToMap(map.length - 1); simulation.draw.setPaths(); - simulation.makeTextLog(`UNKNOWN: "Well done. Now climb."`, 600); - simulation.makeTextLog(`UNKNOWN: "I left a gift at the top."`, 600); + simulation.inGameConsole(`UNKNOWN: "Well done. Now climb."`, 600); + simulation.inGameConsole(`UNKNOWN: "I left a gift at the top."`, 600); climbTime = true; } //toggles on a mapRect when player passes a certain area if (m.pos.x > 9000 && endTime === false) { - simulation.makeTextLog("UNKNOWN: \"Good luck. I hope you get out of here.\"", 600); + simulation.inGameConsole("UNKNOWN: \"Good luck. I hope you get out of here.\"", 600); endTime = true; } @@ -11877,11 +11875,11 @@ const level = { //Mob Spawning setTimeout(() => { - simulation.makeTextLog("UNKNOWN: \"You cannot kill them.\"", 600); + simulation.inGameConsole("UNKNOWN: \"You cannot kill them.\"", 600); }, 2000); setTimeout(() => { - simulation.makeTextLog("UNKNOWN: \"But I have slowed them down for you.\"", 600); + simulation.inGameConsole("UNKNOWN: \"But I have slowed them down for you.\"", 600); }, 6000); @@ -11897,7 +11895,7 @@ const level = { spawn[runMobList[Math.floor(Math.random() * runMobList.length)]](6600, -1000); setTimeout(() => { - simulation.makeTextLog("UNKNOWN: \"Run.\"", 600); + simulation.inGameConsole("UNKNOWN: \"Run.\"", 600); }, 10000); } //some of the mobs if (simulation.difficulty > 20) { @@ -11907,7 +11905,7 @@ const level = { spawn[runMobList[Math.floor(Math.random() * runMobList.length)]](7400, -800); setTimeout(() => { - simulation.makeTextLog("UNKNOWN: \"RUN!\"", 600); + simulation.inGameConsole("UNKNOWN: \"RUN!\"", 600); }, 11000); } //most of the mobs if (simulation.difficulty > 30) { @@ -11917,7 +11915,7 @@ const level = { spawn[runMobList[Math.floor(Math.random() * runMobList.length)]](7500, -300); setTimeout(() => { - simulation.makeTextLog("UNKNOWN: \"GET OUT OF HERE.\"", 600); + simulation.inGameConsole("UNKNOWN: \"GET OUT OF HERE.\"", 600); }, 12000); } //all the mobs @@ -11926,7 +11924,7 @@ const level = { spawn.randomLevelBoss(-2200, -700, ["powerUpBossBaby", "blockBoss", "revolutionBoss"]); setTimeout(() => { - simulation.makeTextLog("UNKNOWN: \"They are coming for you.\"", 600); + simulation.inGameConsole("UNKNOWN: \"They are coming for you.\"", 600); }, 14000); } anotherBoss(-1800, -700); //custom second boss spawn @@ -11982,7 +11980,7 @@ const level = { } }, islands() { - simulation.makeTextLog(`islands by Richard0820`); + simulation.inGameConsole(`islands by Richard0820`); const boost1 = level.boost(58500, -18264, 1300); let portal2, portal3; @@ -12327,7 +12325,7 @@ const level = { powerUps.spawn(3000, -230, "heal"); }, temple() { - simulation.makeTextLog(`temple by Scar1337`); + simulation.inGameConsole(`temple by Scar1337`); const V = Vector; const Equation = (function () { @@ -13489,7 +13487,7 @@ const level = { if (!isInBounds) { m.damage(0.1 * simulation.difficultyMode); trapPlayer(level.enter.x, level.enter.y); - simulation.makeTextLog("" + name + ":   You thought I could let you get away with that?"); + simulation.inGameConsole("" + name + ":   You thought I could let you get away with that?"); } }, room0() { @@ -13895,7 +13893,7 @@ const level = { setPos(a, b); freeze(a); }; - const makeLore = (x, t) => simulation.makeTextLog(`

${name}:

 

${x}

`, t); + const makeLore = (x, t) => simulation.inGameConsole(`

${name}:

 

${x}

`, t); level.custom = () => { // All the logic gets handled here. How nice! for (const i in LogicHandler) { @@ -13924,7 +13922,7 @@ const level = { }; }, dripp() { - simulation.makeTextLog(`dripp by M. B.`); + simulation.inGameConsole(`dripp by M. B.`); const door = level.door(780, -350, 15, 400, 265); const buttonDoor = level.button(420, -10); @@ -14119,7 +14117,7 @@ const level = { }, biohazard() { // MAP BY INOOBBOI AND THESHWARMA - simulation.makeTextLog(`biohazard by INOOBBOI and THESHWARMA`); + simulation.inGameConsole(`biohazard by INOOBBOI and THESHWARMA`); // set here for the cutscene later level.setPosToSpawn(-2800, -150) @@ -15266,7 +15264,7 @@ const level = { anotherBoss(0, 0) //will only spawn historyBoss if there is an additional boss }, stereoMadness() { - simulation.makeTextLog(`stereoMadness by Richard0820`); + simulation.inGameConsole(`stereoMadness by Richard0820`); let totalCoin = 0; const hunter = function (x, y, radius = 30) { //doesn't stop chasing until past 105000 mobs.spawn(x, y, 6, radius, "black"); @@ -15280,7 +15278,7 @@ const level = { me.memory = Infinity; me.seeAtDistance2 = Infinity; Matter.Body.setDensity(me, 1) - simulation.makeTextLog(`Ω: Intruder Detected`); + simulation.inGameConsole(`Ω: Intruder Detected`); me.boost = 10; me.do = function () { if (me.boost == 1 && m.fieldMode == 3 || m.fieldMode == 9 && me.boost == 1) { @@ -15463,7 +15461,7 @@ const level = { innerBar.style.backgroundColor = m.eyeFillColor; } if (m.pos.x > 25360 && textlogOne == 0) { - simulation.makeTextLog(`
A stong force pushes you forward...
`) + simulation.inGameConsole(`
A stong force pushes you forward...
`) textlogOne++; } if (m.pos.x < -3000) { @@ -15473,12 +15471,12 @@ const level = { }); if (textlogTwo == 0) - simulation.makeTextLog(`
A strong force pushes you away...
`); + simulation.inGameConsole(`
A strong force pushes you away...
`); textlogTwo++; } if (m.pos.y > 1055) { Matter.Body.setPosition(player, { x: 0, y: -150 }); - simulation.makeTextLog(`
There is nowhere to run...
`); + simulation.inGameConsole(`
There is nowhere to run...
`); m.damage(0.1 * simulation.difficultyMode); } if (m.alive == false && barThere == true) { @@ -16080,7 +16078,7 @@ const level = { } document.body.style.transitionDuration = "0ms"; document.body.style.backgroundColor = "#696969"; - simulation.makeTextLog(`
You have earned: ` + Math.min(3, totalCoin) + ` tech
`) + simulation.inGameConsole(`
You have earned: ` + Math.min(3, totalCoin) + ` tech
`) if (barThere == true) { //only runs once document.body.removeChild(bar); for (let i = 0, len = Math.min(3, totalCoin); i < len; i++) powerUps.directSpawn(player.position.x, player.position.y, "tech"); @@ -16846,7 +16844,7 @@ const level = { hunter(0, -1000) }, yingYang() { - simulation.makeTextLog(`yingYang by Richard0820`); + simulation.inGameConsole(`yingYang by Richard0820`); let destroyed = false; const lock = level.door(425, -1400, 50, 300, 300); @@ -17198,7 +17196,7 @@ const level = { powerUps.addResearchToLevel() }, staircase() { - simulation.makeTextLog(`staircase by ryanbear`); + simulation.inGameConsole(`staircase by ryanbear`); level.custom = () => { level.exit.drawAndCheck(); @@ -17286,7 +17284,7 @@ const level = { powerUps.addResearchToLevel() //needs to run after mobs are spawned }, fortress() { - simulation.makeTextLog(`fortress by Desboot`); + simulation.inGameConsole(`fortress by Desboot`); const boost1 = level.boost(3600, -250, 1000) const boost2 = level.boost(60, -604, 1000) const boost3 = level.boost(2160, -1260, 1000) @@ -17427,7 +17425,7 @@ const level = { powerUps.addResearchToLevel() //needs to run after mobs are spawned }, commandeer() { - simulation.makeTextLog(`commandeer by Desboot`); + simulation.inGameConsole(`commandeer by Desboot`); let waterFallWidth = 400 let waterFallX = 15900 @@ -18030,7 +18028,7 @@ const level = { powerUps.addResearchToLevel() //needs to run after mobs are spawned }, clock() { - simulation.makeTextLog(`clock by Cornbread 2100`); + simulation.inGameConsole(`clock by Cornbread 2100`); function drawBackgroundGear(x, y, r1, r2, rot, color, speed, numTeeth = 5, toothWidth = 75, linew = 2) { var vertices = getGearVertices(x, y, r1, r2, numTeeth, simulation.cycle * speed + rot, toothWidth / 100); @@ -19768,7 +19766,7 @@ const level = { } }, buttonbutton() { - simulation.makeTextLog(`buttonbutton by ||Destabilized E||`); + simulation.inGameConsole(`buttonbutton by ||Destabilized E||`); const mover = level.mover(1425, -1949, 600, 25); //x,y,width.height,VxGoal,force let portal @@ -19875,7 +19873,7 @@ const level = { spawn.randomLevelBoss(1840, 675) }, movers() { - simulation.makeTextLog(`movers by ryanbear`); + simulation.inGameConsole(`movers by ryanbear`); level.custom = () => { level.exit.drawAndCheck(); level.enter.draw(); @@ -20028,7 +20026,7 @@ const level = { powerUps.addResearchToLevel() //needs to run after mobs are spawned }, downpour() { - simulation.makeTextLog(`Downpour by DesBoot`); + simulation.inGameConsole(`Downpour by DesBoot`); let mobsspawned = 0 const laser = level.hazard(7492, -2612, 10, 500, 0.3) //laserintro @@ -20063,7 +20061,7 @@ const level = { // color.map = "#444" //custom map color - //simulation.makeTextLog(stopcycle) + //simulation.inGameConsole(stopcycle) level.custom = () => { do { @@ -20090,17 +20088,17 @@ const level = { // } // if (rainCount > 12) { // rainCount = 1 - // simulation.makeTextLog(rainCount) + // simulation.inGameConsole(rainCount) // } else { // rainCount = rainCount + 1 - // simulation.makeTextLog(rainCount) + // simulation.inGameConsole(rainCount) // } } while (Math.random() < 0.8); - //simulation.makeTextLog(stopcycle) - //simulation.makeTextLog(m.cycle) + //simulation.inGameConsole(stopcycle) + //simulation.inGameConsole(m.cycle) // ctx.fillStyle = "rgba(228,255,0,0.8)" - // //simulation.makeTextLog(stopcycle) + // //simulation.inGameConsole(stopcycle) // ctx.fillRect(50.4, -1210.0, 100, 100) // stopcycle = m.cycle + Math.random * 600; //stopcycle = m.cycles + Math.random * 600 @@ -22895,7 +22893,7 @@ const level = { Object.assign(spawn, obj); //ez }, superNgonBros() { - simulation.makeTextLog(`Super N-gon Bros by DesBoot`); + simulation.inGameConsole(`Super N-gon Bros by DesBoot`); let bowserKilled = 0 let flagY = -750 @@ -23019,19 +23017,19 @@ const level = { me.onDeath = function () { if (Math.random() < 0.1) { spawn.randomSmallMob(me.position.x, me.position.y - 75); - simulation.makeTextLog('mob') + simulation.inGameConsole('mob') } else { if (Math.random() < 0.07) { powerUps.spawn(me.position.x, me.position.y + (75 * (player.velocity.y / Math.abs(player.velocity.y))), "tech", true); - simulation.makeTextLog('tech') + simulation.inGameConsole('tech') } else { if (Math.random() < 0.4) { powerUps.spawn(me.position.x, me.position.y + (75 * (player.velocity.y / Math.abs(player.velocity.y))), "heal", true); - simulation.makeTextLog('heal') + simulation.inGameConsole('heal') } else { //if (Math.random() < 0.8){ powerUps.spawn(me.position.x, me.position.y + (75 * (player.velocity.y / Math.abs(player.velocity.y))), "ammo", true); - simulation.makeTextLog('ammo') + simulation.inGameConsole('ammo') //} } } @@ -23079,7 +23077,7 @@ const level = { firstElevatorY -= 5 } - //simulation.makeTextLog(firstElevatorY) + //simulation.inGameConsole(firstElevatorY) elevator1.move(); elevator2.move(); if (player.position.x > 0 && player.position.y < -9000 && player.position.y > -10000) { @@ -23095,7 +23093,7 @@ const level = { portal[3].query() portal2[2].query() portal2[3].query() - //simulation.makeTextLog(firstBlockBroken) + //simulation.inGameConsole(firstBlockBroken) level.exit.drawAndCheck(); if (player.position.x > 4100 && secondMobsReached == 0) { secondMobsSpawned = 1 @@ -23138,7 +23136,7 @@ const level = { level.enter.draw(); if (finalRoomReached == 0 && player.position.x > 21150) { finalRoomReached = 1 - simulation.makeTextLog('Thank you M, but our techs are in another castle!') + simulation.inGameConsole('Thank you M, but our techs are in another castle!') } //mobs if (firstMobsSpawned == 1 && firstMobsReached == 0) { @@ -23414,7 +23412,7 @@ const level = { powerUps.addResearchToLevel() //needs to run after mobs are spawned }, underpass() { - simulation.makeTextLog(`underpass by Richard0820`); + simulation.inGameConsole(`underpass by Richard0820`); let key = false; const door = level.door(2650, -825, 50, 250, 250, 10); @@ -26295,7 +26293,7 @@ const level = { }, cantilever() { // made by Eclipse#7932 on discord, (TheSpudguy)(@PurpleSunsetGames on github) // simulation.enableConstructMode(); - simulation.makeTextLog(`underpass by Eclipse#7932`); + simulation.inGameConsole(`underpass by Eclipse#7932`); level.setPosToSpawn(0, -50); //normal spawn level.exit.x = 5500; @@ -26358,7 +26356,7 @@ const level = { powerUps.addResearchToLevel(); //needs to run after mobs are spawned }, tlinat() { // _Destined_ formerly Richard0820#2652 - simulation.makeTextLog(`tlinat by Richard0820`); + simulation.inGameConsole(`tlinat by Richard0820`); simulation.fallHeight = 1 / 0, level.setPosToSpawn(0, -1e3), level.exit.x = 5100, level.exit.y = 3770, spawn.mapRect(level.enter.x, level.enter.y + 20, 100, 20), spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 20), level.defaultZoom = 3000, simulation.zoomTransition(level.defaultZoom), document.body.style.backgroundColor = "#d8dadf"; let e = 0, t = 0; @@ -26498,7 +26496,7 @@ const level = { n(o[l], e + 250 * l - Math.abs(1.5 * e), t) } } - simulation.makeTextLog(`
Look up
Walk right to tp to maze
Exit is at the bottom left`), Matter.Body.scale(player.parts[3], 2, 2), level.custom = () => { + simulation.inGameConsole(`
Look up
Walk right to tp to maze
Exit is at the bottom left`), Matter.Body.scale(player.parts[3], 2, 2), level.custom = () => { if (level.exit.drawAndCheck(), level.enter.draw(), player.position.y > 1e5 && Matter.Body.setPosition(player, { x: 5100, y: -5925 @@ -26508,7 +26506,7 @@ const level = { y: -5925 }), e++; for (let e = 0; e < map.length; e++) Math.random() < .75 && ghoster(map[e].position.x, map[e].position.y); - simulation.makeTextLog("Watch out for ghosters
Peace ✌️") + simulation.inGameConsole("Watch out for ghosters
Peace ✌️") } player.position.x > level.exit.x && player.position.x < level.exit.x + 100 && player.position.y > level.exit.y - 150 && player.position.y < level.exit.y - 0 && player.velocity.y < .15 && 0 == t && (t++, Matter.Body.scale(player.parts[3], .5, .5)) }, level.customTopLayer = () => { @@ -26581,7 +26579,7 @@ const level = { }, ruins() { // by SiddhUPe // simulation.enableConstructMode() - simulation.makeTextLog(`ruins by SiddhUPe`); + simulation.inGameConsole(`ruins by SiddhUPe`); level.setPosToSpawn(0, -50); //normal spawn level.exit.x = 19531; @@ -27662,7 +27660,7 @@ const level = { powerUps.addResearchToLevel() //needs to run after mobs are spawned }, ace() { - simulation.makeTextLog(`ace by Richard0820`); + simulation.inGameConsole(`ace by Richard0820`); let isDestroyed = false; const ace = { spawnOrbitals(who, radius, chance = Math.min(0.25 + simulation.difficulty * 0.005)) { @@ -28935,7 +28933,7 @@ const level = { } }, crimsonTowers() { - simulation.makeTextLog(`crimsonTowers by Richard0820. Thank you desboot for the video: Source`) + simulation.inGameConsole(`crimsonTowers by Richard0820. Thank you desboot for the video: Source`) const ace = { spawnOrbitals(who, radius, chance = Math.min(0.25 + simulation.difficulty * 0.005)) { if (Math.random() < chance) { @@ -30070,8 +30068,8 @@ const level = { level.exit.x = map[272].position.x; }, LaunchSite() { - simulation.makeTextLog(`Launch Site by Des Boot`); - simulation.makeTextLog(`The rain stopped...`); + simulation.inGameConsole(`Launch Site by Des Boot`); + simulation.inGameConsole(`The rain stopped...`); level.setPosToSpawn(0, -50); //normal spawn const elevatortoggle = level.toggle(13650, 3000) let newMobsSpawned = false; @@ -30486,7 +30484,7 @@ const level = { powerUps.addResearchToLevel() //needs to run after mobs are spawned }, shipwreck() { - simulation.makeTextLog(`shipwreck by 3xionDev`); + simulation.inGameConsole(`shipwreck by 3xionDev`); level.setPosToSpawn(0, -50); //normal spawn level.exit.x = 1500; level.exit.y = -1875; @@ -30800,7 +30798,7 @@ const level = { level.customTopLayer = () => { }; }, unchartedCave() { - simulation.makeTextLog(`unchartedCave by 3xionDev`); + simulation.inGameConsole(`unchartedCave by 3xionDev`); level.setPosToSpawn(0, -50); //normal spawn level.exit.x = 20985; level.exit.y = 2816; @@ -31211,7 +31209,7 @@ const level = { level.customTopLayer = () => { }; }, dojo() { // By weird_pusheen - simulation.makeTextLog(`dojo by werid_pusheen, fixed by Cornbread 2100`) + simulation.inGameConsole(`dojo by werid_pusheen, fixed by Cornbread 2100`) const vanishes = []; const smoofes = []; const leftRotor = level.rotor(-550, 900, 950, 25); @@ -31661,7 +31659,7 @@ const level = { powerUps.addResearchToLevel() //needs to run after mobs are spawned }, arena() { - simulation.makeTextLog(`arena by Whyisthisnotavalable`) + simulation.inGameConsole(`arena by Whyisthisnotavalable`) let genisis, genisisJumpSensor, genisisBody, genisisHead, genisisHeadSensor, genisisBodySensor; let control = { left: false, right: false, up: false, down: false }; const g = { @@ -32235,7 +32233,7 @@ const level = { if (tech.isCollisionRealitySwitch && g.alive) { g.switchWorlds() simulation.trails() - simulation.makeTextLog(`simulation.amplitude = ${Math.random()}`); + simulation.inGameConsole(`simulation.amplitude = ${Math.random()}`); } if (tech.isPiezo) g.energy += 20.48; if (tech.isCouplingNoHit && g.coupling > 0) { @@ -32706,10 +32704,10 @@ const level = { ); b.guns = gunArray; } else { - simulation.makeTextLog(`Thank you for using my sword mod
I'll save you the trouble of killing genisis
g.damage(Infinity)
`); + simulation.inGameConsole(`Thank you for using my sword mod
I'll save you the trouble of killing genisis
g.damage(Infinity)
`); g.damage(Infinity); } - simulation.makeTextLog(`arena by Richard0820`); + simulation.inGameConsole(`arena by Richard0820`); let index = 0; let index2 = 0; let { sword: sword, bladeSegments: bladeSegments } = createSword(); @@ -32898,7 +32896,7 @@ const level = { } } index2++; - setTimeout(() => { simulation.makeTextLog(`If you want to keep this sword, visit https://github.com/Whyisthisnotavalable/n-scythe. The sword is there.`) }, 1000) + setTimeout(() => { simulation.inGameConsole(`If you want to keep this sword, visit https://github.com/Whyisthisnotavalable/n-scythe. The sword is there.`) }, 1000) } for (let i = 0; i < bladeSegments.length; i++) { const blade = bladeSegments[i]; @@ -33464,9 +33462,9 @@ const level = { } }, soft() { - simulation.makeTextLog(``); - simulation.makeTextLog(`soft by Richard0820`); - simulation.makeTextLog("The lasers deal less damage the higher level you are") + simulation.inGameConsole(``); + simulation.inGameConsole(`soft by Richard0820`); + simulation.inGameConsole("The lasers deal less damage the higher level you are") const portals = []; portals.push(level.portal({ x: -1525, @@ -33943,7 +33941,7 @@ const level = { soft.annihilate(clothArray[0]); clothArray.splice(0, 1); }, 1000); //prevents bugs - simulation.makeTextLog("Couldn't be so simple, could it?", 2000 * Math.random()); + simulation.inGameConsole("Couldn't be so simple, could it?", 2000 * Math.random()); index1++; } }; @@ -34021,10 +34019,10 @@ const level = { }, flappyGon() { //community map by digin level.announceMobTypes(); - simulation.makeTextLog(`flappy n-gon by Digin`); - setTimeout(() => { simulation.makeTextLog("gravity is a choice"); }, 1000); - setTimeout(() => { simulation.makeTextLog("everyone will fly"); }, 2000); - setTimeout(() => { simulation.makeTextLog("jump from the post and find out"); }, 3000); + simulation.inGameConsole(`flappy n-gon by Digin`); + setTimeout(() => { simulation.inGameConsole("gravity is a choice"); }, 1000); + setTimeout(() => { simulation.inGameConsole("everyone will fly"); }, 2000); + setTimeout(() => { simulation.inGameConsole("jump from the post and find out"); }, 3000); level.setPosToSpawn(0, -50); //normal spawn level.exit.x = 8600; level.exit.y = -1100; @@ -34100,9 +34098,9 @@ const level = { }, rings() { level.announceMobTypes(); - simulation.makeTextLog(`rings by ThatLittleFrog`); + simulation.inGameConsole(`rings by ThatLittleFrog`); setTimeout(() => { - simulation.makeTextLog("go up"); + simulation.inGameConsole("go up"); }, 2000); level.setPosToSpawn(0, -2000); // spawn high up so you can go to the bottom of the lowest ring without tripping the too-low reset level.exit.x = 0; @@ -34213,7 +34211,7 @@ const level = { powerUps.addResearchToLevel(); }, trial() { // trial, collab between Cirryn and Tarantula Hawk - simulation.makeTextLog(`trial by Cirryn and Tarantula Hawk`); + simulation.inGameConsole(`trial by Cirryn and Tarantula Hawk`); level.setPosToSpawn(0, -50); level.exit.x = 4150; level.exit.y = -30; @@ -34324,40 +34322,40 @@ const level = { door.draw(); if (!button.isUp && !didTrialBegin) { didTrialBegin = true; - simulation.makeTextLog('The Trial has begun.'); + simulation.inGameConsole('The Trial has begun.'); setTimeout(() => { - simulation.makeTextLog('first wave (domitable)'); + simulation.inGameConsole('first wave (domitable)'); wave(randomWave(2 + simulation.difficulty * 0.1, spawn.fullPickList)); }, 3000); setTimeout(() => { - simulation.makeTextLog('second wave (domitable)'); + simulation.inGameConsole('second wave (domitable)'); wave(randomWave(2 + simulation.difficulty * 0.1, spawn.fullPickList)); }, 13000); setTimeout(() => { - simulation.makeTextLog('third wave (indomitable)'); + simulation.inGameConsole('third wave (indomitable)'); wave(randomWave(4, ["assassin"])); }, 23000); setTimeout(() => { - simulation.makeTextLog('fourth wave (domitable)'); + simulation.inGameConsole('fourth wave (domitable)'); wave(randomWave(4 + simulation.difficulty / 2, spawn.fullPickList)); }, 39000); setTimeout(() => { - simulation.makeTextLog('fifth wave (domitable)'); + simulation.inGameConsole('fifth wave (domitable)'); wave(randomWave(4 + simulation.difficulty / 2, spawn.fullPickList)); }, 49000); setTimeout(() => { - simulation.makeTextLog('sixth wave (indomitable)'); + simulation.inGameConsole('sixth wave (indomitable)'); wave(randomWave(7, ["mercenary"])); }, 59000); setTimeout(() => { - simulation.makeTextLog('seventh wave (boss)'); + simulation.inGameConsole('seventh wave (boss)'); spawn.randomLevelBoss(700, -1000); var mainBoss = mob[mob.length - 1]; mainBoss.oldOnDeath = mainBoss.onDeath; diff --git a/js/lore.js b/js/lore.js index 4a3ccb3..16bccb3 100644 --- a/js/lore.js +++ b/js/lore.js @@ -38,7 +38,7 @@ const lore = { if (localSettings.isAllowed) localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage document.getElementById("control-testing").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible" // document.getElementById("experiment-button").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible" - simulation.makeTextLog(`lore.unlockTesting()`, Infinity); + simulation.inGameConsole(`lore.unlockTesting()`, Infinity); sound.portamento(50) sound.portamento(83.333) @@ -48,7 +48,7 @@ const lore = { color: "#f20", voice: undefined, text: function (say) { - simulation.makeTextLog(`input.audio(${(Date.now() / 1000).toFixed(0)} s): "${say}"`, Infinity); + simulation.inGameConsole(`input.audio(${(Date.now() / 1000).toFixed(0)} s): "${say}"`, Infinity); lore.talkingColor = this.color const utterance = new SpeechSynthesisUtterance(say); utterance.lang = "en-AU" //"en-IN"; //de-DE en-GB fr-FR en-US en-AU @@ -61,7 +61,7 @@ const lore = { voice: undefined, text: function (say) { if (level.levels[level.onLevel] === undefined) { //only talk if on the lore level (which is undefined because it is popped out of the level.levels array) - simulation.makeTextLog(`input.audio(${(Date.now() / 1000).toFixed(0)} s): "${say}"`, Infinity); + simulation.inGameConsole(`input.audio(${(Date.now() / 1000).toFixed(0)} s): "${say}"`, Infinity); lore.talkingColor = this.color if (lore.isSpeech) { const utterance = new SpeechSynthesisUtterance(say); @@ -95,7 +95,7 @@ const lore = { color: "#f20", text: function (say) { if (level.levels[level.onLevel] === undefined) { //only talk if on the lore level (which is undefined because it is popped out of the level.levels array) - simulation.makeTextLog(`input.audio(${(Date.now() / 1000).toFixed(0)} s): "${say}"`, Infinity); + simulation.inGameConsole(`input.audio(${(Date.now() / 1000).toFixed(0)} s): "${say}"`, Infinity); lore.talkingColor = this.color if (lore.isSpeech) { utterance = new SpeechSynthesisUtterance(say); @@ -622,8 +622,8 @@ const lore = { console.log(`https://www.openstreetmap.org/#map=18/${latitude}/${longitude}`) console.log(`Latitude: ${latitude} °, Longitude: ${longitude} °`) lore.miriam.text("We tracked the location down to this Latitude and Longitude:") - simulation.makeTextLog(`Latitude: ${latitude} °, Longitude: ${longitude} °`, Infinity); - simulation.makeTextLog(`https://www.openstreetmap.org/#map=18/${latitude}/${longitude}`, Infinity); + simulation.inGameConsole(`Latitude: ${latitude} °, Longitude: ${longitude} °`, Infinity); + simulation.inGameConsole(`https://www.openstreetmap.org/#map=18/${latitude}/${longitude}`, Infinity); } function error() { @@ -769,13 +769,13 @@ const lore = { }, () => { lore.miriam.text("We can spawn power ups with this command:") - simulation.makeTextLog(`powerUps.spawn(player.position.x, player.position.y - 100, "heal")`, Infinity); + simulation.inGameConsole(`powerUps.spawn(player.position.x, player.position.y - 100, "heal")`, Infinity); powerUps.spawn(player.position.x, player.position.y - 100, "heal") }, () => { setTimeout(() => { lore.miriam.text("or we can make a bunch of them:") - simulation.makeTextLog(`for (let i = 0; i < 100; i++) powerUps.spawn(0, 500, "coupling")`, Infinity); + simulation.inGameConsole(`for (let i = 0; i < 100; i++) powerUps.spawn(0, 500, "coupling")`, Infinity); for (let i = 0; i < 100; i++) powerUps.spawn(5 - 10 * Math.random(), -500 * Math.random(), "coupling") }, 2000); }, @@ -798,9 +798,9 @@ const lore = { count++ if (mob.length === 0 || count > 3600 + 900 * mob.length) { lore.miriam.text("I'll spawn some more power ups for you.") - simulation.makeTextLog(`for (let i = 0; i < 6; i++) powerUps.spawn(player.position.x, player.position.y - 100, "heal")`, Infinity); + simulation.inGameConsole(`for (let i = 0; i < 6; i++) powerUps.spawn(player.position.x, player.position.y - 100, "heal")`, Infinity); for (let i = 0; i < 6; i++) powerUps.spawn(player.position.x, player.position.y - 100 - i * 20, "heal") - simulation.makeTextLog(`for (let i = 0; i < 10; i++) powerUps.spawn(player.position.x, player.position.y - 100, "ammo")`, Infinity); + simulation.inGameConsole(`for (let i = 0; i < 10; i++) powerUps.spawn(player.position.x, player.position.y - 100, "ammo")`, Infinity); for (let i = 0; i < 10; i++) powerUps.spawn(player.position.x, player.position.y - 100 - i * 20, "ammo") spawn.dragonFlyBoss(-1400, -300); spawn.dragonFlyBoss(1400, -300); @@ -820,9 +820,9 @@ const lore = { count++ if (mob.length === 0 || count > 3600 + 900 * mob.length) { lore.anand.text("DragonFlyBoss is my favorite.") - simulation.makeTextLog(`for (let i = 0; i < 6; i++) powerUps.spawn(player.position.x, player.position.y - 100, "heal")`, Infinity); + simulation.inGameConsole(`for (let i = 0; i < 6; i++) powerUps.spawn(player.position.x, player.position.y - 100, "heal")`, Infinity); for (let i = 0; i < 6; i++) powerUps.spawn(player.position.x, player.position.y - 100 - i * 20, "heal") - simulation.makeTextLog(`for (let i = 0; i < 10; i++) powerUps.spawn(player.position.x, player.position.y - 100, "ammo")`, Infinity); + simulation.inGameConsole(`for (let i = 0; i < 10; i++) powerUps.spawn(player.position.x, player.position.y - 100, "ammo")`, Infinity); for (let i = 0; i < 10; i++) powerUps.spawn(player.position.x, player.position.y - 100 - i * 20, "ammo") spawn.historyBoss(0, -400); spawn.powerUpBossBaby(-1500, -100); @@ -841,7 +841,7 @@ const lore = { count++ if (mob.length === 0 || count > 3600 + 900 * mob.length) { lore.miriam.text("Here are some extra tech.") - simulation.makeTextLog(`for (let i = 0; i < 6; i++) powerUps.spawn(player.position.x, player.position.y - 100, "tech")`, Infinity); + simulation.inGameConsole(`for (let i = 0; i < 6; i++) powerUps.spawn(player.position.x, player.position.y - 100, "tech")`, Infinity); for (let i = 0; i < 6; i++) powerUps.spawn(0, -200 - i * 40, "tech") spawn.historyBoss(0, -400); spawn.blinkBoss(-1400, -300); @@ -902,7 +902,7 @@ const lore = { x: 0, y: -500 }) - simulation.makeTextLog(`Matter.Body.setPosition(player, { x: 0, y: -500 })`, 180); + simulation.inGameConsole(`Matter.Body.setPosition(player, { x: 0, y: -500 })`, 180); }, 1500); } else if (m.alive) { @@ -1180,7 +1180,7 @@ const lore = { // return product_Range(r + 1, n) / product_Range(1, n - r); // } // } - // simulation.makeTextLog(`n = ${combinations(tech.tech.length + b.guns.length + m.fieldUpgrades.length, 50).toExponential(10)}`, Infinity); + // simulation.inGameConsole(`n = ${combinations(tech.tech.length + b.guns.length + m.fieldUpgrades.length, 50).toExponential(10)}`, Infinity); // lore.miriam.text(`There are roughly 5 times 10 to the 60 possible combinations. `) // }, // () => { lore.miriam.text("Even if each simulation took 1 nano-second,") }, diff --git a/js/mob.js b/js/mob.js index c8de2bb..1c0d185 100644 --- a/js/mob.js +++ b/js/mob.js @@ -1223,9 +1223,9 @@ const mobs = { }); } - if (tech.deathSkipTime && !m.isBodiesAsleep) { + if (tech.isVerlet && !m.isBodiesAsleep) { requestAnimationFrame(() => { - simulation.timePlayerSkip((this.isBoss ? 45 : 25) * tech.deathSkipTime) + simulation.timePlayerSkip(this.isBoss ? 60 : 30) simulation.loop(); //ending with a wipe and normal loop fixes some very minor graphical issues where things are draw in the wrong locations }); //wrapping in animation frame prevents errors, probably } diff --git a/js/player.js b/js/player.js index 7402cbb..f8f1b25 100644 --- a/js/player.js +++ b/js/player.js @@ -442,7 +442,7 @@ const m = { simulation.clearNow = true; //triggers a map reset m.switchWorlds() simulation.isTextLogOpen = true; - simulation.makeTextLog(`simulation.amplitude = 0.${len - i - 1}`, swapPeriod); + simulation.inGameConsole(`simulation.amplitude = 0.${len - i - 1}`, swapPeriod); simulation.isTextLogOpen = false; simulation.wipe = function () { //set wipe to have trails ctx.fillStyle = `rgba(255,255,255,${(i + 1) * (i + 1) * 0.006})`; @@ -455,7 +455,7 @@ const m = { ctx.clearRect(0, 0, canvas.width, canvas.height); } simulation.isTextLogOpen = true; - simulation.makeTextLog("simulation.amplitude = null"); + simulation.inGameConsole("simulation.amplitude = null"); tech.isImmortal = false //disable future immortality }, 6 * swapPeriod); } else if (m.alive) { //normal death code here @@ -537,7 +537,7 @@ const m = { setMaxHealth(isMessage) { m.maxHealth = m.baseHealth + tech.extraMaxHealth + 4 * tech.isFallingDamage document.getElementById("health-bg").style.width = `${Math.floor(300 * m.maxHealth)}px` - if (isMessage) simulation.makeTextLog(`m.maxHealth = ${m.maxHealth.toFixed(2)}`) + if (isMessage) simulation.inGameConsole(`m.maxHealth = ${m.maxHealth.toFixed(2)}`) if (m.health > m.maxHealth) m.health = m.maxHealth; m.displayHealth(); }, @@ -678,7 +678,7 @@ const m = { damage(dmg) { if (tech.isRewindAvoidDeath && (m.energy + 0.05) > Math.min(0.95, m.maxEnergy) && dmg > 0.01) { const steps = Math.floor(Math.min(299, 150 * m.energy)) - simulation.makeTextLog(`m.rewind(${steps})`) + simulation.inGameConsole(`m.rewind(${steps})`) m.rewind(steps) return } @@ -698,7 +698,7 @@ const m = { if (tech.isDeathAvoid && powerUps.research.count && !tech.isDeathAvoidedThisLevel) { tech.isDeathAvoidedThisLevel = true powerUps.research.changeRerolls(-1) - simulation.makeTextLog(`m.research--
${powerUps.research.count}`) + simulation.inGameConsole(`m.research--
${powerUps.research.count}`) for (let i = 0; i < 22; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "heal", false); m.energy = m.maxEnergy + 0.1 if (m.immuneCycle < m.cycle + 300) m.immuneCycle = m.cycle + 300 //disable this.immuneCycle bonus seconds @@ -726,7 +726,7 @@ const m = { tech.isDeathAvoidedThisLevel = true m.health = 0.05 powerUps.research.changeRerolls(-1) - simulation.makeTextLog(`m.research-- + simulation.inGameConsole(`m.research--
${powerUps.research.count}`) for (let i = 0; i < 16; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "heal", false); if (m.immuneCycle < m.cycle + 300) m.immuneCycle = m.cycle + 300 //disable this.immuneCycle bonus seconds @@ -886,15 +886,21 @@ const m = { ctx.lineTo(m.knee.x, m.knee.y); ctx.lineTo(m.foot.x, m.foot.y); ctx.strokeStyle = stroke; - ctx.lineWidth = 6; + ctx.lineWidth = 5; ctx.stroke(); //toe lines ctx.beginPath(); ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x - 14, m.foot.y + 5); - ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x + 14, m.foot.y + 5); + if (m.onGround) { + ctx.lineTo(m.foot.x - 14, m.foot.y + 5); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 14, m.foot.y + 5); + } else { + ctx.lineTo(m.foot.x - 12, m.foot.y + 8); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 12, m.foot.y + 8); + } ctx.lineWidth = 4; ctx.stroke(); @@ -923,11 +929,6 @@ const m = { m.yOffWhen.stand = 49 m.yOffWhen.crouch = 22 m.isAltSkin = false - m.color = { - hue: 0, - sat: 0, - light: 100, - } m.fillColor = `hsl(${m.color.hue},${m.color.sat}%,${m.color.light}%)` m.fillColorDark = `hsl(${m.color.hue},${m.color.sat}%,${m.color.light - 10}%)` @@ -971,15 +972,6 @@ const m = { m.squirrelJump = 1.16; m.setMovement() - // m.yOffWhen.jump = 70 - // m.yOffWhen.stand = 49 - // m.yOffWhen.crouch = 22 - // m.color = { - // hue: 184, - // sat: 0, - // light: 55, - // } - // m.setFillColors(); m.draw = function () { m.walk_cycle += m.flipLegs * m.Vx; ctx.save(); @@ -1059,11 +1051,6 @@ const m = { }, polar() { m.isAltSkin = true - m.color = { - hue: 0, - sat: 0, - light: 100, - } // m.setFillColors(); m.fillColor = `hsl(${m.color.hue},${m.color.sat}%,${m.color.light}%)` m.fillColorDark = `hsl(${m.color.hue},${m.color.sat}%,${m.color.light - 35}%)` @@ -1081,12 +1068,10 @@ const m = { ctx.translate(m.pos.x, m.pos.y); m.calcLeg(Math.PI, -3); - const diff = (m.lastKillCycle - m.cycle + tech.isDamageCooldownTime) / tech.isDamageCooldownTime const color = diff < 0 ? "#fff" : "#aaa" const hue = 220 + 20 * Math.sin(0.01 * m.cycle) const colorInverse = diff < 0 ? `hsl(${hue}, 80%, 40%)` : "#fff" - // const colorInverseFade = diff < 0 ? "#ccc" : "#fff" m.drawLeg(color, colorInverse); m.calcLeg(0, 0); m.drawLeg(color, colorInverse); @@ -1100,21 +1085,14 @@ const m = { ctx.beginPath(); ctx.moveTo(15, 0) ctx.lineTo(28, 0) - // ctx.arc(15, 0, 4, 0, 2 * Math.PI); ctx.strokeStyle = colorInverse; ctx.lineWidth = 4; ctx.stroke(); ctx.restore(); - - // const scale = diff>0.3 - // console.log(diff.toFixed(3), scale.toFixed(3)) ctx.beginPath(); ctx.ellipse(m.pos.x, m.pos.y, 24, 18, 3.14 * Math.random(), 0, 2 * Math.PI) - // `rgba(0,0,${100 + 30 * Math.sin(0.1 * m.cycle)},0.8)` ctx.fillStyle = diff < 0 ? `hsl(${hue}, 80%, 40%)` : `rgba(255,255,255,${Math.min(Math.max(0, diff + 0.3), 1)})` - // ctx.fillStyle = colorInverse - // ctx.fillStyle = `rgba(0,0,0,${scale})` ctx.fill(); m.yOff = m.yOff * 0.85 + m.yOffGoal * 0.15; //smoothly move leg height towards height goal @@ -1134,15 +1112,21 @@ const m = { ctx.lineTo(m.knee.x, m.knee.y); ctx.lineTo(m.foot.x, m.foot.y); ctx.strokeStyle = stroke; - ctx.lineWidth = 6; + ctx.lineWidth = 5; ctx.stroke(); //toe lines ctx.beginPath(); ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x - 15, m.foot.y + 5); - ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + if (m.onGround) { + ctx.lineTo(m.foot.x - 15, m.foot.y + 5); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + } else { + ctx.lineTo(m.foot.x - 13, m.foot.y + 8); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 13, m.foot.y + 8); + } ctx.lineWidth = 3; ctx.stroke(); @@ -1166,22 +1150,16 @@ const m = { m.isAltSkin = true m.yOffWhen.stand = 52 m.yOffWhen.jump = 72 - // m.yOffWhen.crouch = 22 - // m.color = { - // hue: 184, - // sat: 0, - // light: 55, - // } - // m.setFillColors(); + m.draw = function () { m.walk_cycle += m.flipLegs * m.Vx; ctx.save(); ctx.globalAlpha = (m.immuneCycle < m.cycle) ? 1 : 0.5 //|| (m.cycle % 40 > 20) ctx.translate(m.pos.x, m.pos.y); m.calcLeg(Math.PI, -1.25); - m.drawLeg("#606070"); + m.drawLeg("#606080"); m.calcLeg(0, 0); - m.drawLeg("#445"); + m.drawLeg("#446"); ctx.rotate(m.angle); @@ -1193,17 +1171,14 @@ const m = { ctx.beginPath(); const arc = 0.7 + 0.17 * Math.sin(m.cycle * 0.012) ctx.arc(0, 0, 30, -arc, arc, true); //- Math.PI / 2 - ctx.strokeStyle = "#445"; + ctx.strokeStyle = "#446"; ctx.lineWidth = 2; ctx.stroke(); ctx.beginPath(); ctx.moveTo(13, 0) ctx.lineTo(20, 0) - // ctx.beginPath(); - // ctx.arc(15, 0, 4, 0, 2 * Math.PI); ctx.lineWidth = 5; - ctx.strokeStyle = "#445"; ctx.stroke(); ctx.restore(); @@ -1230,9 +1205,15 @@ const m = { //toe lines ctx.beginPath(); ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x - 14, m.foot.y + 5); - ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x + 14, m.foot.y + 5); + if (m.onGround) { + ctx.lineTo(m.foot.x - 14, m.foot.y + 5); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 14, m.foot.y + 5); + } else { + ctx.lineTo(m.foot.x - 12, m.foot.y + 8); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 12, m.foot.y + 8); + } ctx.lineWidth = 4; ctx.stroke(); @@ -1302,16 +1283,22 @@ const m = { ctx.lineTo(m.knee.x, m.knee.y); ctx.lineTo(m.foot.x, m.foot.y); ctx.strokeStyle = stroke; - ctx.lineWidth = 6; + ctx.lineWidth = 5; ctx.stroke(); //toe lines ctx.beginPath(); ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x - 14, m.foot.y + 5); - ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x + 14, m.foot.y + 5); - ctx.lineWidth = 4; + if (m.onGround) { + ctx.lineTo(m.foot.x - 15, m.foot.y + 5); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + } else { + ctx.lineTo(m.foot.x - 13, m.foot.y + 8); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 13, m.foot.y + 8); + } + ctx.lineWidth = 3; ctx.stroke(); //hip joint @@ -1324,7 +1311,7 @@ const m = { ctx.moveTo(m.foot.x + 5, m.foot.y); ctx.arc(m.foot.x, m.foot.y + 1, 5, 0, 2 * Math.PI); ctx.strokeStyle = "rgba(0,255,255,0.25)"; - ctx.lineWidth = 5; + ctx.lineWidth = 6; ctx.stroke(); ctx.fillStyle = m.fillColor; ctx.fill(); @@ -1521,9 +1508,15 @@ const m = { //toe lines ctx.beginPath(); ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x - 15, m.foot.y + 5); - ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + if (m.onGround) { + ctx.lineTo(m.foot.x - 15, m.foot.y + 5); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + } else { + ctx.lineTo(m.foot.x - 13, m.foot.y + 8); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 13, m.foot.y + 8); + } ctx.lineWidth = 4; ctx.stroke(); @@ -1641,9 +1634,15 @@ const m = { //toe lines ctx.beginPath(); ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x - 15, m.foot.y + 5); - ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + if (m.onGround) { + ctx.lineTo(m.foot.x - 15, m.foot.y + 5); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + } else { + ctx.lineTo(m.foot.x - 13, m.foot.y + 8); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 13, m.foot.y + 8); + } ctx.lineWidth = 4; ctx.stroke(); @@ -1665,12 +1664,7 @@ const m = { }, CPT() { m.isAltSkin = true - m.color = { - hue: 0, - sat: 0, - light: 100, - } - // m.setFillColors(); + m.fillColor = `hsl(${m.color.hue},${m.color.sat}%,${m.color.light}%)` m.fillColorDark = `hsl(${m.color.hue},${m.color.sat}%,${m.color.light - 35}%)` let grd = ctx.createLinearGradient(-20, 0, 15, 0); @@ -1718,15 +1712,21 @@ const m = { ctx.lineTo(m.knee.x, m.knee.y); ctx.lineTo(m.foot.x, m.foot.y); ctx.strokeStyle = stroke; - ctx.lineWidth = 6; + ctx.lineWidth = 5; ctx.stroke(); //toe lines ctx.beginPath(); ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x - 15, m.foot.y + 5); - ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + if (m.onGround) { + ctx.lineTo(m.foot.x - 15, m.foot.y + 5); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + } else { + ctx.lineTo(m.foot.x - 13, m.foot.y + 8); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 13, m.foot.y + 8); + } ctx.lineWidth = 3; ctx.stroke(); @@ -1746,14 +1746,95 @@ const m = { ctx.restore(); } }, + verlet() { + m.isAltSkin = true + + m.draw = function () { + ctx.fillStyle = m.fillColor; + m.walk_cycle += m.flipLegs * m.Vx; + ctx.save(); + ctx.globalAlpha = (m.immuneCycle < m.cycle) ? 1 : 0.5 //|| (m.cycle % 40 > 20) + ctx.translate(m.pos.x, m.pos.y); + m.calcLeg(Math.PI, -2); + m.drawLeg("#4a4a4a"); + m.calcLeg(0, 0); + m.drawLeg("#333"); + + ctx.beginPath(); + ctx.arc(0, 0, 30, 0, 2 * Math.PI); + ctx.fillStyle = m.bodyGradient + ctx.fill(); + + const rate = 0.09 + ctx.strokeStyle = "#000"; + ctx.lineWidth = 1; + ctx.beginPath(); + ctx.arc(0, 0, rate * (simulation.cycle + 0) % 30, 0, 2 * Math.PI); + ctx.stroke(); + ctx.beginPath(); + ctx.arc(0, 0, rate * (simulation.cycle + 15 / rate) % 30, 0, 2 * Math.PI); + ctx.stroke(); + ctx.beginPath(); + ctx.arc(0, 0, 30, 0, 2 * Math.PI); + ctx.stroke(); + + ctx.globalCompositeOperation = "difference"; + ctx.rotate(m.angle); + ctx.beginPath(); + ctx.arc(21, 0, 8, 0, 2 * Math.PI); + ctx.fillStyle = input.fire ? "#0ff" : input.field ? "#d30" : `#fff` + ctx.fill(); + ctx.restore(); + + m.yOff = m.yOff * 0.85 + m.yOffGoal * 0.15; //smoothly move leg height towards height goal + powerUps.boost.draw() + } + m.drawLeg = function (stroke) { + // if (simulation.mouseInGame.x > m.pos.x) { + if (m.angle > -Math.PI / 2 && m.angle < Math.PI / 2) { + m.flipLegs = 1; + } else { + m.flipLegs = -1; + } + ctx.save(); + ctx.scale(m.flipLegs, 1); //leg lines + ctx.beginPath(); + ctx.moveTo(m.hip.x, m.hip.y); + ctx.lineTo(m.knee.x, m.knee.y); + ctx.lineTo(m.foot.x, m.foot.y); + ctx.strokeStyle = stroke; + ctx.lineWidth = 1; + ctx.stroke(); + + //toe lines + ctx.beginPath(); + ctx.moveTo(m.foot.x, m.foot.y); + const footDrop = m.onGround ? 5 : 10 + ctx.lineTo(m.foot.x - 15, m.foot.y + footDrop); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 15, m.foot.y + footDrop); + ctx.lineWidth = 1; + ctx.stroke(); + + //hip joint + ctx.beginPath(); + ctx.arc(m.hip.x, m.hip.y, 9, 0, 2 * Math.PI); + //knee joint + ctx.moveTo(m.knee.x + 5, m.knee.y); + ctx.arc(m.knee.x, m.knee.y, 3, 0, 2 * Math.PI); + //foot joint + ctx.moveTo(m.foot.x + 5, m.foot.y); + ctx.arc(m.foot.x, m.foot.y, 4, 0, 2 * Math.PI); + ctx.fillStyle = "#000"; + ctx.fill(); + // ctx.lineWidth = 2; + // ctx.stroke(); + ctx.restore(); + } + }, hexagon() { m.isAltSkin = true - m.color = { - hue: 0, - sat: 0, - light: 100, - } - // m.setFillColors(); + m.fillColor = `hsl(${m.color.hue},${m.color.sat}%,${m.color.light}%)` m.fillColorDark = `hsl(${m.color.hue},${m.color.sat}%,${m.color.light - 35}%)` let grd = ctx.createLinearGradient(-30, 0, 30, 0); @@ -1813,9 +1894,15 @@ const m = { //toe lines ctx.beginPath(); ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x - 15, m.foot.y + 5); - ctx.moveTo(m.foot.x, m.foot.y); - ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + if (m.onGround) { + ctx.lineTo(m.foot.x - 15, m.foot.y + 5); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 15, m.foot.y + 5); + } else { + ctx.lineTo(m.foot.x - 13, m.foot.y + 8); + ctx.moveTo(m.foot.x, m.foot.y); + ctx.lineTo(m.foot.x + 13, m.foot.y + 8); + } ctx.lineWidth = 3; ctx.stroke(); @@ -2188,7 +2275,7 @@ const m = { }, setMaxEnergy(isMessage = true) { m.maxEnergy = (tech.isMaxEnergyTech ? 0.5 : 1) + tech.bonusEnergy + tech.healMaxEnergyBonus + tech.harmonicEnergy + 3 * tech.isGroundState + 1.5 * (m.fieldMode === 1) + (m.fieldMode === 0 || m.fieldMode === 1) * 0.05 * m.coupling + 0.77 * tech.isStandingWaveExpand - if (isMessage) simulation.makeTextLog(`m.maxEnergy = ${(m.maxEnergy.toFixed(2))}`) + if (isMessage) simulation.inGameConsole(`m.maxEnergy = ${(m.maxEnergy.toFixed(2))}`) }, fieldMeterColor: "#0cf", drawRegenEnergy(bgColor = "rgba(0, 0, 0, 0.4)", range = 60) { @@ -2238,6 +2325,8 @@ const m = { m.fieldRegen = 0.001667 //10 energy per second plasma torch } else if (m.fieldMode === 8) { m.fieldRegen = 0.001667 //10 energy per second pilot wave + } else if (m.fieldMode === 9) { + m.fieldRegen = 0.00117 //7 energy per second wormhole } else if (m.fieldMode === 10) { m.fieldRegen = 0.0015 //9 energy per second grappling hook } else { @@ -2915,7 +3004,7 @@ const m = { } }, couplingChange(change = 0) { - if (change > 0 && level.onLevel !== -1) simulation.makeTextLog(`
m.coupling += ${change}`, 60); //level.onLevel !== -1 means not on lore level + if (change > 0 && level.onLevel !== -1) simulation.inGameConsole(`
m.coupling += ${change}`, 60); //level.onLevel !== -1 means not on lore level m.coupling += change if (m.coupling < 0) { //look for coupling power ups on this level and remove them to prevent exploiting tech ejections @@ -2953,7 +3042,7 @@ const m = { document.getElementById("field").innerHTML = m.fieldUpgrades[index].name m.setHoldDefaults(); m.fieldUpgrades[index].effect(); - simulation.makeTextLog(`
  m.setField("${m.fieldUpgrades[m.fieldMode].name}")
input.key.field: ["MouseRight"]`); + simulation.inGameConsole(`
  m.setField("${m.fieldUpgrades[m.fieldMode].name}")
input.key.field: ["MouseRight"]`); }, fieldUpgrades: [{ name: "field emitter", @@ -4679,7 +4768,7 @@ const m = { { name: "wormhole", //wormholes attract blocks and power ups
- description: "use energy to tunnel through a wormhole
+7% chance to duplicate spawned power ups
6 energy per second", //
bullets may also traverse wormholes + description: "use energy to tunnel through a wormhole
+7% chance to duplicate spawned power ups
7 energy per second", //
bullets may also traverse wormholes drain: 0, effect: function () { m.fieldMeterColor = "#bbf" //"#0c5" diff --git a/js/powerup.js b/js/powerup.js index 229ec6e..d855d8d 100644 --- a/js/powerup.js +++ b/js/powerup.js @@ -84,21 +84,21 @@ const powerUps = { } }, tech(num = 1) { - return `
` + return `
tech
` }, field(num = 1) { - return `
` + return `
field
` }, gun(num = 1) { - return `
` + return `
gun
` }, gunTech(num = 1) { - return `
-
` + return `
guntech
+
guntech
` }, fieldTech(num = 1) { - return `
-
` + return `
fieldtech
+
fieldtech
` }, coupling(num = 1) { switch (num) { @@ -246,12 +246,12 @@ const powerUps = { if (b.inventory.length === 2) text += `
input.key.nextGun: ["${input.key.nextGun}","MouseWheel"]
input.key.previousGun: ["${input.key.previousGun}","MouseWheel"]` - simulation.makeTextLog(text); + simulation.inGameConsole(text); } else if (type === "field") { m.setField(index) } else if (type === "tech") { // if (tech.isBanish && tech.tech[index].isBanished) tech.tech[index].isBanished = false - simulation.makeTextLog(`
  tech.giveTech("${tech.tech[index].name}")`); + simulation.inGameConsole(`
  tech.giveTech("${tech.tech[index].name}")`); tech.giveTech(index) } powerUps.endDraft(type); @@ -289,7 +289,7 @@ const powerUps = { if (tech.isCancelDuplication) { const value = 0.05 tech.duplication += value - simulation.makeTextLog(`tech.duplicationChance() += ${value}`) + simulation.inGameConsole(`tech.duplicationChance() += ${value}`) simulation.circleFlare(value); } if (tech.isCancelRerolls) { @@ -582,7 +582,7 @@ const powerUps = { } if (tech.isResearchDamage) { tech.damage *= 1.05 - simulation.makeTextLog(`1.05x damage`); + simulation.inGameConsole(`1.05x damage`); tech.addJunkTechToPool(0.01) } powerUps.research.currentRerollCount++ @@ -592,12 +592,12 @@ const powerUps = { // const index = powerUps.tech.choiceLog.length - i - 1 // if (powerUps.tech.choiceLog[index] && tech.tech[powerUps.tech.choiceLog[index]]) tech.tech[powerUps.tech.choiceLog[index]].isBanished = true // } - // simulation.makeTextLog(`powerUps.tech.length: ${Math.max(0,powerUps.tech.lastTotalChoices - banishLength)}`) + // simulation.inGameConsole(`powerUps.tech.length: ${Math.max(0,powerUps.tech.lastTotalChoices - banishLength)}`) // } if (tech.isResearchReality) { m.switchWorlds() simulation.trails() - simulation.makeTextLog(`simulation.amplitude = ${Math.random()}`); + simulation.inGameConsole(`simulation.amplitude = ${Math.random()}`); } powerUps[type].effect(); }, @@ -616,24 +616,35 @@ const powerUps = { let overHeal = m.health + heal * simulation.healScale - m.maxHealth //used with tech.isOverHeal const healOutput = Math.min(m.maxHealth - m.health, heal) * simulation.healScale m.addHealth(heal); - if (healOutput > 0) simulation.makeTextLog(`
  m.health += ${(healOutput).toFixed(3)}`) //
${m.health.toFixed(3)} + if (healOutput > 0) simulation.inGameConsole(`
  m.health += ${(healOutput).toFixed(3)}`) //
${m.health.toFixed(3)} if (tech.isOverHeal && overHeal > 0) { //tech quenching - overHeal *= 2 //double the over heal converted to max health - //make sure overHeal doesn't kill player - if (m.health - overHeal * m.defense() < 0) overHeal = m.health - 0.01 - if (overHeal > m.maxHealth) overHeal = m.maxHealth //just in case overHeal gets too big - tech.extraMaxHealth += overHeal //increase max health + tech.extraMaxHealth += 0.3 * overHeal //increase max health m.setMaxHealth(); - m.damage(overHeal); - overHeal *= m.defense() // account for defense after m.damage() so the text log is accurate - simulation.makeTextLog(`
  m.health -= ${(overHeal).toFixed(3)}`) //
${m.health.toFixed(3)} + simulation.inGameConsole(`
  m.maxHealth += ${(0.3 * overHeal).toFixed(3)}`) simulation.drawList.push({ //add dmg to draw queue x: m.pos.x, y: m.pos.y, - radius: overHeal * 500 * simulation.healScale, - color: simulation.mobDmgColor, + radius: overHeal * 100 * simulation.healScale, + color: "#0eb", time: simulation.drawTime }); + + // overHeal *= 2 //double the over heal converted to max health + // //make sure overHeal doesn't kill player + // if (m.health - overHeal * m.defense() < 0) overHeal = m.health - 0.01 + // if (overHeal > m.maxHealth) overHeal = m.maxHealth //just in case overHeal gets too big + // tech.extraMaxHealth += overHeal //increase max health + // m.setMaxHealth(); + // m.damage(overHeal); + // overHeal *= m.defense() // account for defense after m.damage() so the text log is accurate + // simulation.inGameConsole(`
  m.health -= ${(overHeal).toFixed(3)}`) //
${m.health.toFixed(3)} + // simulation.drawList.push({ //add dmg to draw queue + // x: m.pos.x, + // y: m.pos.y, + // radius: overHeal * 500 * simulation.healScale, + // color: simulation.mobDmgColor, + // time: simulation.drawTime + // }); } else if (overHeal > 0.13) { //if leftover heals spawn a new spammer heal power up requestAnimationFrame(() => { powerUps.directSpawn(this.position.x, this.position.y, "heal", true, null, Math.min(1, overHeal) * 40 * (simulation.healScale ** 0.25))// directSpawn(x, y, target, moving = true, mode = null, size = powerUps[target].size()) { @@ -731,8 +742,6 @@ const powerUps = { } }, cancelText(type) { - // if (localSettings.isHideImages) { } - if (tech.isSuperDeterminism) { return `
` } else if (tech.isCancelTech && tech.cancelTechCount === 0) { @@ -873,7 +882,7 @@ const powerUps = {
-           ${tech.tech[choose].name} ${techCountText}
+         ${tech.tech[choose].name} ${techCountText} ${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}` }, fieldTechText(choose, click) { @@ -1186,7 +1195,7 @@ const powerUps = { for (let i = 0, len = tech.tech.length; i < len; i++) { if (tech.tech[i].name === "decoherence") powerUps.ejectTech(i, true) } - simulation.makeTextLog(`decoherence tech ejected
options reset`) + simulation.inGameConsole(`decoherence tech ejected
options reset`) } } if (tech.tooManyTechChoices) { @@ -1211,7 +1220,7 @@ const powerUps = { const choose = options[Math.floor(Math.seededRandom(0, options.length))] //pick an element from the array of options if (tech.isBanish) { tech.tech[choose].isBanished = true - if (i === 0) simulation.makeTextLog(`options.length = ${optionLengthNoDuplicates} //tech removed from pool by decoherence`) + if (i === 0) simulation.inGameConsole(`options.length = ${optionLengthNoDuplicates} //tech removed from pool by decoherence`) } removeOption(choose) //move from future options pool to avoid repeats on this selection tech.tech[choose].isRecentlyShown = true //this flag prevents this option from being shown the next time you pick up a tech power up @@ -1504,7 +1513,7 @@ const powerUps = { powerUps.spawn(x, y + 40, "heal", false) powerUps.spawn(x, y - 40, "heal", false) } - if (tech.isResearchReality) powerUps.spawnDelay("research", 5) + if (tech.isResearchReality) powerUps.spawnDelay("research", 6) if (tech.isBanish) powerUps.spawnDelay("research", 2) if (tech.isCouplingNoHit) powerUps.spawnDelay("coupling", 9) // if (tech.isRerollDamage) powerUps.spawnDelay("research", 1) @@ -1561,7 +1570,7 @@ const powerUps = { if (have.length) { choose = have[Math.floor(Math.random() * have.length)] - simulation.makeTextLog(`tech.remove("${tech.tech[choose].name}")`) + simulation.inGameConsole(`tech.remove("${tech.tech[choose].name}")`) for (let i = 0; i < tech.tech[choose].count; i++) { powerUps.directSpawn(m.pos.x, m.pos.y, "tech"); @@ -1580,7 +1589,7 @@ const powerUps = { return false } } else if (tech.tech[choose].count && !tech.tech[choose].isInstant) { - simulation.makeTextLog(`tech.remove("${tech.tech[choose].name}")`) + simulation.inGameConsole(`tech.remove("${tech.tech[choose].name}")`) for (let i = 0; i < tech.tech[choose].count; i++) { powerUps.directSpawn(m.pos.x, m.pos.y, "tech"); diff --git a/js/simulation.js b/js/simulation.js index 99dbcf3..72eb1c7 100644 --- a/js/simulation.js +++ b/js/simulation.js @@ -451,7 +451,7 @@ const simulation = { // --> // SVGleftMouse: ' ', // SVGrightMouse: ' ', - makeTextLog(text, time = 240) { + inGameConsole(text, time = 240) { if (!localSettings.isHideHUD && simulation.isTextLogOpen && !build.isExperimentSelection) { if (simulation.lastLogTime > m.cycle) { //if there is an older message document.getElementById("text-log").innerHTML = document.getElementById("text-log").innerHTML + '
' + text; @@ -848,9 +848,9 @@ const simulation = { document.getElementById("text-log").style.display = "none" document.getElementById("fade-out").style.opacity = 0; document.title = "n-gon"; - simulation.makeTextLog(`Math.seed = ${Math.initialSeed}`); - simulation.makeTextLog(`const engine = Engine.create(); //simulation begin`); - simulation.makeTextLog(`engine.timing.timeScale = 1`); + simulation.inGameConsole(`Math.seed = ${Math.initialSeed}`); + simulation.inGameConsole(`const engine = Engine.create(); //simulation begin`); + simulation.inGameConsole(`engine.timing.timeScale = 1`); m.alive = true; m.definePlayerMass(); m.onGround = false @@ -1199,7 +1199,7 @@ const simulation = { } //respawn drones in animation frame - requestAnimationFrame(() => { b.delayDrones({ x: level.enter.x + 50, y: level.enter.y - 60 }, droneCount) }); + requestAnimationFrame(() => { b.delayDrones({ x: level.enter.x + 50, y: level.enter.y - 60 }, droneCount, deliveryCount) }); //respawn spores in animation frame let respawnSpores = () => { diff --git a/js/spawn.js b/js/spawn.js index 01ac8ea..9694499 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -151,26 +151,12 @@ const spawn = { const sub = Vector.sub(player.position, this.position) const mag = Vector.magnitude(sub) // follow physics - // Matter.Body.setVelocity(this, { x: 0, y: 0 }); - // const where = Vector.add(this.position, Vector.mult(Vector.normalise(sub), this.chaseSpeed)) - // if (mag > 10) Matter.Body.setPosition(this, { x: where.x, y: where.y }); - - // if (true) { - // if (m.crouch) { - // if (Vector.magnitude(Vector.sub(this.position, m.pos)) > this.radius) { - // attract *= 40 - // } else { - // Matter.Body.setVelocity(this, Vector.mult(this.velocity, 0.9)); //friction - // } - - // } - // } - if (tech.isMoveDarkMatter && m.crouch && input.down) { Matter.Body.setVelocity(this, Vector.add(Vector.mult(this.velocity, 0.97), Vector.mult(player.velocity, 0.03))) Matter.Body.setPosition(this, Vector.add(Vector.mult(this.position, 0.95), Vector.mult(player.position, 0.05))) } - const force = Vector.mult(Vector.normalise(sub), 0.000000003) + + const force = Vector.mult(Vector.normalise(sub), 0.000000003 * (this.distanceToPlayer() > 4000 ? 3 : 1)) this.force.x += force.x this.force.y += force.y @@ -977,9 +963,9 @@ const spawn = { //add lore level as next level if player took lore tech earlier in the game if (lore.techCount > (lore.techGoal - 1) && !simulation.isCheating) { - simulation.makeTextLog(`undefined = ${lore.techCount}/${lore.techGoal}`, 360); + simulation.inGameConsole(`undefined = ${lore.techCount}/${lore.techGoal}`, 360); setTimeout(function () { - simulation.makeTextLog(`level.levels.push("null")`, 720); + simulation.inGameConsole(`level.levels.push("null")`, 720); unlockExit() level.levels.push("null") }, 4000); @@ -991,14 +977,14 @@ const spawn = { if (!simulation.paused && !simulation.onTitlePage) { count++ if (count < 660) { - if (count === 1 && simulation.difficultyMode < 5) simulation.makeTextLog(`//enter testing mode to set level.levels.length to Infinite`); - if (!(count % 60)) simulation.makeTextLog(`simulation.analysis = ${((count / 60 - Math.random()) * 0.1).toFixed(3)}`); + if (count === 1 && simulation.difficultyMode < 5) simulation.inGameConsole(`//enter testing mode to set level.levels.length to Infinite`); + if (!(count % 60)) simulation.inGameConsole(`simulation.analysis = ${((count / 60 - Math.random()) * 0.1).toFixed(3)}`); } else if (count === 660) { - simulation.makeTextLog(`simulation.analysis = 1 //analysis complete`); + simulation.inGameConsole(`simulation.analysis = 1 //analysis complete`); } else if (count === 780) { - simulation.makeTextLog(`undefined = ${lore.techCount}/${lore.techGoal}`) + simulation.inGameConsole(`undefined = ${lore.techCount}/${lore.techGoal}`) } else if (count === 1020) { - simulation.makeTextLog(`Engine.clear(engine) //simulation successful`); + simulation.inGameConsole(`Engine.clear(engine) //simulation successful`); } else if (count === 1260) { // tech.isImmortal = false; // m.death() @@ -1031,7 +1017,7 @@ const spawn = { if (simulation.testing || simulation.difficultyMode > 4) { unlockExit() setTimeout(function () { - simulation.makeTextLog(`level.levels.length = Infinite`); + simulation.inGameConsole(`level.levels.length = Infinite`); }, 1500); } else { if (!simulation.onTitlePage) requestAnimationFrame(loop); @@ -1811,47 +1797,20 @@ const spawn = { Matter.Body.setVelocity(mob[mob.length - 1], { x: this.velocity.x, y: this.velocity.y }) } for (let i = 0; i < powerUp.length; i++) powerUp[i].collisionFilter.mask = cat.map | cat.powerUp + for (let i = 0; i < 40; i++) this.colors(); }; - - //steal all power ups - // for (let i = 0; i < Math.min(powerUp.length, this.vertices.length); i++) { - // powerUp[i].collisionFilter.mask = 0 - // Matter.Body.setPosition(powerUp[i], this.vertices[i]) - // Matter.Body.setVelocity(powerUp[i], { - // x: 0, - // y: 0 - // }) - // } - // me.powerUpList = [] - // me.constrainPowerUps = function() { - // for (let i = 0; i < Math.min(powerUp.length, this.vertices.length); i++) { - // //remove other constraints on power up - // for (let i = 0, len = cons.length; i < len; ++i) { - // if (cons[i].bodyB === powerUp[i] || cons[i].bodyA === powerUp[i]) { - // Matter.Composite.remove(engine.world, cons[i]); - // cons.splice(i, 1); - // break; - // } - // } - - // //add to list - // this.powerUpList.push(powerUp[i]) - // //position and stop - // powerUp[i].collisionFilter.mask = 0 - // Matter.Body.setPosition(powerUp[i], this.vertices[i]) - // Matter.Body.setVelocity(powerUp[i], { x: 0, y: 0 }) - // //add constraint - // cons[cons.length] = Constraint.create({ - // pointA: this.vertices[i], - // bodyB: powerUp[i], - // stiffness: 1, - // damping: 1 - // }); - // Composite.add(engine.world, cons[cons.length - 1]); - // } - // for (let i = 0; i < this.powerUpList.length; i++) {} - // } - // me.constrainPowerUps() + me.colors = function () { + const unit = Vector.rotate({ x: 1, y: 0 }, Math.random() * 6.28) + const where = Vector.add(this.position, Vector.mult(unit, 700 - 500 * Math.random() * Math.random())) + const colors = ["#0ae", "#f55", "#f7b", "#0eb", "#467", "hsl(246,100%,77%)", "#0cf", "#26a"] + simulation.drawList.push({ //add dmg to draw queue + x: where.x, + y: where.y, + radius: 5 + 10 * Math.random(), + color: colors[Math.floor(Math.random() * colors.length)], //#0cf + time: 17//4 + Math.floor(15 * Math.random()) + }); + } me.do = function () { this.stroke = `hsl(0,0%,${80 + 25 * Math.sin(simulation.cycle * 0.01)}%)` if (this.isInvulnerable) { @@ -1870,12 +1829,6 @@ const spawn = { this.damageReduction = this.startingDamageReduction } } - //steal all power ups - // for (let i = 0; i < Math.min(powerUp.length, this.vertices.length); i++) { - // powerUp[i].collisionFilter.mask = 0 - // Matter.Body.setPosition(powerUp[i], this.vertices[i]) - // Matter.Body.setVelocity(powerUp[i], { x: 0, y: 0 }) - // } if (this.alive) { for (let i = 0; i < Math.min(powerUp.length, this.vertices.length); i++) { powerUp[i].collisionFilter.mask = 0 @@ -1887,6 +1840,9 @@ const spawn = { this.seePlayerCheckByDistance(); this.attraction(); this.checkStatus(); + + //aura around boss so it can bee seen more easily even when inside walls + if (!(simulation.cycle % 5)) this.colors(); }; }, @@ -3873,9 +3829,10 @@ const spawn = { mobs.spawn(x, y, 0, 25, `rgba(255,0,200)`); //"rgb(221,102,119)" let me = mob[mob.length - 1]; me.stroke = "transparent"; //used for drawGhost - Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger + me.isUnblockable = true; + Matter.Body.setDensity(me, 0.033); //extra dense //normal is 0.001 //makes effective life much larger me.isBoss = true; - me.damageReduction = 0.6 + me.damageReduction = 0.5 me.startingDamageReduction = me.damageReduction me.isInvulnerable = false me.nextHealthThreshold = 0.75 @@ -3888,7 +3845,7 @@ const spawn = { me.friction = 0; me.memory = 240 me.seePlayerFreq = 55 - me.delay = 4 + 2 * simulation.CDScale;//8 + 3 * simulation.CDScale; + me.delay = 5 + 2 * simulation.CDScale;//8 + 3 * simulation.CDScale; me.nextBlinkCycle = me.delay; me.JumpDistance = 0//set in redMode() // spawn.shield(me, x, y, 1); diff --git a/js/tech.js b/js/tech.js index 29fb786..1b541e5 100644 --- a/js/tech.js +++ b/js/tech.js @@ -61,7 +61,7 @@ const tech = { } if (tech.tech[index].count === 0) return 0 const totalRemoved = tech.tech[index].count - simulation.makeTextLog(`tech.removeTech("${tech.tech[index].name}")`, 360) + simulation.inGameConsole(`tech.removeTech("${tech.tech[index].name}")`, 360) tech.tech[index].remove(); tech.removeCount += totalRemoved tech.tech[index].count = 0; @@ -73,11 +73,11 @@ const tech = { }, junkChance: 0, addJunkTechToPool(percent) { //percent is number between 0-1 - simulation.makeTextLog(`+${(100 * percent).toFixed(0)}% JUNKtech chance (${(100 * tech.junkChance).toFixed(0)} total chance)`) - // tech.junkChance += (1 - tech.junkChance) * percent tech.junkChance += percent if (tech.junkChance < 0.001 || tech.junkChance === undefined) tech.junkChance = 0 if (tech.junkChance > 1) tech.junkChance = 1 + simulation.inGameConsole(`+${(100 * percent).toFixed(0)}% JUNKtech chance (${(100 * tech.junkChance).toFixed(0)} total chance)`) + // tech.junkChance += (1 - tech.junkChance) * percent return percent //make an array for possible junk tech to add @@ -92,7 +92,7 @@ const tech = { // } // const num = Math.ceil(percent * countNonJunk) //scale number added // for (let i = 0; i < num; i++) tech.tech[options[Math.floor(Math.random() * options.length)]].frequency++ //add random array options to tech pool - // simulation.makeTextLog(`tech.tech.push(${num.toFixed(0)} JUNK)`) + // simulation.inGameConsole(`tech.tech.push(${num.toFixed(0)} JUNK)`) // return num // } else { // return 0 @@ -125,7 +125,7 @@ const tech = { // give a random tech from the tech I don't have if (options.length > 0) { let newTech = options[Math.floor(Math.random() * options.length)] - simulation.makeTextLog(`tech.giveTech("${tech.tech[newTech].name}") //random tech`); + simulation.inGameConsole(`tech.giveTech("${tech.tech[newTech].name}") //random tech`); tech.giveTech(newTech) } } else { @@ -141,7 +141,7 @@ const tech = { if (!found) return //if name not found don't give any tech } if (tech.isMetaAnalysis && tech.tech[index].isJunk) { - simulation.makeTextLog(`//tech: meta-analysis replaced junk tech with random tech`); + simulation.inGameConsole(`//tech: meta-analysis replaced junk tech with random tech`); tech.giveTech('random') for (let i = 0; i < 2; i++) powerUps.spawn(m.pos.x + 40 * Math.random(), m.pos.y + 40 * Math.random(), "research"); return @@ -152,8 +152,72 @@ const tech = { tech.tech[index].effect(); //give specific tech tech.tech[index].count++ if (!tech.tech[index].isInstant) tech.totalCount++ //used in power up randomization + if (tech.isWiki) { + async function getWikipediaIntro(subject) { + // const searchEndpoint = `https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&titles=${encodeURIComponent(subject).replace(/' /g, '%27')}&format=json&origin=*`; + const searchEndpoint = `https://en.wikipedia.org/w/api.php?action=opensearch&search=${encodeURIComponent(subject).replace(/' /g, '%27')}&limit=1&namespace=0&format=json&origin=*`; + try { + // Perform a search to get the closest matching title + const searchResponse = await fetch(searchEndpoint); + const searchData = await searchResponse.json(); + if (searchData[1].length === 0) throw new Error('No matching pages found'); + const closestTitle = searchData[1][0]; + // Use the closest matching title to get the page content + const contentEndpoint = `https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&titles=${encodeURIComponent(closestTitle)}&format=json&origin=*`; + const contentResponse = await fetch(contentEndpoint); + const contentData = await contentResponse.json(); + const pages = contentData.query.pages; + const pageId = Object.keys(pages)[0]; + return pages[pageId].extract + } catch (error) { + console.error('Error fetching Wikipedia intro:', error); + } + } + const subject = tech.tech[index].name + getWikipediaIntro(subject).then(intro => { + let tab = window.open(`https://en.wikipedia.org/w/index.php?search=${encodeURIComponent(subject).replace(/' /g, '%27')}&title=Special:Search`, "_blank"); + if (tab) { + let checkInterval = setInterval(() => { + if (tab.closed) { + clearInterval(checkInterval); // Stop checking once the tab is closed + + const introArray = intro.split(" ") + const wordLimit = 7 + const wordNumber = Math.ceil(Math.random() * wordLimit) + const answer = prompt(`On the wikipedia page for ${subject} what is word ${wordNumber + 1}?`) + console.log(introArray[wordNumber]) + if (introArray[wordNumber]) { + if (answer && answer.toLowerCase() === introArray[wordNumber].toLowerCase().replace(/[^a-zA-Z]/g, '')) { + powerUps.spawnDelay("research", 5) + simulation.inGameConsole(`correct!`, 360) + } else { + simulation.inGameConsole(`${answer} is wrong, it was ${introArray[wordNumber]}`, 360) + } + let text = `"` + for (let i = 0; i < wordLimit; i++) { + if (i === wordNumber) { + text += `${introArray[i]} ` + } else { + text += `${introArray[i]} ` + } + } + simulation.inGameConsole(text + `..."`, 360) + } else { + simulation.inGameConsole(`hmmm I'm not sure the answer, so I'll say it's correct!`, 360) + powerUps.spawnDelay("research", 5) + } + } + }, 1000); // Check every 1 second + setTimeout(() => { + tab.close(); + }, 7000); // Close the tab after 7 seconds + } + }); + } + + + //move new tech to the top of the tech list requestAnimationFrame(() => { - //move new tech to the top of the tech list if (index > 0 && !build.isExperimentSelection) { const [item] = tech.tech.splice(index, 1); // Remove the element from the array tech.tech.unshift(item); // Add the element to the front of the array @@ -211,7 +275,7 @@ const tech = { if (tech.isNoDefenseDamage && m.defense() === 1) dmg *= 2 if (tech.isImmunityDamage && m.immuneCycle > m.cycle) dmg *= 4 if (tech.isPowerUpDamage) dmg *= 1 + 0.07 * powerUp.length - if (tech.isDamageCooldown) dmg *= m.lastKillCycle + tech.isDamageCooldownTime > m.cycle ? 0.5 : 4 + if (tech.isDamageCooldown) dmg *= m.lastKillCycle + tech.isDamageCooldownTime > m.cycle ? 0.4 : 4 if (tech.isDamageAfterKillNoRegen && m.lastKillCycle + 300 > m.cycle) dmg *= 2 if (tech.isDivisor && b.activeGun !== undefined && b.activeGun !== null && b.guns[b.activeGun].ammo % 3 === 0) dmg *= 1.9 if (tech.isNoGroundDamage) dmg *= m.onGround ? 0.9 : 2 @@ -219,7 +283,7 @@ const tech = { if (tech.isGunChoice && tech.buffedGun === b.inventoryGun) dmg *= 1 + 0.3 * b.inventory.length if (powerUps.boost.endCycle > m.cycle) dmg *= 1 + powerUps.boost.damage if (m.coupling && (m.fieldMode === 0 || m.fieldMode === 5)) dmg *= 1 + 0.015 * m.coupling - if (tech.deathSkipTime) dmg *= 1 + 0.6 * tech.deathSkipTime + if (tech.isVerlet) dmg *= 3 if (tech.isTechDebt) dmg *= tech.totalCount > 20 ? Math.pow(0.85, tech.totalCount - 20) : 4 - 0.15 * tech.totalCount if (tech.isAnthropicDamage && tech.isDeathAvoidedThisLevel) dmg *= 2.71828 if (tech.isDupDamage) dmg *= 1 + Math.min(1, tech.duplicationChance()) @@ -347,6 +411,27 @@ const tech = { } } }, + { + name: "Verlet integration", + description: "3x damage
after mobs die advance time 0.5 seconds", + maxCount: 1, + count: 0, + frequency: 1, + frequencyDefault: 1, + isSkin: true, + allowed() { + return !m.isAltSkin + }, + requires: "not skinned", + effect() { + tech.isVerlet = true + m.skin.verlet(); + }, + remove() { + tech.isVerlet = false + if (this.count) m.resetSkin(); + } + }, { name: "Hilbert space", description: "4x damage
after a collision enter an alternate reality", @@ -488,7 +573,7 @@ const tech = { { name: "depolarization", descriptionFunction() { - return `4x damage, but if a mob dies
0.5x damage for ${(tech.isDamageCooldownTime / 60).toFixed(1)} seconds instead` + return `4x damage, but if a mob dies
0.4x damage for ${(tech.isDamageCooldownTime / 60).toFixed(1)} seconds instead` }, maxCount: 1, count: 0, @@ -630,7 +715,7 @@ const tech = { }, { name: "ordnance", - description: `spawn ${powerUps.orb.gun()} and gain 2x ${powerUps.orb.gunTech()} frequency
+6% JUNK chance`, + description: `spawn ${powerUps.orb.gun()} and get 2x frequency for ${powerUps.orb.gunTech()}
+6% JUNK chance`, maxCount: 1, count: 0, frequency: 1, @@ -786,45 +871,90 @@ const tech = { }, requires: "at least 2 guns", effect() { - for (let i = b.inventory.length - 1; i > -1; i--) { //backwards because some tech can remove or add guns - const gunTechPool = [] //find gun tech for this gun - for (let j = 0, len = tech.tech.length; j < len; j++) { - // console.log(j, tech.tech[j].isGunTech, tech.tech[j].allowed(), !tech.tech[j].isJunk, !tech.tech[j].isBadRandomOption, tech.tech[j].count < tech.tech[j].maxCount) - const originalActiveGunIndex = b.activeGun //set current gun to active so allowed works - b.activeGun = b.inventory[i] //to make the .allowed work for guns that aren't active - if (tech.tech[j].isGunTech && tech.tech[j].allowed() && !tech.tech[j].isJunk && !tech.tech[j].isBadRandomOption && tech.tech[j].count < tech.tech[j].maxCount) { - const regex = tech.tech[j].requires.search(b.guns[b.inventory[i]].name) //get string index of gun name - const not = tech.tech[j].requires.search(' not ') //get string index of ' not ' - if (regex !== -1 && (not === -1 || not > regex)) gunTechPool.push(j) //look for the gun name in the requirements, but the gun name needs to show up before the word ' not ' - } - b.activeGun = originalActiveGunIndex - if (!b.guns[b.activeGun].have) { - if (b.inventory.length === 0) { - b.activeGun = null - } else { - b.activeGun = b.inventory[0] + const delay = 20 + let i = (b.inventory.length) * delay + let gunIndex = -1 + let cycle = () => { + if (i > 0) { + if (m.alive) requestAnimationFrame(cycle); + if (!simulation.paused && !simulation.isChoosing) { + i-- + if (!(i % delay)) { + gunIndex++ + //find gun tech for this gun + const gunTechPool = [] + for (let j = 0, len = tech.tech.length; j < len; j++) { + const originalActiveGunIndex = b.activeGun //set current gun to active so allowed works + b.activeGun = b.inventory[gunIndex] //to make the .allowed work for guns that aren't active + if (tech.tech[j].isGunTech && tech.tech[j].allowed() && !tech.tech[j].isJunk && !tech.tech[j].isBadRandomOption && tech.tech[j].count < tech.tech[j].maxCount) { + const regex = tech.tech[j].requires.search(b.guns[b.inventory[gunIndex]].name) //get string index of gun name + const not = tech.tech[j].requires.search(' not ') //get string index of ' not ' + if (regex !== -1 && (not === -1 || not > regex)) gunTechPool.push(j) //look for the gun name in the requirements, but the gun name needs to show up before the word ' not ' + } + b.activeGun = originalActiveGunIndex + if (!b.guns[b.activeGun].have) { + if (b.inventory.length === 0) { + b.activeGun = null + } else { + b.activeGun = b.inventory[0] + } + b.inventoryGun = 0; + } + } + + //give the tech that was found for this gun + if (gunTechPool.length) { + const index = Math.floor(Math.random() * gunTechPool.length) + simulation.inGameConsole(`tech.giveTech("${tech.tech[gunTechPool[index]].name}")`, 360) + tech.giveTech(gunTechPool[index]) // choose from the gun pool + simulation.boldActiveGunHUD(); + } + } - b.inventoryGun = 0; } } - if (gunTechPool.length) { - const index = Math.floor(Math.random() * gunTechPool.length) - // console.log(gunTechPool, index, gunTechPool[index], tech.tech[gunTechPool[index]].name) - simulation.makeTextLog(`tech.giveTech("${tech.tech[gunTechPool[index]].name}")`, 360) - // tech.tech[gunTechPool[index]].isInstant = true //makes it not remove properly under paradigm shift - tech.giveTech(gunTechPool[index]) // choose from the gun pool - // console.log(gunTechPool, index, gunTechPool[index], tech.tech[gunTechPool[index]].name) - // tech.tech[gunTechPool[index]].isFromAppliedScience = true //makes it not remove properly under paradigm shift - } } - simulation.boldActiveGunHUD(); + requestAnimationFrame(cycle); + + // for (let i = b.inventory.length - 1; i > -1; i--) { //backwards because some tech can remove or add guns + // const gunTechPool = [] //find gun tech for this gun + // for (let j = 0, len = tech.tech.length; j < len; j++) { + // // console.log(j, tech.tech[j].isGunTech, tech.tech[j].allowed(), !tech.tech[j].isJunk, !tech.tech[j].isBadRandomOption, tech.tech[j].count < tech.tech[j].maxCount) + // const originalActiveGunIndex = b.activeGun //set current gun to active so allowed works + // b.activeGun = b.inventory[i] //to make the .allowed work for guns that aren't active + // if (tech.tech[j].isGunTech && tech.tech[j].allowed() && !tech.tech[j].isJunk && !tech.tech[j].isBadRandomOption && tech.tech[j].count < tech.tech[j].maxCount) { + // const regex = tech.tech[j].requires.search(b.guns[b.inventory[i]].name) //get string index of gun name + // const not = tech.tech[j].requires.search(' not ') //get string index of ' not ' + // if (regex !== -1 && (not === -1 || not > regex)) gunTechPool.push(j) //look for the gun name in the requirements, but the gun name needs to show up before the word ' not ' + // } + // b.activeGun = originalActiveGunIndex + // if (!b.guns[b.activeGun].have) { + // if (b.inventory.length === 0) { + // b.activeGun = null + // } else { + // b.activeGun = b.inventory[0] + // } + // b.inventoryGun = 0; + // } + // } + // if (gunTechPool.length) { + // const index = Math.floor(Math.random() * gunTechPool.length) + // // console.log(gunTechPool, index, gunTechPool[index], tech.tech[gunTechPool[index]].name) + // simulation.inGameConsole(`tech.giveTech("${tech.tech[gunTechPool[index]].name}")`, 360) + // // tech.tech[gunTechPool[index]].isInstant = true //makes it not remove properly under paradigm shift + // tech.giveTech(gunTechPool[index]) // choose from the gun pool + // // console.log(gunTechPool, index, gunTechPool[index], tech.tech[gunTechPool[index]].name) + // // tech.tech[gunTechPool[index]].isFromAppliedScience = true //makes it not remove properly under paradigm shift + // } + // } + // simulation.boldActiveGunHUD(); }, remove() { } }, { name: "supply chain", descriptionFunction() { - return `spawn ${powerUps.orb.gun()}
spawn ${powerUps.orb.ammo()} to match your current ammo` + return `spawn ${powerUps.orb.gun()} ${powerUps.orb.ammo(10)}` }, maxCount: 9, count: 0, @@ -836,11 +966,11 @@ const tech = { }, requires: "", effect() { - let ammoCount = 0 //count ammo - if (b.activeGun && b.activeGun !== undefined && b.guns[b.activeGun].have && b.guns[b.activeGun].ammo !== Infinity) { - ammoCount += b.guns[b.activeGun].ammo / b.guns[b.activeGun].ammoPack - } - powerUps.spawnDelay("ammo", Math.ceil(ammoCount)) + // let ammoCount = 0 //count ammo + // if (b.activeGun && b.activeGun !== undefined && b.guns[b.activeGun].have && b.guns[b.activeGun].ammo !== Infinity) { + // ammoCount += b.guns[b.activeGun].ammo / b.guns[b.activeGun].ammoPack + // } + powerUps.spawnDelay("ammo", 10) powerUps.spawn(m.pos.x, m.pos.y, "gun"); }, remove() { } @@ -861,9 +991,9 @@ const tech = { effect() { if (this.gun === undefined) this.gun = Math.floor(Math.random() * (b.guns.length - 1)) //don't pick laser - simulation.makeTextLog(`${b.guns[this.gun].ammoPack} → ${2 * b.guns[this.gun].ammoPack} average ammo per ${powerUps.orb.ammo(1)} for ${b.guns[this.gun].name}`) + simulation.inGameConsole(`${b.guns[this.gun].ammoPack} → ${2 * b.guns[this.gun].ammoPack} average ammo per ${powerUps.orb.ammo(1)} for ${b.guns[this.gun].name}`) b.guns[this.gun].ammoPack *= 2 - // simulation.makeTextLog(`${(tech.interestRate * 100).toFixed(0)}% interest on health = ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`) + // simulation.inGameConsole(`${(tech.interestRate * 100).toFixed(0)}% interest on health = ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`) // for (let i = 0; i < 4; i++) powerUps.spawn(m.pos.x + 10 * Math.random(), m.pos.y + 10 * Math.random(), "ammo"); }, @@ -895,7 +1025,7 @@ const tech = { for (let i = 0; i < options.length; i++) { const index = options[i] const scale = (i < options.length / 2) ? 4 : 0.25 - simulation.makeTextLog(`${(b.guns[index].ammoPack).toFixed(1)} ${(b.guns[index].ammoPack * scale).toFixed(1)} average ammo per ${powerUps.orb.ammo(1)} for ${b.guns[index].name}`, Infinity) + simulation.inGameConsole(`${(b.guns[index].ammoPack).toFixed(1)} ${(b.guns[index].ammoPack * scale).toFixed(1)} average ammo per ${powerUps.orb.ammo(1)} for ${b.guns[index].name}`, Infinity) b.guns[index].ammoPack *= scale } }, @@ -1115,7 +1245,7 @@ const tech = { name: "microstates", link: `microstates`, descriptionFunction() { - return `use ${powerUps.orb.research(3)}
1.01x damage per bullet or bot (${(1 + bullet.length * 0.01).toFixed(2)}x)` + return `use ${powerUps.orb.research(3)}
1.01x damage per bullet or bot (${(1 + bullet.length * 0.01).toFixed(2)}x)` }, maxCount: 1, count: 0, @@ -1201,7 +1331,7 @@ const tech = { tech.fireRate /= rate this.totalRate.push(rate) b.setFireCD(); - simulation.makeTextLog(`tech.fireRate *= ${rate} //heuristics`); + simulation.inGameConsole(`tech.fireRate *= ${rate} //heuristics`); }, remove() { if (this.count && m.alive) { @@ -1231,7 +1361,7 @@ const tech = { const damage = (Math.floor((Math.random() * 0.3 + 1) * 100)) / 100 tech.damage *= damage this.damageSoFar.push(damage) - simulation.makeTextLog(`tech.damage *= ${damage} //mechatronics`); + simulation.inGameConsole(`tech.damage *= ${damage} //mechatronics`); }, remove() { if (this.count && m.alive) for (let i = 0; i < this.damageSoFar.length; i++) tech.damage /= this.damageSoFar[i] @@ -1368,22 +1498,6 @@ const tech = { tech.sporesOnDeath = 0; } }, - { - name: "propagator", - description: "after mobs die advance time 0.5 seconds
1.6x damage", - maxCount: 3, - count: 0, - frequency: 1, - frequencyDefault: 1, - allowed: () => true, - requires: "", - effect() { - tech.deathSkipTime++ - }, - remove() { - tech.deathSkipTime = 0 - } - }, { name: "exciton", descriptionFunction() { @@ -1529,7 +1643,7 @@ const tech = { { name: "scrap bots", link: `scrap bots`, - description: "after mobs die you have a 33% chance
to build scrap bots that operate for 15 seconds", + description: "after mobs die you have a 33% chance
to construct scrap bots that operate for 15 seconds", maxCount: 3, count: 0, frequency: 1, @@ -1569,7 +1683,7 @@ const tech = { { name: "nail-bot", link: `nail-bot`, - description: "a bot fires nails at mobs in line of sight", + description: "construct a bot fires nails at mobs in line of sight", maxCount: 9, count: 0, frequency: 1, @@ -1595,7 +1709,7 @@ const tech = { { name: "nail-bot upgrade", link: `nail-bot upgrade`, - description: "convert your bots to nail-bots
4x fire rate and 1.4x nail velocity", + description: "convert your bots to nail-bots
4x fire rate and 1.4x nail velocity", maxCount: 1, count: 0, frequency: 3, @@ -1627,7 +1741,7 @@ const tech = { { name: "foam-bot", link: `foam-bot`, - description: "a bot sprays sticky foam at nearby mobs", + description: "construct a bot sprays sticky foam at nearby mobs", maxCount: 9, count: 0, frequency: 1, @@ -1653,7 +1767,7 @@ const tech = { { name: "foam-bot upgrade", link: `foam-bot upgrade`, - description: "convert your bots to foam-bots
2.5x foam size and fire rate", + description: "convert your bots to foam-bots
2.5x foam size and fire rate", maxCount: 1, count: 0, frequency: 3, @@ -1685,7 +1799,7 @@ const tech = { { name: "sound-bot", link: `sound-bot`, - description: "a bot emits expanding arcs
aimed towards nearby mobs", + description: "construct a bot emits expanding
arcs of sound aimed towards nearby mobs", maxCount: 9, count: 0, frequency: 1, @@ -1709,7 +1823,7 @@ const tech = { { name: "sound-bot upgrade", link: `sound-bot upgrade`, - description: "convert your bots to sound-bots
2x wave fire rate, damage, and duration", + description: "convert your bots to sound-bots
2x wave fire rate, damage, and duration", maxCount: 1, count: 0, frequency: 3, @@ -1741,7 +1855,7 @@ const tech = { { name: "boom-bot", link: `boom-bot`, - description: "a bot defends the space around you
ignites an explosion after hitting a mob", + description: "construct a bot defends the space around you
ignites an explosion after hitting a mob", maxCount: 9, count: 0, frequency: 1, @@ -1767,7 +1881,7 @@ const tech = { { name: "boom-bot upgrade", link: `boom-bot upgrade`, - description: "convert your bots to boom-bots
4x explosion damage and size", + description: "convert your bots to boom-bots
4x explosion damage and size", maxCount: 1, count: 0, frequency: 3, @@ -1799,7 +1913,7 @@ const tech = { { name: "laser-bot", link: `laser-bot`, - description: "a bot uses energy to emit a laser beam
that targets nearby mobs", + description: "construct a bot uses energy to emit a laser
that targets nearby mobs", maxCount: 9, count: 0, frequency: 1, @@ -1825,7 +1939,7 @@ const tech = { { name: "laser-bot upgrade", link: `laser-bot upgrade`, - description: "convert your bots to laser-bots
2x damage, efficiency, and range", + description: "convert your bots to laser-bots
2x damage, efficiency, and range", maxCount: 1, count: 0, frequency: 3, @@ -1857,7 +1971,7 @@ const tech = { { name: "orbital-bot", link: `orbital-bot`, - description: "a bot is locked in orbit around you
stuns and damages mobs on contact", + description: "construct a bot is locked in orbit around you
stuns and damages mobs on contact", maxCount: 9, count: 0, frequency: 1, @@ -1883,7 +1997,7 @@ const tech = { { name: "orbital-bot upgrade", link: `orbital-bot upgrade`, - description: "convert your bots to orbital-bots
4x orbital damage and 2x radius", + description: "convert your bots to orbital-bots
4x orbital damage and 2x radius", maxCount: 1, count: 0, frequency: 3, @@ -1924,7 +2038,7 @@ const tech = { { name: "dynamo-bot", link: `dynamo-bot`, - description: "a bot damages mobs while it traces your path
+8 energy per second when nearby", + description: "construct a bot damages mobs it touches
+8 energy per second when nearby", maxCount: 9, count: 0, frequency: 1, @@ -1950,7 +2064,7 @@ const tech = { { name: "dynamo-bot upgrade", link: `dynamo-bot upgrade`, - description: "convert your bots to dynamo-bots
+24 energy per second when nearby", + description: "convert your bots to dynamo-bots
+24 energy per second when nearby", maxCount: 1, count: 0, frequency: 3, @@ -2025,7 +2139,7 @@ const tech = { name: "bot fabrication", link: `bot fabrication`, descriptionFunction() { - return `after you collect ${powerUps.orb.research(2 + Math.floor(0.1666 * b.totalBots()))}use them
to build a random bot (+1 cost every 5 bots)` + return `after you collect ${powerUps.orb.research(2 + Math.floor(0.1666 * b.totalBots()))}use them
to construct a random bot (+1 cost every 5 bots)` }, // description: `if you collect ${powerUps.orb.research(2)}use them to build a
random bot (+1 cost every 5 bots)`, maxCount: 1, @@ -2040,7 +2154,7 @@ const tech = { effect() { tech.isRerollBots = true; powerUps.research.changeRerolls(0) - simulation.makeTextLog(`m.research = 0`) + simulation.inGameConsole(`m.research = 0`) }, remove() { tech.isRerollBots = false; @@ -2049,7 +2163,7 @@ const tech = { }, { name: "open-source", - description: `${powerUps.orb.tech()}, ${powerUps.orb.field()}, and ${powerUps.orb.gun()} have +1 bot choice
3x bot-${powerUps.orb.tech()} frequency`, + description: `${powerUps.orb.tech()}, ${powerUps.orb.field()}, and ${powerUps.orb.gun()} have +1 bot choice
3x frequency for ${powerUps.orb.tech()} with bots`, maxCount: 1, count: 0, frequency: 1, @@ -2147,7 +2261,7 @@ const tech = { }, { name: "robotics", - description: `spawn 2 random bots`, + description: `construct 2 random bots`, maxCount: 1, count: 0, frequency: 1, @@ -2166,7 +2280,7 @@ const tech = { }, { name: "bot manufacturing", - description: `use ${powerUps.orb.research(2)} to build
3 random bots`, + description: `use ${powerUps.orb.research(2)} to construct
3 random bots`, maxCount: 1, count: 0, frequency: 1, @@ -2215,7 +2329,7 @@ const tech = { b.nailBot() tech.nailBotCount++; } - simulation.makeTextLog(`tech.isNailBotUpgrade = true`) + simulation.inGameConsole(`tech.isNailBotUpgrade = true`) }) notUpgradedBots.push(() => { tech.giveTech("foam-bot upgrade") @@ -2223,7 +2337,7 @@ const tech = { b.foamBot() tech.foamBotCount++; } - simulation.makeTextLog(`tech.isFoamBotUpgrade = true`) + simulation.inGameConsole(`tech.isFoamBotUpgrade = true`) }) notUpgradedBots.push(() => { tech.giveTech("sound-bot upgrade") @@ -2231,7 +2345,7 @@ const tech = { b.soundBot() tech.soundBotCount++; } - simulation.makeTextLog(`tech.isSoundBotUpgrade = true`) + simulation.inGameConsole(`tech.isSoundBotUpgrade = true`) }) notUpgradedBots.push(() => { tech.giveTech("boom-bot upgrade") @@ -2239,7 +2353,7 @@ const tech = { b.boomBot() tech.boomBotCount++; } - simulation.makeTextLog(`tech.isBoomBotUpgrade = true`) + simulation.inGameConsole(`tech.isBoomBotUpgrade = true`) }) notUpgradedBots.push(() => { tech.giveTech("laser-bot upgrade") @@ -2247,7 +2361,7 @@ const tech = { b.laserBot() tech.laserBotCount++; } - simulation.makeTextLog(`tech.isLaserBotUpgrade = true`) + simulation.inGameConsole(`tech.isLaserBotUpgrade = true`) }) notUpgradedBots.push(() => { tech.giveTech("orbital-bot upgrade") @@ -2255,7 +2369,7 @@ const tech = { b.orbitBot() tech.orbitBotCount++; } - simulation.makeTextLog(`tech.isOrbitalBotUpgrade = true`) + simulation.inGameConsole(`tech.isOrbitalBotUpgrade = true`) }) notUpgradedBots.push(() => { tech.giveTech("dynamo-bot upgrade") @@ -2263,7 +2377,7 @@ const tech = { b.dynamoBot() tech.dynamoBotCount++; } - simulation.makeTextLog(`tech.isDynamoBotUpgrade = true`) + simulation.inGameConsole(`tech.isDynamoBotUpgrade = true`) }) notUpgradedBots[Math.floor(Math.random() * notUpgradedBots.length)]() //choose random function from the array and run it @@ -3236,7 +3350,7 @@ const tech = { { name: "quenching", descriptionFunction() { - return `${powerUps.orb.heal()} overhealing results in 2x health loss
and 2x maximum health increase` + return `0.3x of ${powerUps.orb.heal()} overhealing
is added to maximum health` }, maxCount: 1, count: 0, @@ -3308,7 +3422,7 @@ const tech = { { name: "maintenance", descriptionFunction() { - return `2x healing-${powerUps.orb.tech()} frequency
spawn ${powerUps.orb.heal(13)}` + return `2x frequency for ${powerUps.orb.tech()} with healing
spawn ${powerUps.orb.heal(13)}` }, maxCount: 1, count: 0, @@ -3459,7 +3573,7 @@ const tech = { }, { name: "many-worlds", - description: `at the start of each level spawn ${powerUps.orb.tech()}
and enter an alternate reality`, + description: `at the start of each level spawn ${powerUps.orb.tech()} ${powerUps.orb.coupling(3)}
and enter an alternate reality`, maxCount: 1, count: 0, frequency: 1, @@ -3479,7 +3593,7 @@ const tech = { { name: "Ψ(t) collapse", link: `Ψ(t) collapse`, - description: `after a boss dies spawn ${powerUps.orb.research(5)}
if you research enter an alternate reality`, + description: `after a boss dies spawn ${powerUps.orb.research(6)}
if you research enter an alternate reality`, maxCount: 1, count: 0, frequency: 1, @@ -3648,7 +3762,7 @@ const tech = { }, { name: "unified field theory", - description: `when paused you can click to change your ${powerUps.orb.field()}
2x ${powerUps.orb.fieldTech()} frequency`, + description: `when paused you can click to change your ${powerUps.orb.field()}
2x frequency for ${powerUps.orb.fieldTech()}`, maxCount: 1, count: 0, frequency: 1, @@ -3695,7 +3809,7 @@ const tech = { }, { name: "brainstorming", - description: `${powerUps.orb.tech()} choices randomize
every 1.5 seconds for 10 seconds`, + description: `randomize ${powerUps.orb.tech()} choices
every 1.5 seconds for 10 seconds`, maxCount: 1, count: 0, frequency: 1, @@ -3832,7 +3946,7 @@ const tech = { { name: "technical debt", descriptionFunction() { - return `decrease damage by 0.15x for each ${powerUps.orb.tech()} you have
increase damage by 4x(${(tech.totalCount > 20 ? (Math.pow(0.85, tech.totalCount - 20)) : (4 - 0.15 * tech.totalCount)).toFixed(2)}x)` + return `increase damage by 4x, but reduce damage
by 0.15x for each ${powerUps.orb.tech()} you have(${(tech.totalCount > 20 ? (Math.pow(0.85, tech.totalCount - 20)) : (4 - 0.15 * tech.totalCount)).toFixed(2)}x)` }, maxCount: 1, count: 0, @@ -4346,7 +4460,7 @@ const tech = { }, { name: "strange loop", - description: `1.1x damage
removing this gives a random remove-${powerUps.orb.tech()}`, + description: `1.1x damage
removing this gives a random ${powerUps.orb.tech()} with remove`, maxCount: 1, count: 0, frequency: 1, @@ -4460,7 +4574,7 @@ const tech = { }, { name: "deprecated", - scale: 0.07, + scale: 0.08, descriptionFunction() { return `after removing this gain
${1 + this.scale}x damage per removed ${powerUps.orb.tech()}(${(1 + this.scale * ((this.frequency === 0 ? 0 : 1) + tech.removeCount)).toFixed(2)}x)` }, @@ -4487,7 +4601,7 @@ const tech = { { name: "planned obsolescence", descriptionFunction() { - return `at the start of each level eject your oldest ${powerUps.orb.tech()}
and gain 1.1x damage each time` //(${(tech.ejectOld).toFixed(2)}x) + return `at the start of each level eject your oldest ${powerUps.orb.tech()}
and gain 1.1x damage each time` //(${(tech.isEjectOld).toFixed(2)}x) }, maxCount: 1, count: 0, @@ -4499,10 +4613,10 @@ const tech = { }, requires: "", effect() { - tech.ejectOld = 1 //this grows + tech.isEjectOld = true }, remove() { - tech.ejectOld = 0 + tech.isEjectOld = false } }, { @@ -4600,7 +4714,7 @@ const tech = { for (let i = 0, len = pool.length * 0.5; i < len; i++) removeCount += tech.removeTech(pool[i]) this.damage = this.damagePerRemoved * removeCount tech.damage *= (1 + this.damage) - simulation.makeTextLog(`${(1 + this.damage).toFixed(2)}x damage //from Occam's razor`, 360) + simulation.inGameConsole(`${(1 + this.damage).toFixed(2)}x damage //from Occam's razor`, 360) }, remove() { if (this.count && m.alive) tech.damage /= (1 + this.damage) @@ -4849,7 +4963,7 @@ const tech = { effect() { tech.isIceCrystals = true; b.guns[0].ammoPack = Infinity - b.guns[0].recordedAmmo = b.guns[i].ammo + b.guns[0].recordedAmmo = b.guns[0].ammo b.guns[0].ammo = Infinity simulation.updateGunHUD(); }, @@ -4953,7 +5067,7 @@ const tech = { { name: "6s half-life", link: `6s half-life`, - description: "nails, needles, rivets are made of plutonium-238
radioactive damage lasts +3 seconds", + description: "nails, needles, rivets are made of plutonium-238
radioactive damage lasts +3 seconds", isGunTech: true, maxCount: 1, count: 0, @@ -5310,7 +5424,7 @@ const tech = { }, { name: "Zectron", - description: `2x super ball damage, but
-4 energy after you collide with super balls`, + description: `2x super ball damage, but
after you collide with super balls they stop`, isGunTech: true, maxCount: 1, count: 0, @@ -6749,7 +6863,7 @@ const tech = { }, { name: "surfactant", - description: `use ${powerUps.orb.research(2)}to trade your foam ${powerUps.orb.gun()}
for 2 foam-bots and foam-bot upgrade`, + description: `use ${powerUps.orb.research(2)}to trade your foam ${powerUps.orb.gun()}
for 2 foam-bots and foam-bot upgrade`, // isGunTech: true, isRemoveGun: true, maxCount: 1, @@ -6770,7 +6884,7 @@ const tech = { b.foamBot() tech.foamBotCount++; } - simulation.makeTextLog(`tech.isFoamBotUpgrade = true`) + simulation.inGameConsole(`tech.isFoamBotUpgrade = true`) if (tech.haveGunCheck("foam", false)) b.removeGun("foam") for (let i = 0; i < 2; i++) { if (powerUps.research.count > 0) powerUps.research.changeRerolls(-1) @@ -7222,7 +7336,7 @@ const tech = { //pick one option if (options.length) { const index = options[Math.floor(Math.random() * options.length)] - simulation.makeTextLog(`tech.giveTech("${tech.tech[index].name}") //optical amplifier`, 360); + simulation.inGameConsole(`tech.giveTech("${tech.tech[index].name}") //optical amplifier`, 360); tech.giveTech(index) techGiven++ } @@ -7230,7 +7344,7 @@ const tech = { if (techGiven > 0) { tech.isStuckOn = true } else { //eject if none found - simulation.makeTextLog(`0 tech found //optical amplifier`); + simulation.inGameConsole(`0 tech found //optical amplifier`); const loop = () => { if (!simulation.paused && m.alive) { for (let i = 0; i < tech.tech.length; i++) { @@ -7784,10 +7898,10 @@ const tech = { { name: "dynamic equilibrium", descriptionFunction() { - return `increase damage by your most recent ${tech.isEnergyHealth ? "energy" : "health"} loss
(${(1 + (tech.lastHitDamage === 0 ? 5 : tech.lastHitDamage) * m.lastHit).toFixed(2)}x)` + return `increase damage by your most recent ${tech.isEnergyHealth ? "energy" : "health"} loss
(${(1 + (tech.lastHitDamage === 0 ? 6 : tech.lastHitDamage) * m.lastHit).toFixed(2)}x)` }, isFieldTech: true, - maxCount: 9, + maxCount: 3, count: 0, frequency: 2, frequencyDefault: 200, @@ -7796,7 +7910,7 @@ const tech = { }, requires: "negative mass, pilot wave", effect() { - tech.lastHitDamage += 5; + tech.lastHitDamage += 6; }, remove() { tech.lastHitDamage = 0; @@ -8178,49 +8292,25 @@ const tech = { { name: "plasma jet", link: `plasma jet`, - description: `use ${powerUps.orb.research(2)}
1.5x plasma torch range`, + description: `use ${powerUps.orb.research(1)}
1.5x plasma torch range`, isFieldTech: true, - maxCount: 1, + maxCount: 3, count: 0, frequency: 2, frequencyDefault: 2, allowed() { - return (tech.plasmaBotCount || m.fieldMode === 5) && (build.isExperimentSelection || powerUps.research.count > 1) && !tech.isPlasmaBall + return (tech.plasmaBotCount || m.fieldMode === 5) && (build.isExperimentSelection || powerUps.research.count > 0) && !tech.isPlasmaBall }, requires: "plasma torch, not plasma ball", effect() { tech.isPlasmaRange += 0.5; - for (let i = 0; i < 2; i++) { + for (let i = 0; i < 1; i++) { if (powerUps.research.count > 0) powerUps.research.changeRerolls(-1) } }, remove() { tech.isPlasmaRange = 1; - if (this.count > 0) powerUps.research.changeRerolls(this.count * 2) - } - }, - { - name: "plasma jet", - link: `plasma jet`, - description: `use ${powerUps.orb.research(2)}
1.5x plasma torch range`, - isFieldTech: true, - maxCount: 1, - count: 0, - frequency: 2, - frequencyDefault: 2, - allowed() { - return (tech.plasmaBotCount || m.fieldMode === 5) && (build.isExperimentSelection || powerUps.research.count > 1) && !tech.isPlasmaBall - }, - requires: "plasma torch, not plasma ball", - effect() { - tech.isPlasmaRange += 0.5; - for (let i = 0; i < 2; i++) { - if (powerUps.research.count > 0) powerUps.research.changeRerolls(-1) - } - }, - remove() { - tech.isPlasmaRange = 1; - if (this.count > 0) powerUps.research.changeRerolls(this.count * 2) + if (this.count > 0) powerUps.research.changeRerolls(this.count) } }, { @@ -9288,7 +9378,7 @@ const tech = { }, { name: "reinforcement learning", - description: `10x current ${powerUps.orb.tech()} frequency`, + description: `10x frequency for current ${powerUps.orb.tech()}`, maxCount: 1, count: 0, frequency: 1, @@ -9430,7 +9520,7 @@ const tech = { if (tech.tech[i].isJunk) list.push(tech.tech[i].name) } let name = list[Math.floor(Math.random() * list.length)] - simulation.makeTextLog(`tech.giveTech("${name}")`); + simulation.inGameConsole(`tech.giveTech("${name}")`); tech.giveTech(name) } }, @@ -10179,7 +10269,7 @@ const tech = { }, { name: "probability", - description: `100x frequency
of a random ${powerUps.orb.tech()}`, + description: `100x frequency for
a random ${powerUps.orb.tech()}`, maxCount: 1, count: 0, frequency: 0, @@ -10273,7 +10363,7 @@ const tech = { effect() { setInterval(() => { let score = Math.ceil(1000 * Math.random() * Math.random() * Math.random() * Math.random() * Math.random()) - simulation.makeTextLog(`simulation.score = ${score.toFixed(0)}`); + simulation.inGameConsole(`simulation.score = ${score.toFixed(0)}`); }, 10000); //every 10 seconds }, remove() { } @@ -10350,7 +10440,7 @@ const tech = { }, { name: "repartitioning", - description: `set the frequency of finding nonJUNK-${powerUps.orb.tech()} to 0
spawn ${powerUps.orb.tech()}${powerUps.orb.tech()}${powerUps.orb.tech()}${powerUps.orb.tech()}${powerUps.orb.tech()}`, + description: `set the JUNK chance to 100%
spawn ${powerUps.orb.tech()}${powerUps.orb.tech()}${powerUps.orb.tech()}${powerUps.orb.tech()}${powerUps.orb.tech()}`, maxCount: 1, count: 0, frequency: 0, @@ -10361,13 +10451,7 @@ const tech = { }, requires: "", effect() { - for (let i = 0, len = tech.tech.length; i < len; i++) { - if (tech.tech[i].isJunk) { - tech.tech[i].frequency = 2 - } else { - tech.tech[i].frequency = 0 - } - } + tech.addJunkTechToPool(1) for (let i = 0; i < 5; i++) powerUps.spawn(m.pos.x, m.pos.y, "tech"); }, remove() { } @@ -11044,7 +11128,7 @@ const tech = { }, { name: "translucent", - description: `spawn ${powerUps.orb.gun()}${powerUps.orb.gun()}${powerUps.orb.gun()}
your bullets and bots are transparent`, + description: `spawn ${powerUps.orb.gun()}${powerUps.orb.gun()}${powerUps.orb.gun()}
your bullets and bots are transparent`, maxCount: 1, count: 0, frequency: 0, @@ -11121,7 +11205,7 @@ const tech = { m.energy = 0 spawn.suckerBoss(m.pos.x, m.pos.y - 700) powerUps.research.changeRerolls(-4) - simulation.makeTextLog(`m.research --
${powerUps.research.count}`) + simulation.inGameConsole(`m.research --
${powerUps.research.count}`) }, remove() { } }, @@ -11169,7 +11253,7 @@ const tech = { for (let i = 0; i < 20; i++) { spawn[this.mobType](m.pos.x, m.pos.y - 700) } - simulation.makeTextLog(`spawn.${this.mobType}(x,y)`) + simulation.inGameConsole(`spawn.${this.mobType}(x,y)`) }, remove() { } @@ -11344,6 +11428,24 @@ const tech = { return text }, }, + { + name: "wikipedia", + description: `After you get ${powerUps.orb.tech()} you have 7 seconds to study for a quiz. If you ace the quiz you get ${powerUps.orb.research(5)}`, + maxCount: 1, + count: 0, + frequency: 0, + isJunk: true, + allowed() { + return true + }, + requires: "", + effect() { + tech.isWiki = true; + }, + remove() { + tech.isWiki = false; + } + }, { name: "cosmogonic myth", description: `open a portal to a primordial version of reality
in 5 minutes close the portal, spawn 1 of each power up
`, @@ -11895,7 +11997,7 @@ const tech = { isClusterExplode: null, isCircleExplode: null, isPetalsExplode: null, - deathSkipTime: null, + isVerlet: null, isIceMaxHealthLoss: null, isIceKill: null, isCritKill: null, @@ -11953,5 +12055,6 @@ const tech = { isMaxHealthDefense: null, isNoDefenseDamage: null, isMaxHealthDamage: null, - ejectOld: null, + isEjectOld: null, + isWiki: null, } \ No newline at end of file diff --git a/style.css b/style.css index 5ccb90b..5c0ab6e 100644 --- a/style.css +++ b/style.css @@ -9,6 +9,7 @@ body { margin: 0; overflow: hidden; cursor: auto; + /* filter: grayscale(1); */ /* transition: background-color 0.2s ease-in-out; */ } @@ -285,7 +286,7 @@ summary { border: 1px solid #444; /* min-height: 88px; */ line-height: 100%; - background-color: #fff; + background-color: var(--card-color); } .sort-button { @@ -353,7 +354,6 @@ summary { .experiment-start-box { background-color: var(--card-color); - /* font-size: 1em; */ position: sticky; top: 0; z-index: 10; @@ -373,6 +373,7 @@ summary { padding: 0.2em 0px; /* height: 210px; */ box-shadow: 8px 8px 6px rgba(0, 0, 50, 0.15); + /* opacity: 0.1; */ } .card-background { @@ -385,7 +386,7 @@ summary { } .card-text { - background-color: rgba(255, 255, 255, 1); + background-color: var(--card-color); padding: 0.5em 1em; border: 1px solid #444; margin-top: -1px; @@ -570,7 +571,7 @@ summary { padding: 10px; border-radius: 8px; border: 2px #333 solid; - background-color: #fff; + background-color: var(--card-color); } @@ -669,14 +670,12 @@ summary { z-index: 2; font-size: 23px; color: #222; - /* background-color: rgba(255, 255, 255, 0.4); */ background-color: rgba(255, 255, 255, 0.2); line-height: 120%; user-select: none; pointer-events: none; padding: 0px 5px 0px 5px; border-radius: 5px; - /*border: 2px solid rgba(0, 0, 0, 0.4);*/ } #field { @@ -688,13 +687,11 @@ summary { color: #000; text-align: right; opacity: 0.7; - /* line-height: 140%; */ background-color: rgba(190, 210, 245, 0.25); user-select: none; pointer-events: none; padding: 0px 5px 0px 5px; border-radius: 5px; - /*border: 2px solid rgba(0, 0, 0, 0.4);*/ } #tech { @@ -726,10 +723,8 @@ summary { font-size: 1.15em; color: #555; background-color: rgba(255, 255, 255, 0.5); - /* transition: opacity 0.15s; */ pointer-events: none; user-select: none; - /* font-family: monospace; */ } .color-text { @@ -856,6 +851,8 @@ summary { text-shadow: 0px -5px 9px rgb(255, 0, 204); } + + .color-dup { font-variant: small-caps; letter-spacing: 1px; @@ -927,9 +924,24 @@ summary { font-weight: 100; } +.color-bot { + font-variant: small-caps; + background-color: rgba(75, 125, 150, 0.06); + border: 0.1em solid #146; + color: #146; + padding: 0em 0.3em 0.08em 0.3em; + font-weight: 400; +} + +.no-box { + border: none; + background-color: transparent; + padding: 0; +} + .color-block { - background-color: rgba(0, 0, 0, 0.04); - border: 1px solid rgba(0, 0, 0, 0.5); + background-color: rgba(0, 0, 0, 0.1); + border: 0.1em solid #333; padding: 0.5px; font-weight: 100; } @@ -978,20 +990,6 @@ summary { margin-bottom: -0.3em; } -.circle-grid-big { - /* width: 1.7em; - height: 1.7em; - border-radius: 50%; - display: inline-block; - margin-bottom: -0.5em -0.5em -0.5em -0.5em; */ - width: 1.32em; - height: 1.32em; - border-radius: 50%; - display: inline-block; - margin-bottom: -0.3em; - transform: scale(1.5); -} - .circle-grid-instant { width: 1.1em; height: 1.1em; @@ -999,7 +997,6 @@ summary { border: 0.15em solid hsl(255, 100%, 71%); display: inline-block; margin-bottom: -0.35em; - /* background-color: hsla(255, 100%, 71%, 0.3); */ } .circle-grid-skin { @@ -1013,7 +1010,6 @@ summary { position: absolute; top: -0.05em; left: 0em; - margin-bottom: -0.3em; } .circle-grid-skin-eye { @@ -1026,7 +1022,6 @@ summary { position: absolute; top: 0.45em; left: 0.9em; - margin-bottom: -0.3em; } .junk { @@ -1653,4 +1648,24 @@ summary { padding: 7px; margin-bottom: 10px; /* box-shadow: 4px 4px 4px hsla(240, 0%, 17%, 0.14); */ +} + +.tooltip {} + +.tooltip .tooltiptext { + visibility: hidden; + background-color: #fff; + border-radius: 0.3em; + padding: 0.2em 0.3em; + border: solid #000 1px; + + position: relative; + z-index: 1; + bottom: 100%; + left: 0%; + margin-left: -50%; +} + +.tooltip:hover .tooltiptext { + visibility: visible; } \ No newline at end of file diff --git a/todo.txt b/todo.txt index 301e51b..504eece 100644 --- a/todo.txt +++ b/todo.txt @@ -1,9 +1,34 @@ ******************************************************** NEXT PATCH ************************************************** -new level: flocculation +JUNK: wikipedia - After you get a new tech you have 7 seconds to study before a quiz, 4 research if you aces the quiz. + this code for this works 80% of the time every time -snakeBoss does 40% less damage to player +renamed propagator->Verlet integration it's now a skin tech + 1.6->3x damage + slightly increased the time skip amount +on some skins the feet will hang lower while player is in the air +on some skins the upper legs are skinnier +mouse over on orbs for tech, field, and gun has a tooltip with text +added keyword CSS style for "bot" +added an aura around powerUpBoss so you can kinda see it inside walls +quenching just gives max health from over healing instead of damaging you first +depolarization does 0.5->0.4x damage when on cooldown +many-worlds spawns a tech and also 3 coupling at the start of each new level +dynamic equilibrium does 1.15x more damage and only stacks to 9->3 +orbital bots collide with a 1.2x larger range +Zectron no longer drains energy when balls hit you, but the balls still stop +supply chain just gives a gun and a flat 10 ammo + +polyurethane foam will only trigger up to 55 total foam per harpoon + to prevent a huge number of foam bubbles causing lag + no cap for super balls for now +fixed bug with planned obsolescence + instant tech +fixed bug with ice crystal nucleation +applied science gives each gunTech with a short delay + this helps with sorting and maybe other rare bugs +fixed bug with delivery drones and path integration +you can no longer deflect snakeBoss, but it moves a bit slower ******************************************************** BUGS ******************************************************** @@ -12,10 +37,26 @@ ants marching outline on splash screen doesn't sync right on safari player can become crouched while not touching the ground if they exit the ground while crouched -fix door.isClosing actually meaning isClosed? - *********************************************************** TODO ***************************************************** +tech: - tech have +3 choices to eject your tech + tech name + no description? + +harpoon tech: - after firing 4 harpoons your next harpoon has 4x damage + need to track number fired + +JUNK tech - similar to cosmogonic myth, open and close tabs + after you learn a new tech open it's wiki and spawn a few research? + open the wiki for each tech you have, + tabs close after 1 minute, and you have to learn something and answer a prompt to get a reward + +tech: - instead of reeling in grappling hook teleport to the hook after releasing field button + this might need another buff? + give damage immunity after teleport for 1+ seconds to balance + +new level - rework testChamber + new snakeBoss type that eats mobs each time it eats: heal? @@ -475,7 +516,7 @@ add small SVG pics to in-game console when? one for each field? use stuff on physics notes: -simulation.makeTextLog(` +simulation.inGameConsole(` @@ -1268,6 +1309,7 @@ possible names for tech quasicrystals - something with low friction, maybe defense? Coalescence - things merging together like clouds. maybe mergin power ups? trihydrogen cation - common molecule in space, dark matter tech? + superradiance - laser tech ******************************************************* DESIGN ******************************************************
T