From e4443aa10a7726f9a8e2f243dd3b0714f67ed731 Mon Sep 17 00:00:00 2001 From: landgreen Date: Fri, 25 Mar 2022 05:43:25 -0700 Subject: [PATCH] tech debt negative fix plasma ball moves faster grows/drains extra fast when you have excess energy bug: technical debt no longer produces negative damage at high tech levels maybe this was causing the NaN position bug? --- .DS_Store | Bin 6148 -> 6148 bytes js/level.js | 4 ++-- js/player.js | 34 +++++++++++++++++++++------------- js/tech.js | 17 +++++++++-------- todo.txt | 15 ++++++++++----- 5 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.DS_Store b/.DS_Store index 17ba4561ac148a3cb8ce8ffb9da4c4cf16b21d82..760bd30b360168ef7bacc5894393f07f7f0907c6 100644 GIT binary patch delta 21 ccmZoMXffEJ#mw|oV6qOgALE71)y$nD08O+8`~Uy| delta 21 ccmZoMXffEJ#mw~K`eYquKgNK~)y$nD08_^YJ^%m! diff --git a/js/level.js b/js/level.js index 5a0d475..67d8451 100644 --- a/js/level.js +++ b/js/level.js @@ -25,8 +25,8 @@ const level = { // powerUps.research.changeRerolls(100000) // for (let i = 0; i < 2; i++) tech.giveTech("undefined") // tech.tech[297].frequency = 100 - m.setField("plasma torch") - tech.giveTech("plasma ball") + // m.setField("plasma torch") + // tech.giveTech("plasma ball") // m.immuneCycle = Infinity //you can't take damage // level.difficultyIncrease(30) //30 is near max on hard //60 is near max on why diff --git a/js/player.js b/js/player.js index 84512f7..1d7c66b 100644 --- a/js/player.js +++ b/js/player.js @@ -2115,14 +2115,14 @@ const m = { }, fire() { this.isAttached = false; - const speed = 4 //scale with mass? + const speed = 6 //scale with mass? // Matter.Body.setVelocity(this, { // x: speed * Math.cos(m.angle), // y: speed * Math.sin(m.angle) // }); Matter.Body.setVelocity(this, { x: player.velocity.x * 0.5 + speed * Math.cos(m.angle), - y: player.velocity.y * 0.2 + speed * Math.sin(m.angle) + y: player.velocity.y * 0.1 + speed * Math.sin(m.angle) }); m.plasmaBall.setPositionToNose() }, @@ -2134,13 +2134,17 @@ const m = { if (this.isOn) { //collisions with map if (Matter.Query.collides(this, map).length > 0) { - this.scale(Math.max(0.9, 0.98 - 0.05 / m.plasmaBall.circleRadius)) - if (this.speed > 2.5) { - const scale = 0.96 - Matter.Body.setVelocity(this, { - x: scale * this.velocity.x, - y: scale * this.velocity.y - }); + if (this.isAttached) { + this.scale(Math.max(0.9, 1 - 0.05 / m.plasmaBall.circleRadius)) + } else { + this.scale(Math.max(0.9, 0.98 - 0.05 / m.plasmaBall.circleRadius)) + if (this.speed > 2.5) { + const scale = 0.96 + Matter.Body.setVelocity(this, { + x: scale * this.velocity.x, + y: scale * this.velocity.y + }); + } } } //collisions with mobs @@ -2157,7 +2161,7 @@ const m = { } } //slowly slow down if too fast - if (this.speed > 6) { + if (this.speed > 8) { const scale = 0.997 Matter.Body.setVelocity(this, { x: scale * this.velocity.x, @@ -2229,15 +2233,19 @@ const m = { } } else if (m.energy > m.plasmaBall.drain) { //charge up when attached if (tech.isCapacitor) { - m.energy -= m.plasmaBall.drain * 4; - const scale = 1 + 5 * 16 * Math.pow(Math.max(1, m.plasmaBall.circleRadius), -1.8) + m.energy -= m.plasmaBall.drain * 2; + const scale = 1 + 3 * 16 * Math.pow(Math.max(1, m.plasmaBall.circleRadius), -1.8) Matter.Body.scale(m.plasmaBall, scale, scale); //grow - } else { m.energy -= m.plasmaBall.drain; const scale = 1 + 16 * Math.pow(Math.max(1, m.plasmaBall.circleRadius), -1.8) Matter.Body.scale(m.plasmaBall, scale, scale); //grow } + if (m.energy > m.maxEnergy) { + m.energy -= m.plasmaBall.drain; + const scale = 1 + 16 * Math.pow(Math.max(1, m.plasmaBall.circleRadius), -1.8) + Matter.Body.scale(m.plasmaBall, scale, scale); //grow + } m.plasmaBall.setPositionToNose() //add friction for player when holding ball, maybe more friction in vertical diff --git a/js/tech.js b/js/tech.js index 1ddb588..a669253 100644 --- a/js/tech.js +++ b/js/tech.js @@ -212,7 +212,7 @@ const tech = { }, damageFromTech() { let dmg = 1 //m.fieldDamage - if (tech.isTechDebt) dmg *= 4 - 0.15 * tech.totalCount + if (tech.isTechDebt) dmg *= Math.max(41 / (tech.totalCount + 21), 4 - 0.15 * tech.totalCount) if (tech.isAxion && tech.isHarmMACHO) dmg *= 1 + 0.75 * (1 - m.harmReduction()) if (tech.OccamDamage) dmg *= tech.OccamDamage if (tech.isCloakingDamage) dmg *= 1.35 @@ -543,7 +543,7 @@ const tech = { { name: "cache", link: `cache`, - description: `${powerUps.orb.ammo()} give 13x more ammo, but
you can't store any more ammo than that`, + description: `${powerUps.orb.ammo()} give 14x 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`, @@ -556,7 +556,7 @@ const tech = { }, requires: "not exciton", effect() { - tech.ammoCap = 13; + tech.ammoCap = 14; powerUps.ammo.effect() }, remove() { @@ -3089,7 +3089,8 @@ const tech = { // description: `increase damage by 300% minus 10% for tech you have learned(${4 - 0.1 * tech.totalCount})`, // description: `increase damage by 300%, but reduce damage
by 10% for tech you have learned`, descriptionFunction() { - return `increase damage by 300% minus 15%
for each tech you have learned (${Math.floor(100*(4 - 0.14 * tech.totalCount))-100}%)` + // return `increase damage by 300% minus 15%
for each tech you have learned (${Math.floor(100*(4 - 0.14 * tech.totalCount))-100}%)` + return `increase damage by 300% minus 15%
for each tech you have learned (${Math.floor(100*(Math.max(41 / (tech.totalCount + 21), 4 - 0.15 * tech.totalCount) ))-100}%)` }, maxCount: 1, count: 0, @@ -6622,9 +6623,9 @@ const tech = { frequency: 2, frequencyDefault: 2, allowed() { - return (tech.plasmaBotCount || m.fieldUpgrades[m.fieldMode].name === "plasma torch") && (build.isExperimentSelection || powerUps.research.count > 1) + return (tech.plasmaBotCount || m.fieldUpgrades[m.fieldMode].name === "plasma torch") && (build.isExperimentSelection || powerUps.research.count > 1) && !tech.isPlasmaBall }, - requires: "plasma torch", + requires: "plasma torch, not plasma ball", effect() { tech.isPlasmaRange += 0.5; for (let i = 0; i < 2; i++) { @@ -6645,9 +6646,9 @@ const tech = { frequency: 2, frequencyDefault: 2, allowed() { - return m.fieldUpgrades[m.fieldMode].name === "plasma torch" && !tech.isExtruder + return m.fieldUpgrades[m.fieldMode].name === "plasma torch" && !tech.isExtruder && tech.isPlasmaRange === 1 }, - requires: "plasma torch, not extruder", + requires: "plasma torch, not extruder, plasma jet", effect() { tech.isPlasmaBall = true; m.fieldUpgrades[m.fieldMode].set() diff --git a/todo.txt b/todo.txt index f1c06b6..b911fad 100644 --- a/todo.txt +++ b/todo.txt @@ -1,18 +1,23 @@ ******************************************************** NEXT PATCH ************************************************** -enthalpy: 3->2% heal from damage done -technical debt: 8->15% less damage for each tech +plasma ball + moves faster + grows/drains extra fast when you have excess energy + +bug: technical debt no longer produces negative damage at high tech levels + maybe this was causing the NaN position bug? ******************************************************** TODO ******************************************************** + plasma ball - maybe grow faster when you have more energy - or excess energy + damage is fine + disable plasma torch tech with no effect on plasma ball change size/alpha when touching mobs explode when touching mobs like spirit bomb? player angle rotation speed while firing adds to fire speed tech upgrade to get electrical arcs that randomly damage nearby mobs - use plasma jet tech? + could work for all branches of plasma torch tech: black hole: gives the plasma ball gravity plasma orb increases in size and power as it eats enemies maybe does damage to player to grow faster?