From c65e163b6f9cf9a75bb56200e591d8dc7f5ab56a Mon Sep 17 00:00:00 2001 From: landgreen Date: Tue, 10 May 2022 15:29:22 -0700 Subject: [PATCH] bug fixes bremsstrahlung does extra damage to shields bug fixes --- .DS_Store | Bin 6148 -> 6148 bytes js/bullet.js | 2 +- js/level.js | 4 ++-- js/player.js | 53 ++++++++++++++++++++++++++++++++++----------------- js/spawn.js | 1 + todo.txt | 8 +------- 6 files changed, 40 insertions(+), 28 deletions(-) diff --git a/.DS_Store b/.DS_Store index 7f37cd611c194d890aa7a4eecd17b1006a712195..bfc7e5eb44fd5c06d0e115b567f6d6f99f31b0e0 100644 GIT binary patch delta 21 ccmZoMXffEJ#mppOJXwd?k5OQAHFKv306(7vf&c&j delta 21 ccmZoMXffEJ#mpphXR;2nALEA2)y$nD080G^#Q*>R diff --git a/js/bullet.js b/js/bullet.js index 040301c..38c63ee 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -3202,7 +3202,7 @@ const b = { } } //aoe damage to mobs - const dmg = (0.12 + 0.04 * tech.isFastDrones) * m.dmgScale * tech.droneRadioDamage * tech.radioactiveDamage + let dmg = (0.12 + 0.04 * tech.isFastDrones) * m.dmgScale * tech.droneRadioDamage * tech.radioactiveDamage for (let i = 0, len = mob.length; i < len; i++) { if (Vector.magnitude(Vector.sub(mob[i].position, this.position)) < this.radioRadius + mob[i].radius) { if (Matter.Query.ray(map, mob[i].position, this.position).length > 0) dmg *= 0.25 //reduce damage if a wall is in the way diff --git a/js/level.js b/js/level.js index d3dba9b..ff6ea08 100644 --- a/js/level.js +++ b/js/level.js @@ -2648,8 +2648,8 @@ const level = { m.addHealth(Infinity) // spawn.starter(1900, -500, 200) //big boy - // for (let i = 0; i < 10; ++i) spawn.launcher(1900, -500) - spawn.slashBoss(1900, -500) + for (let i = 0; i < 10; ++i) spawn.launcher(1900, -500) + // spawn.slashBoss(1900, -500) // spawn.launcherBoss(3200, -500) // spawn.laserTargetingBoss(1700, -500) // spawn.powerUpBoss(1900, -500) diff --git a/js/player.js b/js/player.js index 0d92d28..53cb94c 100644 --- a/js/player.js +++ b/js/player.js @@ -1026,7 +1026,6 @@ const m = { y: Math.sin(m.angle) }; //the dot product of diff and dir will return how much over lap between the vectors - // console.log(Vector.dot(dir, diff)) if (Vector.dot(dir, diff) > m.fieldThreshold) { return true; } @@ -1046,7 +1045,6 @@ const m = { } }, // setMovement() { - // console.log('hi') // m.Fx = tech.baseFx * tech.squirrelFx * (tech.isFastTime ? 1.5 : 1); // m.jumpForce = tech.baseJumpForce * tech.squirrelJump * (tech.isFastTime ? 1.13 : 1) // }, @@ -1333,11 +1331,21 @@ const m = { const unit = Vector.normalise(Vector.sub(player.position, who.position)) if (tech.blockDmg) { Matter.Body.setVelocity(who, { x: 0.5 * who.velocity.x, y: 0.5 * who.velocity.y }); - if (tech.isBlockRadiation && !who.isShielded && !who.isMobBullet) { - mobs.statusDoT(who, tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12 + + if (who.isShielded) { + for (let i = 0, len = mob.length; i < len; i++) { + if (mob[i].id === who.shieldID) mob[i].damage(tech.blockDmg * m.dmgScale * (tech.isBlockRadiation ? 6 : 2), true) + } + } else if (tech.isBlockRadiation) { + if (who.isMobBullet) { + who.damage(tech.blockDmg * m.dmgScale * 3, true) + } else { + mobs.statusDoT(who, tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12 + } } else { who.damage(tech.blockDmg * m.dmgScale, true) } + //draw electricity const step = 40 ctx.beginPath(); @@ -1665,11 +1673,31 @@ const m = { } if (tech.blockDmg) { //electricity Matter.Body.setVelocity(mob[i], { x: 0.5 * mob[i].velocity.x, y: 0.5 * mob[i].velocity.y }); - if (tech.isBlockRadiation && !mob[i].isShielded && !mob[i].isMobBullet) { - mobs.statusDoT(mob[i], tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12 + + if (mob[i].isShielded) { + for (let j = 0, len = mob.length; j < len; j++) { + if (mob[j].id === mob[i].shieldID) mob[j].damage(tech.blockDmg * m.dmgScale * (tech.isBlockRadiation ? 6 : 2), true) + } + } else if (tech.isBlockRadiation) { + if (mob[i].isMobBullet) { + mob[i].damage(tech.blockDmg * m.dmgScale * 3, true) + } else { + mobs.statusDoT(mob[i], tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12 + } } else { - mob[i].damage(tech.blockDmg * m.dmgScale) + mob[i].damage(tech.blockDmg * m.dmgScale, true) } + // if (mob[i].isShielded) { + // for (let j = 0, len = mob.length; j < len; j++) { + // if (mob[j].id === mob[i].shieldID) mob[j].damage(tech.blockDmg * m.dmgScale * (tech.isBlockRadiation ? 3 : 1), true) + // } + // } else { + // if (tech.isBlockRadiation && !mob[i].isMobBullet) { + // mobs.statusDoT(mob[i], tech.blockDmg * m.dmgScale * 4 / 12, 360) //200% increase -> x (1+2) //over 7s -> 360/30 = 12 half seconds -> 3/12 + // } else { + // mob[i].damage(tech.blockDmg * m.dmgScale) + // } + // } const step = 40 ctx.beginPath(); for (let i = 0, len = 0.8 * tech.blockDmg; i < len; i++) { @@ -2160,7 +2188,6 @@ const m = { this.isPopping = false }, do() { - // console.log(this.circleRadius) if (this.isOn) { //collisions with map if (Matter.Query.collides(this, map).length > 0) { @@ -2327,10 +2354,7 @@ const m = { }); Composite.add(engine.world, m.plasmaBall); - // m.plasmaBall.startingVertices = m.plasmaBall.vertices.slice(); - // console.log(m.plasmaBall.startingVertices, m.plasmaBall.vertices) - m.hold = function() { if (m.isHolding) { m.drawHold(m.holdingTarget); @@ -2388,7 +2412,6 @@ const m = { // if (player.velocity.y > 7) player.force.y -= 0.95 * player.mass * simulation.g //less gravity when falling fast // player.force.y -= Math.min(0.95, 0.05 * floatScale) * player.mass * simulation.g; //undo some gravity on up or down - // console.log(friction) //float const slowY = (player.velocity.y > 0) ? Math.max(0.8, 1 - 0.002 * player.velocity.y * player.velocity.y) : Math.max(0.98, 1 - 0.001 * Math.abs(player.velocity.y)) //down : up @@ -2786,7 +2809,6 @@ const m = { // ctx.clip(); // } m.hold = function() { - // console.log(m.holdingTarget) if (m.isHolding) { m.drawHold(m.holdingTarget); m.holding(); @@ -3560,7 +3582,6 @@ const m = { // if (input.field && m.fieldCDcycle < m.cycle) { //not hold but field button is pressed // const justPastMouse = Vector.add(Vector.mult(Vector.normalise(Vector.sub(simulation.mouseInGame, m.pos)), 50), simulation.mouseInGame) // const scale = 60 - // // console.log(Matter.Query.region(map, bounds)) // const sub = Vector.sub(simulation.mouseInGame, m.pos) // const mag = Vector.magnitude(sub) // const drain = tech.isFreeWormHole ? 0 : 0.06 + 0.006 * Math.sqrt(mag) @@ -3778,7 +3799,6 @@ const m = { ] // Matter.Body.setVertices(player, Matter.Vertices.create(points, player)) - // console.log(circle) player.parts.pop() player.parts.pop() player.parts.pop() @@ -3793,9 +3813,7 @@ const m = { // const circle = Bodies.polygon(player.position.x, player.position.x, 30, 30) // player.parts[0] = circle - // console.log(player.parts[0]) // Matter.Body.setVertices(player.parts[0], Matter.Vertices.create(points, player.parts[0])) - // console.log(player.parts[0].vertices) m.spin = 0 // m.groundControl = () => {} //disable entering ground m.onGround = false @@ -3846,7 +3864,6 @@ const m = { m.Vy = player.velocity.y; //tracks the last 10s of player information - // console.log(m.history) m.history.splice(m.cycle % 600, 1, { position: { x: player.position.x, diff --git a/js/spawn.js b/js/spawn.js index 99a2a38..1cc99fd 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -5572,6 +5572,7 @@ const spawn = { me.shieldTargetID = target.id target.isShielded = true; + target.shieldID = me.id me.onDeath = function() { //clear isShielded status from target for (let i = 0, len = mob.length; i < len; i++) { diff --git a/todo.txt b/todo.txt index d722885..8e9b34a 100644 --- a/todo.txt +++ b/todo.txt @@ -1,13 +1,7 @@ ******************************************************** NEXT PATCH ************************************************** -tech: cherenkov radiation - bremsstrahlung damage is increased by 300% over 6 seconds - bremsstrahlung does 2->3 damage, and also applies to block collisions +bremsstrahlung does extra damage to shields -tech: nuclear transmutation - radiation sources do 70% more damage and harm - -enthalpy now drops heal power ups instead of directly healing you -foam-shot has 13->15 particles, is slower, and less spread - bug fixes ******************************************************** TODO ********************************************************