diff --git a/js/bullet.js b/js/bullet.js index 9af9d00..0754ce2 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -365,23 +365,25 @@ const b = { }); //player damage and knock back - sub = Vector.sub(where, player.position); - dist = Vector.magnitude(sub); + if (m.immuneCycle < m.cycle) { + sub = Vector.sub(where, player.position); + dist = Vector.magnitude(sub); - if (dist < radius) { - if (tech.isImmuneExplosion) { - const mitigate = Math.min(1, Math.max(1 - m.energy * 0.7, 0)) - m.damage(mitigate * radius * (tech.isExplosionHarm ? 0.0004 : 0.0001)); - } else { - m.damage(radius * (tech.isExplosionHarm ? 0.0004 : 0.0001)); + if (dist < radius) { + if (tech.isImmuneExplosion) { + const mitigate = Math.min(1, Math.max(1 - m.energy * 0.7, 0)) + m.damage(mitigate * radius * (tech.isExplosionHarm ? 0.0004 : 0.0001)); + } else { + m.damage(radius * (tech.isExplosionHarm ? 0.0004 : 0.0001)); + } + knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.013); + player.force.x += knock.x; + player.force.y += knock.y; + } else if (dist < alertRange) { + knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.005); + player.force.x += knock.x; + player.force.y += knock.y; } - knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.013); - player.force.x += knock.x; - player.force.y += knock.y; - } else if (dist < alertRange) { - knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.005); - player.force.x += knock.x; - player.force.y += knock.y; } //body knock backs @@ -1237,13 +1239,14 @@ const b = { let dmg = this.dmg / Math.min(10, q[i].mass) q[i].damage(dmg); q[i].foundPlayer(); - simulation.drawList.push({ //add dmg to draw queue - x: this.position.x, - y: this.position.y, - radius: Math.log(2 * dmg + 1.1) * 40, - color: "rgba(255, 0, 119, 0.5)", - time: simulation.drawTime - }); + //removed to improve performance + // simulation.drawList.push({ //add dmg to draw queue + // x: this.position.x, + // y: this.position.y, + // radius: Math.log(2 * dmg + 1.1) * 40, + // color: "rgba(255, 0, 119, 0.5)", + // time: simulation.drawTime + // }); } } this.cycle++ @@ -2276,7 +2279,7 @@ const b = { Matter.Body.scale(this, SCALE, SCALE); this.radius *= SCALE; } else { - this.force.y += this.mass * 0.00008; //gravity + this.force.y += this.mass * tech.foamGravity; //gravity if (tech.isFoamAttract) { for (let i = 0, len = mob.length; i < len; i++) { @@ -3606,12 +3609,12 @@ const b = { } }, { name: "wave beam", - description: "emit a packet of oscillating particles
that propagate through walls", + description: "emit a wavelet of oscillating particles
that propagate through solids", ammo: 0, - ammoPack: 65, + ammoPack: 80, have: false, packetCounter: 0, - delay: 72, + delay: 44, do() { if (this.packetCounter && !input.fire) { this.packetCounter++; @@ -3620,20 +3623,25 @@ const b = { this.packetCounter = 0; } } + //draw cooldown ? }, + calculateDamage() { + + }, + damage: 1, fire() { for (let i = 0; i < 2; i++) { const me = bullet.length; bullet[me] = Bodies.polygon(m.pos.x + 25 * Math.cos(m.angle), m.pos.y + 25 * Math.sin(m.angle), 7, 3.5, { angle: m.angle, cycle: -0.5, - endCycle: simulation.cycle + Math.floor((tech.waveReflections ? Infinity : 120) * tech.isBulletsLastLonger), // - this.packetCounter + tech.wavePacketLength, //- this.packetCounter + this.packetLength makes the entire packet go away at the same time + endCycle: simulation.cycle + Math.floor((tech.waveReflections ? Infinity : 160) * tech.isBulletsLastLonger), // - this.packetCounter + tech.wavePacketLength, //- this.packetCounter + this.packetLength makes the entire packet go away at the same time inertia: Infinity, frictionAir: 0, slow: 0, - amplitude: (m.crouch ? 10 : 20) * Math.sin(this.packetCounter * 0.088) * ((i % 2) ? (tech.isImaginaryWave ? 1 : -1) : 1), + amplitude: (m.crouch ? 10 : 20) * tech.waveAmplitude * Math.sin(this.packetCounter * tech.wavePacketFrequency) * ((i % 2) ? (tech.isImaginaryWave ? 1 : -1) : 1), minDmgSpeed: 0, - dmg: b.dmgScale * tech.waveBeamDamage * (tech.isImaginaryWave ? 3 : 1) * (0.75 + 0.25 * tech.wavePacketLength / 36), //control damage also when you divide by mob.mass + dmg: b.dmgScale * tech.waveBeamDamage * (tech.isImaginaryWave ? 3 : 1) * tech.waveAmplitude * tech.wavePacketLength / 36, //control damage also when you divide by mob.mass classType: "bullet", collisionFilter: { category: 0, @@ -3675,7 +3683,10 @@ const b = { }, wiggle() { this.cycle++ - const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * 0.35)) + // const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * 0.35)) // 36 + // const where = Vector.mult(transverse, 0.5 * this.amplitude * Math.cos(this.cycle * 0.15)) //36 + // const where = Vector.mult(transverse, 0.15 * this.amplitude * Math.cos(this.cycle * 0.05)) //36 + const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * tech.waveFrequency)) Matter.Body.setPosition(this, Vector.add(this.position, where)) } }); diff --git a/js/level.js b/js/level.js index 3d63a39..622cb8c 100644 --- a/js/level.js +++ b/js/level.js @@ -17,14 +17,14 @@ const level = { // simulation.setZoom(); // m.setField("nano-scale manufacturing") // b.giveGuns("wave beam") - // b.giveGuns("laser") + // b.giveGuns("foam") // tech.isExplodeRadio = true - // for (let i = 0; i < 9; i++) tech.giveTech("auto-loading heuristics") - // for (let i = 0; i < 9; i++) tech.giveTech("bound state") - // for (let i = 0; i < 9; i++) tech.giveTech("jabbering") + // for (let i = 0; i < 1; i++) tech.giveTech("amplitude") + // tech.giveTech("aerogel") + // for (let i = 0; i < 0; i++) tech.giveTech("jabbering") // tech.giveTech("phase velocity") // tech.giveTech("imaginary") - // for (let i = 0; i < 9; i++) tech.giveTech("stationary action") + // for (let i = 0; i < 2; i++) tech.giveTech("least action") // tech.isExplodeRadio = true; // tech.isMineSentry = true diff --git a/js/player.js b/js/player.js index 747f7db..e000527 100644 --- a/js/player.js +++ b/js/player.js @@ -535,6 +535,9 @@ const m = { }, rewind(steps) { // m.rewind(Math.floor(Math.min(599, 137 * m.energy))) if (tech.isRewindGrenade) { + const immunityCycle = m.cycle + 60 + if (m.immuneCycle < immunityCycle) m.immuneCycle = immunityCycle; //player is immune to damage until after grenades might explode... + for (let i = 1, len = Math.floor(2 + steps / 40); i < len; i++) { b.grenade(Vector.add(m.pos, { x: 10 * (Math.random() - 0.5), y: 10 * (Math.random() - 0.5) }), -i * Math.PI / len) //fire different angles for each grenade const who = bullet[bullet.length - 1] diff --git a/js/tech.js b/js/tech.js index 054fb9c..899a4a6 100644 --- a/js/tech.js +++ b/js/tech.js @@ -1908,7 +1908,7 @@ }, { name: "causality bombs", - description: "before you rewind drop several grenades", + description: "before you rewind drop several grenades
become immune to harm until they explode", maxCount: 1, count: 0, frequency: 2, @@ -3612,27 +3612,9 @@ tech.bulletSize = 1; } }, - { - name: "jabbering", - description: "the wave beam generates another packet
wave damage is increased by 25%", - isGunTech: true, - maxCount: 9, - count: 0, - frequency: 2, - allowed() { - return tech.haveGunCheck("wave beam") - }, - requires: "wave beam", - effect() { - tech.wavePacketLength += 36 //if you change this to not be 36 update /36 in wave .dmg - }, - remove() { - tech.wavePacketLength = 36 - } - }, { name: "phase velocity", - description: "the wave beam propagates faster in solids", + description: "wavelets propagates faster in solids", isGunTech: true, maxCount: 1, count: 0, @@ -3646,32 +3628,11 @@ }, remove() { tech.isPhaseVelocity = false; - - } - }, - { - name: "stationary action", - description: "the wave beam propagates 25% slower
wave damage is increased by 40%", - isGunTech: true, - maxCount: 9, - count: 0, - frequency: 2, - allowed() { - return tech.haveGunCheck("wave beam") - }, - requires: "wave beam", - effect() { - tech.waveBeamSpeed *= 0.75; - tech.waveBeamDamage += 0.5 * 0.4 - }, - remove() { - tech.waveBeamSpeed = 10; - tech.waveBeamDamage = 0.5 } }, { name: "bound state", - description: "instead of dissipating normally
wave beam bullets reflect backwards 2 times", + description: "instead of dissipating normally
wavelets reflect backwards 2 times", isGunTech: true, maxCount: 9, count: 0, @@ -3687,9 +3648,69 @@ tech.waveReflections = 0 } }, + { + name: "wavelength", + description: "wavelet length is 25% longer
wave damage is increased by 25%", // description: "holding fire allows the wave beam to emits a second packet
at zero ammo cost", + isGunTech: true, + maxCount: 9, + count: 0, + frequency: 2, + allowed() { + return tech.haveGunCheck("wave beam") + }, + requires: "wave beam", + effect() { + tech.wavePacketLength *= 1.25 //if you change this to not be 36 update /36 in wave .dmg + tech.wavePacketFrequency *= 0.7995 + tech.waveFrequency *= 0.9 + }, + remove() { + tech.wavePacketLength = 36 + tech.waveFrequency = 0.35 + tech.wavePacketFrequency = 0.088 + } + }, + { + name: "amplitude", + description: "wavelet amplitude is 33% higher
wave damage is increased by 33%", + isGunTech: true, + maxCount: 3, + count: 0, + frequency: 2, + allowed() { + return tech.haveGunCheck("wave beam") + }, + requires: "wave beam", + effect() { + tech.waveAmplitude += 0.33 + }, + remove() { + tech.waveAmplitude = 1 + } + }, + { + name: "least action", + description: "wavelets propagation speed is 25% slower
wave damage is increased by 50%", + isGunTech: true, + maxCount: 3, + count: 0, + frequency: 2, + allowed() { + return tech.haveGunCheck("wave beam") + }, + requires: "wave beam", + effect() { + tech.waveBeamSpeed -= 2.5; + tech.waveBeamDamage += 0.7 * 0.5 + }, + remove() { + tech.waveBeamSpeed = 10; + tech.waveBeamDamage = 0.7 + } + }, { name: "imaginary", - description: "the wave beam is limited to a single strand
wave damage is increased by 300%", + description: "the wavelet is limited to a single strand
wave damage is increased by 300%", isGunTech: true, maxCount: 1, count: 0, @@ -4104,8 +4125,8 @@ } }, { - name: "colloidal foam", - description: "foam bubbles dissipate 40% faster
increase foam damage per second by 300%", + name: "aerogel", + description: "foam bubbles float and dissipate 40% faster
increase foam damage per second by 300%", isGunTech: true, maxCount: 1, count: 0, @@ -4116,9 +4137,11 @@ requires: "foam", effect() { tech.isFastFoam = true + tech.foamGravity = -0.0002 }, remove() { tech.isFastFoam = false; + tech.foamGravity = 0.00008 } }, { @@ -6544,5 +6567,6 @@ isPhaseVelocity: null, wavePacketLength: null, isImaginaryWave: null, - waveBeamSpeed: null + waveBeamSpeed: null, + waveAmplitude: null, } \ No newline at end of file diff --git a/todo.txt b/todo.txt index 8f79733..c5c5585 100644 --- a/todo.txt +++ b/todo.txt @@ -1,8 +1,11 @@ ******************************************************** NEXT PATCH ******************************************************** -some wave beam bug fixes and balance +harm immunity effects now apply to explosion self damage +tech: CPT grenades no longer harm you -tech: stationary action - slower wave beam but more damage +tech: least action - wavelets are slower and do more damage +tech: amplitude - wavelets are taller and do more damage +tech: wavelength - wavelets are longer and do more damage ******************************************************** BUGS ******************************************************** @@ -36,6 +39,11 @@ is there a way to check if the player is stuck inside the map or block ******************************************************** TODO ******************************************************** +wave tech: dispersion - add noise and damage to waves +wave tech: chirp - amplitude increases with time + +make a system to show current gun damage in pause menu? + tech: picking up heal power ups when at full health does harm equal to the heal values benefit on pick up: get ammo