From 38d356e592cd0e477e95ae52e276e2d6e7416d2f Mon Sep 17 00:00:00 2001 From: landgreen Date: Wed, 27 Apr 2022 06:00:40 -0700 Subject: [PATCH] eternalism tech: eternalism - tech,gun,field gives an ammo but, time doesn't pause while choosing I might change the ammo to something else, not sure, maybe just damage JUNK tech: panpsychism - awaken blocks, blocks can drop power ups cache gives 14->16x ammo 1st ionization energy gives 8->10% max energy on heal powerUpBossBaby immunity phase is a bit shorter bug fixes --- .DS_Store | Bin 6148 -> 6148 bytes js/level.js | 12 ++-- js/player.js | 4 +- js/powerup.js | 103 ++++++++++++++++++-------------- js/spawn.js | 4 +- js/tech.js | 162 +++++++++++++++++++++++++++++++++++--------------- todo.txt | 22 +++++-- 7 files changed, 198 insertions(+), 109 deletions(-) diff --git a/.DS_Store b/.DS_Store index 3befd1d0ff53fb7828a413704c9ab449289377ae..d52b7c36c3d6570acb86287b34398872d26336f0 100644 GIT binary patch delta 22 dcmZoMXffEJ#msaiY_blsFO%|x&DG4EA^=pz2Sfk> delta 22 dcmZoMXffEJ#msd4z+@d}UnUiX&DG4EA^=pG2GRfk diff --git a/js/level.js b/js/level.js index 28d7292..0e05bf3 100644 --- a/js/level.js +++ b/js/level.js @@ -19,7 +19,7 @@ const level = { // m.setField("standing wave") // b.giveGuns("laser") // tech.giveTech("scrap-bot manufacturing") - // tech.giveTech("dynamo-bot upgrade") + // tech.giveTech("eternalism") // tech.giveTech("options exchange") // tech.giveTech("ICBM") // tech.giveTech("grappling hook") @@ -37,7 +37,7 @@ const level = { // m.immuneCycle = Infinity //you can't take damage // level.difficultyIncrease(15) //30 is near max on hard //60 is near max on why // simulation.enableConstructMode() //used to build maps in testing mode - // level.temple(); + // level.testChamber(); // level.testing(); //not in rotation, used for testing if (simulation.isTraining) { level.walk(); } else { level.intro(); } //normal starting level ************************************************ // powerUps.research.changeRerolls(3000) @@ -2671,8 +2671,8 @@ const level = { spawn.mapRect(level.exit.x, level.exit.y + 25, 100, 25); level.defaultZoom = 2000 simulation.zoomTransition(level.defaultZoom) - document.body.style.backgroundColor = "#d0d5df" //"#d8dadf"; - color.map = "#334046"; + document.body.style.backgroundColor = "#c3d6df" //"#d8dadf"; + color.map = "#303639"; // powerUps.spawnStartingPowerUps(1475, -1175); // spawn.debris(750, -2200, 3700, 16); //16 debris per level const button = level.button(1400, 0) @@ -3673,8 +3673,8 @@ const level = { spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 20); level.defaultZoom = 2200 simulation.zoomTransition(level.defaultZoom) - document.body.style.backgroundColor = "#d5d5d5"; - color.map = "#555" + document.body.style.backgroundColor = "#d0d5d5"; + color.map = "#444" spawn.mapRect(0, -1955, 175, 30); const removeIndex1 = map.length - 1 //so much work to catch blocks caught at the bottom of the vertical portals spawn.mapRect(1225, -1955, 175, 30); diff --git a/js/player.js b/js/player.js index b71f307..bb2eed4 100644 --- a/js/player.js +++ b/js/player.js @@ -1540,7 +1540,7 @@ const m = { const fieldRange2 = (0.68 + 0.37 * Math.sin(m.cycle / 37)) * m.fieldRange * m.harmonicRadius const fieldRange3 = (0.7 + 0.35 * Math.sin(m.cycle / 47)) * m.fieldRange * m.harmonicRadius const netfieldRange = Math.max(fieldRange1, fieldRange2, fieldRange3) - ctx.fillStyle = "rgba(110,170,200," + Math.min(0.73, (0.04 + m.energy * (0.11 + 0.13 * Math.random()))) + ")"; + ctx.fillStyle = "rgba(110,170,200," + Math.min(0.65, (0.04 + m.energy * (0.11 + 0.13 * Math.random()))) + ")"; ctx.beginPath(); ctx.arc(m.pos.x, m.pos.y, fieldRange1, 0, 2 * Math.PI); ctx.fill(); @@ -1571,7 +1571,7 @@ const m = { const radius = m.fieldRange * m.harmonicRadius ctx.lineWidth = 1; ctx.strokeStyle = "rgba(110,170,200,0.8)" - ctx.fillStyle = "rgba(110,170,200," + Math.min(0.7, m.energy * (0.13 + 0.1 * Math.random()) * (3 / tech.harmonics)) + ")"; + ctx.fillStyle = "rgba(110,170,200," + Math.min(0.65, m.energy * (0.13 + 0.1 * Math.random()) * (3 / tech.harmonics)) + ")"; // ctx.fillStyle = "rgba(110,170,200," + Math.min(0.7, m.energy * (0.22 - 0.01 * tech.harmonics) * (0.5 + 0.5 * Math.random())) + ")"; for (let i = 0; i < tech.harmonics; i++) { ctx.beginPath(); diff --git a/js/powerup.js b/js/powerup.js index 2060e6d..ebe65bd 100644 --- a/js/powerup.js +++ b/js/powerup.js @@ -262,15 +262,13 @@ const powerUps = { // document.getElementById("choose-background").style.visibility = "visible" // document.getElementById("choose-background").style.opacity = "0.8" // document.getElementById("choose-grid").style.display = "grid" - document.getElementById("choose-grid").style.transitionDuration = "0.25s"; - document.getElementById("choose-grid").style.visibility = "visible" - document.getElementById("choose-grid").style.opacity = "1" + //disable clicking for 1/2 a second to prevent mistake clicks document.getElementById("choose-grid").style.pointerEvents = "none"; document.body.style.cursor = "none"; setTimeout(() => { + if (!tech.isNoDraftPause) document.body.style.cursor = "auto"; document.getElementById("choose-grid").style.pointerEvents = "auto"; - document.body.style.cursor = "auto"; document.getElementById("choose-grid").style.transitionDuration = "0s"; }, 500); @@ -278,17 +276,27 @@ const powerUps = { // document.body.style.overflowY = "scroll"; // document.body.style.overflowX = "hidden"; // } - simulation.paused = true; simulation.isChoosing = true; //stops p from un pausing on key down - build.pauseGrid() - document.getElementById("pause-grid-right").style.opacity = "0.3" - document.getElementById("pause-grid-left").style.opacity = "0.3" - //hide health bar, guns, power ups list - requestAnimationFrame(() => { - ctx.fillStyle = `rgba(221,221,221,0.6)`; - ctx.fillRect(0, 0, canvas.width, canvas.height); - }); + if (!simulation.paused) { + if (tech.isNoDraftPause) { + powerUps.spawn(m.pos.x, m.pos.y, "ammo"); + document.getElementById("choose-grid").style.opacity = "0.7" + } else { + simulation.paused = true; + document.getElementById("choose-grid").style.opacity = "1" + } + document.getElementById("choose-grid").style.transitionDuration = "0.25s"; + document.getElementById("choose-grid").style.visibility = "visible" + + requestAnimationFrame(() => { + ctx.fillStyle = `rgba(221,221,221,0.6)`; + ctx.fillRect(0, 0, canvas.width, canvas.height); + }); + document.getElementById("pause-grid-right").style.opacity = "0.3" + document.getElementById("pause-grid-left").style.opacity = "0.3" + } + build.pauseGrid() }, endDraft(type, isCanceled = false) { //type should be a gun, tech, or field if (isCanceled) { @@ -342,11 +350,11 @@ const powerUps = { document.body.style.cursor = "none"; // document.body.style.overflow = "hidden" // if (m.alive){} + if (simulation.paused) requestAnimationFrame(cycle); simulation.paused = false; simulation.isChoosing = false; //stops p from un pausing on key down - if (m.immuneCycle < m.cycle + 15) m.immuneCycle = m.cycle + 15; //player is immune to damage for 30 cycles build.unPauseGrid() - requestAnimationFrame(cycle); + if (m.immuneCycle < m.cycle + 15) m.immuneCycle = m.cycle + 15; //player is immune to damage for 30 cycles if (m.holdingTarget) m.drop(); }, research: { @@ -489,7 +497,7 @@ const powerUps = { } if (tech.healGiveMaxEnergy) { - tech.healMaxEnergyBonus += 0.08 + tech.healMaxEnergyBonus += 0.1 m.setMaxEnergy(); } }, @@ -890,7 +898,7 @@ const powerUps = { powerUps.research.currentRerollCount = 0 if (tech.isTechDamage && who.name === "tech") m.damage(0.11) if (tech.isMassEnergy) m.energy += 2; - if (tech.isMineDrop && bullet.length < 150 && Math.random() < 0.60) { + if (tech.isMineDrop && bullet.length < 150 && Math.random() < 0.6) { if (tech.isLaserMine && input.down) { b.laserMine(who.position) } else { @@ -1012,38 +1020,41 @@ const powerUps = { } }, ejectTech(choose = 'random') { - //find which tech you have - if (choose === 'random') { - const have = [] - for (let i = 0; i < tech.tech.length; i++) { - if (tech.tech[i].count > 0 && !tech.tech[i].isNonRefundable) have.push(i) - } - if (have.length === 0) { + if (!simulation.isChoosing) + + + //find which tech you have + if (choose === 'random') { + const have = [] for (let i = 0; i < tech.tech.length; i++) { - if (tech.tech[i].count > 0) have.push(i) + if (tech.tech[i].count > 0 && !tech.tech[i].isNonRefundable) have.push(i) } - } - - if (have.length) { - choose = have[Math.floor(Math.random() * have.length)] - // simulation.makeTextLog(`
  ${tech.tech[choose].name} was ejected`, 600) //message about what tech was lost - simulation.makeTextLog(`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"); - // powerUp[powerUp.length - 1].isDuplicated = true + if (have.length === 0) { + for (let i = 0; i < tech.tech.length; i++) { + if (tech.tech[i].count > 0) have.push(i) + } } - // remove a random tech from the list of tech you have - tech.tech[choose].remove(); - tech.tech[choose].count = 0; - tech.tech[choose].isLost = true; - simulation.updateTechHUD(); - m.fieldCDcycle = m.cycle + 30; //disable field so you can't pick up the ejected tech - return true - } else { - return false - } - } else if (tech.tech[choose].count) { + + if (have.length) { + choose = have[Math.floor(Math.random() * have.length)] + // simulation.makeTextLog(`
  ${tech.tech[choose].name} was ejected`, 600) //message about what tech was lost + simulation.makeTextLog(`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"); + // powerUp[powerUp.length - 1].isDuplicated = true + } + // remove a random tech from the list of tech you have + tech.tech[choose].remove(); + tech.tech[choose].count = 0; + tech.tech[choose].isLost = true; + simulation.updateTechHUD(); + m.fieldCDcycle = m.cycle + 30; //disable field so you can't pick up the ejected tech + return true + } else { + return false + } + } else if (tech.tech[choose].count) { // simulation.makeTextLog(`
  ${tech.tech[choose].name} was ejected`, 600) //message about what tech was lost simulation.makeTextLog(`tech.remove("${tech.tech[choose].name}")`) diff --git a/js/spawn.js b/js/spawn.js index c0dbf37..3fced3f 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -1213,11 +1213,11 @@ const spawn = { } else if (!m.isCloak) { me.foundPlayer(); } - me.damageReduction = 0.22 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1) + me.damageReduction = 0.2 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1) me.isInvulnerable = true me.startingDamageReduction = me.damageReduction me.damageReduction = 0 - me.invulnerabilityCountDown = 60 + simulation.difficulty * 2 + me.invulnerabilityCountDown = 40 + simulation.difficulty me.onHit = function() { //run this function on hitting player if (powerUps.ejectTech()) { powerUps.ejectGraphic("150, 138, 255"); diff --git a/js/tech.js b/js/tech.js index ef47582..f9ad2c5 100644 --- a/js/tech.js +++ b/js/tech.js @@ -555,7 +555,7 @@ const tech = { { name: "cache", link: `cache`, - description: `${powerUps.orb.ammo()} give 14x more ammo, but
