From 4b50f080563ad648843139040eac8afab0a07c96 Mon Sep 17 00:00:00 2001 From: landgreen Date: Tue, 16 Mar 2021 20:33:14 -0700 Subject: [PATCH] level boss health rework level bosses will do about 50% less damage on collisions, but they will take about 33% more to kill fixed and renamed the new drone tech --- .DS_Store | Bin 6148 -> 6148 bytes js/bullet.js | 8 ++++---- js/mob.js | 1 + js/simulation.js | 6 +++--- js/spawn.js | 37 +++++++++++++++++-------------------- js/tech.js | 13 ++++++++----- todo.txt | 12 ++++-------- 7 files changed, 37 insertions(+), 40 deletions(-) diff --git a/.DS_Store b/.DS_Store index 7a51ec22395fc98346c0346df2360726bfcdd316..d995010de9d709fed84f4c1fe6087f83f771bb74 100644 GIT binary patch delta 94 zcmZoMXffEJ#T;1nn1O+Ti6M)jI5*$LB`GIA3CQPo&hNhY%>P4<2)PuTas?TN!O8i# R1wge748j*SS2K5t002N&8~XqN delta 94 zcmZoMXffEJ#T=Nqoq>UYi6M)jI5*$LB`GIA3CQQT=4R0Qcw`i~s-t diff --git a/js/bullet.js b/js/bullet.js index 68d2462..152df4f 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -2109,11 +2109,11 @@ const b = { powerUp.splice(i, 1); if (tech.isDroneGrab) { this.isImproved = true; - const SCALE = 2.5 + const SCALE = 2.25 Matter.Body.scale(this, SCALE, SCALE); - this.lookFrequency = 30; - this.endCycle += 2500 - this.frictionAir = 0 + this.lookFrequency = 30 + Math.floor(11 * Math.random()); + this.endCycle += 3000 * tech.droneCycleReduction * tech.isBulletsLastLonger + // this.frictionAir = 0 } break; } diff --git a/js/mob.js b/js/mob.js index 2e78b5c..0a2a7a0 100644 --- a/js/mob.js +++ b/js/mob.js @@ -1006,6 +1006,7 @@ const mobs = { //mobs specific damage changes if (tech.isFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(500, Math.min(3000, this.distanceToPlayer())) - 500) * 0.0067 //up to 50% dmg at max range of 3500 if (this.shield) dmg *= 0.075 + if (this.isBoss) dmg *= 0.25 //energy and heal drain should be calculated after damage boosts if (tech.energySiphon && dmg !== Infinity && this.dropPowerUp) m.energy += Math.min(this.health, dmg) * tech.energySiphon diff --git a/js/simulation.js b/js/simulation.js index 617ba52..f8a4bd3 100644 --- a/js/simulation.js +++ b/js/simulation.js @@ -243,8 +243,8 @@ const simulation = { }, drawList: [], //so you can draw a first frame of explosions.. I know this is bad drawTime: 8, //how long circles are drawn. use to push into drawlist.time - mobDmgColor: "rgba(255,0,0,0.7)", //used top push into drawList.color - playerDmgColor: "rgba(0,0,0,0.7)", //used top push into drawList.color + mobDmgColor: "rgba(255,0,0,0.7)", //color when a mob damages the player // set by mass-energy tech + playerDmgColor: "rgba(0,0,0,0.7)", //color when the player damages a mob drawCircle() { //draws a circle for two cycles, used for showing damage mostly let i = simulation.drawList.length; @@ -1007,7 +1007,7 @@ const simulation = { for (let i = 0, len = cons.length; i < len; ++i) { ctx.moveTo(cons[i].pointA.x, cons[i].pointA.y); ctx.lineTo(cons[i].bodyB.position.x, cons[i].bodyB.position.y); - // ctx.lineTo(cons[i].bodyB.position.x + cons[i].pointB.x, cons[i].bodyB.position.y + cons[i].pointB.y); + ctx.lineTo(cons[i].bodyB.position.x + cons[i].pointB.x, cons[i].bodyB.position.y + cons[i].pointB.y); } for (let i = 0, len = consBB.length; i < len; ++i) { ctx.moveTo(consBB[i].bodyA.position.x, consBB[i].bodyA.position.y); diff --git a/js/spawn.js b/js/spawn.js index a132e80..adb89f6 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -96,7 +96,7 @@ const spawn = { me.frictionAir = 0.01; me.memory = Infinity; me.locatePlayer(); - const density = 0.85 + const density = 0.25 Matter.Body.setDensity(me, density); //extra dense //normal is 0.001 //makes effective life much larger // spawn.shield(me, x, y, 1); me.onDeath = function() { @@ -530,7 +530,7 @@ const spawn = { me.seeAtDistance2 = 1400000; me.cellMassMax = 70 me.collisionFilter.mask = cat.player | cat.bullet //| cat.map | cat.body - Matter.Body.setDensity(me, 0.001) // normal density is 0.001 // this reduces life by half and decreases knockback + Matter.Body.setDensity(me, 0.00035) // normal density is 0.001 // this reduces life by half and decreases knockback const k = 642 //k=r^2/m me.split = function() { Matter.Body.scale(this, 0.4, 0.4); @@ -595,7 +595,7 @@ const spawn = { me.frictionAir = 0.01 me.seeAtDistance2 = 1000000; me.accelMag = 0.0005 * simulation.accelScale; - Matter.Body.setDensity(me, 0.001); //normal is 0.001 + Matter.Body.setDensity(me, 0.00035); //normal is 0.001 me.collisionFilter.mask = cat.bullet | cat.player me.memory = Infinity; me.seePlayerFreq = 30 @@ -909,7 +909,7 @@ const spawn = { me.collisionFilter.mask = cat.player | cat.bullet // me.frictionAir = 0.005; me.memory = 1600; - Matter.Body.setDensity(me, 0.075); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger me.onDeath = function() { //applying forces to player doesn't seem to work inside this method, not sure why powerUps.spawnBossPowerUp(this.position.x, this.position.y) @@ -1009,7 +1009,7 @@ const spawn = { let targets = [] //track who is in the node boss, for shields mobs.spawn(x, y, 6, radius, "#b386e8"); let me = mob[mob.length - 1]; - Matter.Body.setDensity(me, 0.003); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.0015); //extra dense //normal is 0.001 //makes effective life much larger me.isBoss = true; targets.push(me.id) //add to shield protection me.friction = 0; @@ -1103,7 +1103,7 @@ const spawn = { // me.frictionAir = 0.005; // me.memory = 1600; // Matter.Body.setDensity(me, 0.02); //extra dense //normal is 0.001 //makes effective life much larger - Matter.Body.setDensity(me, 0.0015 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.0005 + 0.00018 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger spawn.shield(me, x, y, 1); @@ -1353,14 +1353,12 @@ const spawn = { me.frictionAir = 0.01; me.frictionStatic = 0; me.friction = 0; - me.lookTorque = 0.000001 * (Math.random() > 0.5 ? -1 : 1); - me.fireDir = { x: 0, y: 0 } - Matter.Body.setDensity(me, 0.023); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.008); //extra dense //normal is 0.001 //makes effective life much larger spawn.shield(me, x, y, 1); spawn.spawnOrbitals(me, radius + 200 + 300 * Math.random()) me.onHit = function() { @@ -1493,7 +1491,7 @@ const spawn = { me.pulseRadius = Math.min(500, 230 + simulation.difficulty * 3) me.fireDelay = Math.max(60, 140 - simulation.difficulty * 2) me.isFiring = false - Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.01); //extra dense //normal is 0.001 //makes effective life much larger me.isBoss = true; spawn.shield(me, x, y, 1); spawn.spawnOrbitals(me, radius + 200 + 300 * Math.random(), 1) @@ -1725,7 +1723,7 @@ const spawn = { me.frictionAir = 0.03; // me.torque -= me.inertia * 0.002 spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random()) - Matter.Body.setDensity(me, 0.05); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger // spawn.shield(me, x, y, 1); //not working, not sure why me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) @@ -2138,7 +2136,7 @@ const spawn = { mobs.spawn(x, y, 3, radius, "rgba(255,0,200,0.5)"); let me = mob[mob.length - 1]; me.isBoss = true; - Matter.Body.setDensity(me, 0.004 + 0.00035 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.002 + 0.0001 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger me.stroke = "transparent"; //used for drawGhost me.seeAtDistance2 = 1500000; @@ -2230,7 +2228,7 @@ const spawn = { x: 0, y: 0 }; - Matter.Body.setDensity(me, 0.03 + 0.0008 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.01 + 0.0003 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed @@ -2499,7 +2497,7 @@ const spawn = { spawn.shield(me, x, y, 1); spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random()) - Matter.Body.setDensity(me, 0.004 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.002 + 0.0002 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed @@ -2539,7 +2537,7 @@ const spawn = { spawn.shield(me, x, y, 1); spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random()) - Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.01); //extra dense //normal is 0.001 //makes effective life much larger me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed @@ -2600,7 +2598,7 @@ const spawn = { spawn.shield(me, x, y, 1); spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random()) - Matter.Body.setDensity(me, 0.025); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.01); //extra dense //normal is 0.001 //makes effective life much larger me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed @@ -2751,7 +2749,7 @@ const spawn = { me.accelMag = 0.00075 * simulation.accelScale; me.memory = 250; me.laserRange = 500; - Matter.Body.setDensity(me, 0.0015 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.001 + 0.0001 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger me.onDeath = function() { powerUps.spawnBossPowerUp(this.position.x, this.position.y) for (let i = 0; i < mob.length; i++) { //wake up tail mobs @@ -2836,8 +2834,7 @@ const spawn = { me.g = 0.0001; //required if using 'gravity' me.accelMag = 0.002 * simulation.accelScale; me.memory = 20; - Matter.Body.setDensity(me, 0.001 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger - + Matter.Body.setDensity(me, 0.0005 + 0.0002 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger cons[cons.length] = Constraint.create({ pointA: { @@ -2997,7 +2994,7 @@ const spawn = { mobs.spawn(x, y, nodes, radius, "rgb(255,0,150)"); let me = mob[mob.length - 1]; me.isBoss = true; - Matter.Body.setDensity(me, 0.004 + 0.00035 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger + Matter.Body.setDensity(me, 0.002 + 0.00015 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger me.stroke = "transparent"; //used for drawGhost me.seeAtDistance2 = 2000000; diff --git a/js/tech.js b/js/tech.js index 50db686..7c806fe 100644 --- a/js/tech.js +++ b/js/tech.js @@ -1748,6 +1748,7 @@ document.getElementById("health-bg").style.display = "none" document.getElementById("dmg").style.backgroundColor = "#0cf"; tech.isEnergyHealth = true; + simulation.mobDmgColor = "rgba(14, 190, 235,0.7)" //"#0cf" m.displayHealth(); }, remove() { @@ -1756,6 +1757,7 @@ document.getElementById("health-bg").style.display = "inline" document.getElementById("dmg").style.backgroundColor = "#f67"; m.health = Math.max(Math.min(m.maxHealth, m.energy), 0.1); + simulation.mobDmgColor = "rgba(0,0,0,0.7)" m.displayHealth(); } }, { @@ -3586,8 +3588,8 @@ tech.isFastDrones = false } }, { - name: "harvester", - description: "after a drone picks up a power up,
it's larger, faster, and very durable", + name: "delivery drone", + description: "if a drone picks up a power up,
it becomes larger, faster, and more durable", isGunTech: true, maxCount: 1, count: 0, @@ -3603,7 +3605,7 @@ tech.isDroneGrab = false } }, { - name: "planned obsolescence", + name: "reduced tolerances", description: "reduce all drone production costs by 300%
reduce the average drone lifetime by 53%", isGunTech: true, maxCount: 3, @@ -3614,8 +3616,9 @@ }, requires: "drones", effect() { - tech.droneCycleReduction = Math.pow(0.47, this.count) - tech.droneEnergyReduction = Math.pow(0.33, this.count) + tech.droneCycleReduction = Math.pow(0.47, 1 + this.count) + tech.droneEnergyReduction = Math.pow(0.33, 1 + this.count) + console.log(tech.droneCycleReduction, tech.droneEnergyReduction) for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "drones") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * Math.pow(3, this.count) } diff --git a/todo.txt b/todo.txt index cc2209b..52f8a61 100644 --- a/todo.txt +++ b/todo.txt @@ -1,14 +1,8 @@ ******************************************************** NEXT PATCH ******************************************************** -bug fixes - strong anthropic principle does 0.03599% more damage - spores can stick to rotating blocks now - probably fixed the new wormhole field while targeting a block -> crouch lock bug - ceramic needles now correctly bypass shields +level bosses will do about 50% less damage on collisions, but they will take about 33% more to kill -needles fire 3 at a time with a short delay and no spread - -tech: planned obsolescence - 3x drone ammo, 1/3 drone nano-scale energy cost, but 53% reduced drone life span +fixed and renamed the new drone tech ******************************************************** BUGS ******************************************************** @@ -41,6 +35,8 @@ fix door.isOpen actually meaning isClosed? ******************************************************** TODO ******************************************************** +damage circles when you have MEE should be field color + mob vision: look at player history build a new type of attraction for mobs if mobs can't see player, they check to see if they can see where the player was in the history