you can't store any more ammo than that`, + description: `${powerUps.orb.ammo()} give 16x more ammo, but
you can't store any more ammo than that`, // ammo powerups always max out your gun, // but the maximum ammo ti limited // description: `${powerUps.orb.ammo()} give 13x more ammo, but
you can't store any more ammo than that`, @@ -568,7 +568,7 @@ const tech = { }, requires: "not exciton", effect() { - tech.ammoCap = 14; + tech.ammoCap = 16; powerUps.ammo.effect() }, remove() { @@ -593,6 +593,25 @@ const tech = { tech.isAmmoFromHealth = false; } }, + { + name: "eternalism", + description: `choosing a field, tech, or gun spawns ${powerUps.orb.ammo()}
time doesn't pause while choosing`, //${powerUps.orb.heal()} or + // description: "increase damage by 50%, but time continues
while choosing a field, tech, or gun", + maxCount: 1, + count: 0, + frequency: 1, + frequencyDefault: 1, + allowed() { + return true + }, + requires: "", + effect() { + tech.isNoDraftPause = true + }, + remove() { + tech.isNoDraftPause = false + } + }, { name: "exciton", description: `increase damage by 88%, but
${powerUps.orb.ammo()} will no longer spawn`, @@ -2219,7 +2238,7 @@ const tech = { { name: "1st ionization energy", link: `1st ionization energy`, - description: `each ${powerUps.orb.heal()} you collect
increases your maximum energy by 8`, + description: `each ${powerUps.orb.heal()} you collect
increases your maximum energy by 10`, maxCount: 1, count: 0, frequency: 2, @@ -3480,8 +3499,8 @@ const tech = { description: `when you reach 111% duplication
spawn 11 bosses with 111% more health`, maxCount: 1, count: 0, - frequency: 10, - frequencyDefault: 10, + frequency: 6, + frequencyDefault: 6, isNonRefundable: true, allowed() { return tech.duplicationChance() > 0.6 @@ -4071,7 +4090,8 @@ const tech = { frequency: 2, frequencyDefault: 2, allowed() { - return tech.isMineDrop + tech.nailBotCount + tech.fragments + tech.nailsDeathMob / 2 + ((tech.haveGunCheck("mine") && !tech.isLaserMine) + (tech.haveGunCheck("nail gun") && !tech.isShieldPierce) + tech.isNeedles + tech.isNailShot) * 2 > 1 + // return tech.isMineDrop + tech.nailBotCount + tech.fragments + tech.nailsDeathMob / 2 + ((tech.haveGunCheck("mine") && !tech.isLaserMine) + (tech.haveGunCheck("nail gun") && !tech.isShieldPierce) + tech.isNeedles + tech.isNailShot) * 2 > 1 + return tech.isMineDrop || tech.nailBotCount || tech.fragments || tech.nailsDeathMob || (tech.haveGunCheck("mine") && !tech.isLaserMine) || (tech.haveGunCheck("nail gun") && !tech.isShieldPierce) || (tech.haveGunCheck("shotgun") && (tech.isNeedles || tech.isNailShot)) }, requires: "nail gun, nails, rivets, mine, not ceramic needles", effect() { @@ -7631,6 +7651,74 @@ const tech = { // }, // remove() {} // }, + { + name: "panpsychism", + description: "awaken all blocks
blocks have a chance to spawn random power ups", + maxCount: 1, + count: 0, + frequency: 0, + isJunk: true, + isNonRefundable: true, + allowed() { + return true + }, + requires: "", + effect() { + setInterval(() => { + for (let i = body.length - 1; i > -1; i--) { + if (!body[i].isNotHoldable) { + Matter.Composite.remove(engine.world, body[i]); + spawn.blockMob(body[i].position.x, body[i].position.y, body[i], 0); + if (!body[i].isAboutToBeRemoved) mob[mob.length - 1].isDropPowerUp = true + body.splice(i, 1); + } + } + }, 6000); + }, + remove() {} + }, + { + name: "meteor shower", + description: "take a shower, but meteors instead of water", + maxCount: 1, + count: 0, + frequency: 0, + isJunk: true, + isNonRefundable: true, + allowed() { + return true + }, + requires: "", + effect() { + setInterval(() => { + + fireBlock = function(xPos, yPos) { + const index = body.length + spawn.bodyRect(xPos, yPos, 20 + 50 * Math.random(), 20 + 50 * Math.random()); + const bodyBullet = body[index] + Matter.Body.setVelocity(bodyBullet, { x: 5 * (Math.random() - 0.5), y: 10 * (Math.random() - 0.5) }); + bodyBullet.isAboutToBeRemoved = true + bodyBullet.collisionFilter.category = cat.body; + bodyBullet.collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet + bodyBullet.classType = "body"; + Composite.add(engine.world, bodyBullet); //add to world + setTimeout(() => { //remove block + for (let i = 0; i < body.length; i++) { + if (body[i] === bodyBullet) { + Matter.Composite.remove(engine.world, body[i]); + body.splice(i, 1); + } + } + }, 4000 + Math.floor(9000 * Math.random())); + } + fireBlock(player.position.x + 600 * (Math.random() - 0.5), player.position.y - 500 - 500 * Math.random()); + // for (let i = 0, len = Math.random(); i < len; i++) { + // } + + }, 1000); + }, + remove() {} + }, { name: "discount", description: "get 3 random JUNK tech for the price of 1!", @@ -7668,47 +7756,6 @@ const tech = { // }, // remove() {} // }, - { - name: "meteor shower", - description: "take a shower, but meteors instead of water", - maxCount: 1, - count: 0, - frequency: 0, - isJunk: true, - isNonRefundable: true, - allowed() { - return true - }, - requires: "", - effect() { - setInterval(() => { - - fireBlock = function(xPos, yPos) { - const index = body.length - spawn.bodyRect(xPos, yPos, 20 + 50 * Math.random(), 20 + 50 * Math.random()); - const bodyBullet = body[body.length - 1] - Matter.Body.setVelocity(body[index], { x: 5 * (Math.random() - 0.5), y: 10 * (Math.random() - 0.5) }); - body[index].collisionFilter.category = cat.body; - body[index].collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet - body[index].classType = "body"; - Composite.add(engine.world, body[index]); //add to world - setTimeout(() => { //remove block - for (let i = 0; i < body.length; i++) { - if (body[i] === bodyBullet) { - Matter.Composite.remove(engine.world, body[i]); - body.splice(i, 1); - } - } - }, 3000 + Math.floor(6000 * Math.random())); - } - fireBlock(player.position.x + 600 * (Math.random() - 0.5), player.position.y - 500 - 500 * Math.random()); - // for (let i = 0, len = Math.random(); i < len; i++) { - // } - - }, 1000); - }, - remove() {} - }, { name: "Higgs phase transition", description: "instantly spawn 5 tech, but add a chance to
remove everything with a 5 minute half-life", @@ -7774,6 +7821,25 @@ const tech = { }, remove() {} }, + { + name: "opacity", + description: "", + maxCount: 1, + count: 0, + frequency: 0, + frequencyDefault: 0, + isJunk: true, + allowed() { + return true + }, + requires: "", + effect() { + + }, + remove() { + + } + }, { name: "brainstorm", description: "the tech choice menu randomizes
every 0.5 seconds for 10 seconds", @@ -9828,5 +9894,5 @@ const tech = { isRelayEnergy: null, coyoteTime: null, missileFireCD: null, - isBotField: null + isBotField: null, } \ No newline at end of file diff --git a/todo.txt b/todo.txt index a990916..5a7bc11 100644 --- a/todo.txt +++ b/todo.txt @@ -1,17 +1,29 @@ ******************************************************** NEXT PATCH ************************************************** -you can scroll through the tech and gun menus while selecting power ups -added another classic n-gon option in settings +tech: eternalism - tech,gun,field gives an ammo but, time doesn't pause while choosing + I might change the ammo to something else, not sure, maybe just damage +JUNK tech: panpsychism - awaken blocks, blocks can drop power ups -tech: options exchange - canceling tech,gun,field has a 90% chance for a reroll +cache gives 14->16x ammo +1st ionization energy gives 8->10% max energy on heal -stabber mobs now stab 15% shorter distance, but they can stab more often -weak interaction gives 5->10 max energy per unused power up +powerUpBossBaby immunity phase is a bit shorter bug fixes ******************************************************** TODO ******************************************************** +tech: - don't pause time during draft + bugs + requirements change after draft is generated + disable effects that change requirements + when simulation.isChoosing you can't: eject tech, + check for requirements onclick and give random tech if not met? + +make lasers on labs flash on and off + make switch a button that stays down + + nonrefundable tech don't display, this is confusing maybe they can show up but greyed out or something