diff --git a/.DS_Store b/.DS_Store index c726d99..1f2ebdb 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/js/bullet.js b/js/bullet.js index 384ede8..6ff8f8b 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -713,7 +713,7 @@ const b = { bullet[me].explodeRad = 275; bullet[me].onEnd = function() { b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end - if (tech.fragments) b.targetedNail(this.position, tech.fragments * 5) + if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4) } bullet[me].minDmgSpeed = 1; bullet[me].beforeDmg = function() { @@ -738,7 +738,7 @@ const b = { bullet[me].explodeRad = 300; bullet[me].onEnd = function() { b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end - if (tech.fragments) b.targetedNail(this.position, tech.fragments * 5) + if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4) } bullet[me].minDmgSpeed = 1; bullet[me].beforeDmg = function() { @@ -773,7 +773,7 @@ const b = { bullet[me].explodeRad = 350 + Math.floor(Math.random() * 50);; bullet[me].onEnd = function() { b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end - if (tech.fragments) b.targetedNail(this.position, tech.fragments * 5) + if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4) } bullet[me].minDmgSpeed = 1; bullet[me].beforeDmg = function() { @@ -849,7 +849,7 @@ const b = { bullet[me].explodeRad = 325 + Math.floor(Math.random() * 50);; bullet[me].onEnd = function() { b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end - if (tech.fragments) b.targetedNail(this.position, tech.fragments * 7) + if (tech.fragments) b.targetedNail(this.position, tech.fragments * 6) } bullet[me].beforeDmg = function() {}; bullet[me].restitution = 0.4; @@ -1124,7 +1124,7 @@ const b = { }, onEnd() { b.explosion(this.position, this.explodeRad * size); //makes bullet do explosive damage at end - if (tech.fragments) b.targetedNail(this.position, tech.fragments * 5) + if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4) }, lockedOn: null, tryToLockOn() { @@ -1572,7 +1572,7 @@ const b = { } else { ctx.strokeStyle = tech.laserColor; ctx.lineWidth = 2 - ctx.lineDashOffset = 300 * Math.random() + ctx.lineDashOffset = 900 * Math.random() ctx.setLineDash([50 + 120 * Math.random(), 50 * Math.random()]); for (let i = 1, len = path.length; i < len; ++i) { ctx.beginPath(); @@ -1650,7 +1650,7 @@ const b = { for (let i = 0; i < 3; i++) { const where = this.vertices[i] const endPoint = Vector.add(where, Vector.mult(Vector.normalise(Vector.sub(where, this.position)), 2500)) - b.laser(where, endPoint, tech.laserDamage * 10, this.reflections, true) + b.laser(where, endPoint, tech.laserDamage * 12, this.reflections, true) } ctx.stroke(); // ctx.globalAlpha = 1; @@ -1959,7 +1959,7 @@ const b = { friction: 0, frictionAir: 0.10, restitution: 0.3, - dmg: 0.38, //damage done in addition to the damage from momentum + dmg: 0.42, //damage done in addition to the damage from momentum lookFrequency: 14 + Math.floor(8 * Math.random()), endCycle: simulation.cycle + 140 * tech.isBulletsLastLonger, classType: "bullet", @@ -2633,13 +2633,13 @@ const b = { x: targets[index].x + SPREAD * (Math.random() - 0.5), y: targets[index].y + SPREAD * (Math.random() - 0.5) } - b.nail(position, Vector.mult(Vector.normalise(Vector.sub(WHERE, position)), speed)) + b.nail(position, Vector.mult(Vector.normalise(Vector.sub(WHERE, position)), speed), 1.4) } else if (isRandomAim) { // aim in random direction const ANGLE = 2 * Math.PI * Math.random() b.nail(position, { x: speed * Math.cos(ANGLE), y: speed * Math.sin(ANGLE) - }) + }, 1.4) } } }, @@ -3727,9 +3727,9 @@ const b = { const dir = m.angle + 0.02 * (Math.random() - 0.5) bullet[me] = Bodies.rectangle(m.pos.x + 35 * Math.cos(m.angle), m.pos.y + 35 * Math.sin(m.angle), 60, 27, b.fireAttributes(dir)); - Matter.Body.setDensity(bullet[me], 0.004); + Matter.Body.setDensity(bullet[me], 0.007); World.add(engine.world, bullet[me]); //add bullet to world - const SPEED = (m.crouch ? 52 : 43) + Math.random() * 7 + const SPEED = (m.crouch ? 45 : 35) + Math.random() * 6 Matter.Body.setVelocity(bullet[me], { x: SPEED * Math.cos(dir), y: SPEED * Math.sin(dir) @@ -3737,7 +3737,7 @@ const b = { if (tech.isIncendiary) { bullet[me].endCycle = simulation.cycle + 60 bullet[me].onEnd = function() { - b.explosion(this.position, 250 + (Math.random() - 0.5) * 60); //makes bullet do explosive damage at end + b.explosion(this.position, 300 + (Math.random() - 0.5) * 60); //makes bullet do explosive damage at end } bullet[me].beforeDmg = function() { this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion @@ -3749,7 +3749,7 @@ const b = { // bullet[me].restitution = 0.4 bullet[me].frictionAir = 0.006; bullet[me].do = function() { - this.force.y += this.mass * 0.002 + this.force.y += this.mass * 0.0022 //rotates bullet to face current velocity? if (this.speed > 6) { @@ -3757,7 +3757,7 @@ const b = { x: Math.cos(this.angle), y: Math.sin(this.angle) } - const mag = 0.017 + const mag = 0.04 if (Vector.cross(Vector.normalise(this.velocity), facing) < 0) { this.torque += mag } else { @@ -3801,32 +3801,32 @@ const b = { World.add(engine.world, bullet[me]); //add bullet to world } } else if (tech.isNailShot) { - spread *= 0.4 + spread *= 0.65 if (m.crouch) { for (let i = 0; i < 17; i++) { + speed = 38 + 15 * Math.random() const dir = m.angle + (Math.random() - 0.5) * spread const pos = { x: m.pos.x + 35 * Math.cos(m.angle) + 15 * (Math.random() - 0.5), y: m.pos.y + 35 * Math.sin(m.angle) + 15 * (Math.random() - 0.5) } - speed = 48 + 8 * Math.random() b.nail(pos, { x: speed * Math.cos(dir), y: speed * Math.sin(dir) - }) + }, 1.4) } } else { for (let i = 0; i < 17; i++) { + speed = 38 + 15 * Math.random() const dir = m.angle + (Math.random() - 0.5) * spread const pos = { x: m.pos.x + 35 * Math.cos(m.angle) + 15 * (Math.random() - 0.5), y: m.pos.y + 35 * Math.sin(m.angle) + 15 * (Math.random() - 0.5) } - speed = 48 + 8 * Math.random() b.nail(pos, { x: speed * Math.cos(dir), y: speed * Math.sin(dir) - }) + }, 1.4) } } } else { @@ -3991,62 +3991,65 @@ const b = { ctx.strokeStyle = "rgba(0,0,0,0.2)" //"000"; ctx.lineWidth = 2 ctx.beginPath(); + for (let i = this.waves.length - 1; i > -1; i--) { const v1 = Vector.add(this.waves[i].position, Vector.mult(this.waves[i].unit1, this.waves[i].radius)) const v2 = Vector.add(this.waves[i].position, Vector.mult(this.waves[i].unit2, this.waves[i].radius)) - // collisions - //using small angle linear approximation of circle arc, this will not work if the arc gets large // https://stackoverflow.com/questions/13652518/efficiently-find-points-inside-a-circle-sector - let hits = Matter.Query.ray(mob, v1, v2, 50) //Matter.Query.ray(bodies, startPoint, endPoint, [rayWidth]) - for (let j = 0; j < hits.length; j++) { - const who = hits[j].body - //make them shake around - who.force.x += 0.01 * (Math.random() - 0.5) * who.mass - who.force.y += 0.01 * (Math.random() - 0.5) * who.mass - Matter.Body.setVelocity(who, { //friction - x: who.velocity.x * 0.95, - y: who.velocity.y * 0.95 - }); - - let vertices = who.vertices; - const vibe = 50 + who.radius * 0.15 - ctx.moveTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5)); - for (let j = 1; j < vertices.length; j++) { - ctx.lineTo(vertices[j].x + vibe * (Math.random() - 0.5), vertices[j].y + vibe * (Math.random() - 0.5)); - } - ctx.lineTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5)); - const damage = 1.65 * b.dmgScale * tech.waveBeamDamage * tech.wavePacketDamage / Math.sqrt(who.radius) //damage is lower for large radius mobs, since they feel the waves longer - who.locatePlayer(); - who.damage(damage); - } - - hits = Matter.Query.ray(body, v1, v2, 50) //Matter.Query.ray(bodies, startPoint, endPoint, [rayWidth]) - for (let j = 0; j < hits.length; j++) { - const who = hits[j].body - //make them shake around - who.force.x += 0.01 * (Math.random() - 0.5) * who.mass - who.force.y += (0.01 * (Math.random() - 0.5) - simulation.g * 0.25) * who.mass //remove force of gravity - - let vertices = who.vertices; - const vibe = 25 - ctx.moveTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5)); - for (let j = 1; j < vertices.length; j++) { - ctx.lineTo(vertices[j].x + vibe * (Math.random() - 0.5), vertices[j].y + vibe * (Math.random() - 0.5)); - } - ctx.lineTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5)); - } - ctx.stroke(); //draw vibes - - // ctx.beginPath(); //draw wave + //draw wave ctx.moveTo(v1.x, v1.y) ctx.arc(this.waves[i].position.x, this.waves[i].position.y, this.waves[i].radius, this.waves[i].angle, this.waves[i].angle + this.waves[i].arc); - if (!m.isBodiesAsleep) this.waves[i].radius += tech.waveBeamSpeed * 2 //expand / move + // collisions + //using small angle linear approximation of circle arc, this will not work if the arc gets large // https://stackoverflow.com/questions/13652518/efficiently-find-points-inside-a-circle-sector + if (!m.isBodiesAsleep) { + let hits = Matter.Query.ray(mob, v1, v2, 50) //Matter.Query.ray(bodies, startPoint, endPoint, [rayWidth]) + for (let j = 0; j < hits.length; j++) { + const who = hits[j].body + //make them shake around + who.force.x += 0.01 * (Math.random() - 0.5) * who.mass + who.force.y += 0.01 * (Math.random() - 0.5) * who.mass + Matter.Body.setVelocity(who, { //friction + x: who.velocity.x * 0.95, + y: who.velocity.y * 0.95 + }); + + let vertices = who.vertices; + const vibe = 50 + who.radius * 0.15 + ctx.moveTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5)); + for (let j = 1; j < vertices.length; j++) { + ctx.lineTo(vertices[j].x + vibe * (Math.random() - 0.5), vertices[j].y + vibe * (Math.random() - 0.5)); + } + ctx.lineTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5)); + const damage = 1.75 * b.dmgScale * tech.waveBeamDamage * tech.wavePacketDamage / Math.sqrt(who.radius) //damage is lower for large radius mobs, since they feel the waves longer + who.locatePlayer(); + who.damage(damage); + } + + hits = Matter.Query.ray(body, v1, v2, 50) //Matter.Query.ray(bodies, startPoint, endPoint, [rayWidth]) + for (let j = 0; j < hits.length; j++) { + const who = hits[j].body + //make them shake around + who.force.x += 0.01 * (Math.random() - 0.5) * who.mass + who.force.y += (0.01 * (Math.random() - 0.5) - simulation.g * 0.25) * who.mass //remove force of gravity + + let vertices = who.vertices; + const vibe = 25 + ctx.moveTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5)); + for (let j = 1; j < vertices.length; j++) { + ctx.lineTo(vertices[j].x + vibe * (Math.random() - 0.5), vertices[j].y + vibe * (Math.random() - 0.5)); + } + ctx.lineTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5)); + } + ctx.stroke(); //draw vibes + + this.waves[i].radius += tech.waveBeamSpeed * 2 //expand / move + } if (this.waves[i].radius > 1800 * tech.isBulletsLastLonger) this.waves.splice(i, 1) //end } ctx.stroke(); }, fireLongitudinal() { - m.fireCDcycle = m.cycle + Math.floor(8 * b.fireCDscale); // cool down - const halfArc = Math.PI / 8 * (m.crouch ? 0.7 : 0.5) + m.fireCDcycle = m.cycle + Math.floor((m.crouch ? 3 : 8) * b.fireCDscale); // cool down + const halfArc = m.crouch ? 0.0785 : 0.275 //6.28 is a full circle, but these arcs needs to stay small because we are using small angle linear approximation, for collisions this.waves.push({ position: { x: m.pos.x + 25 * Math.cos(m.angle), @@ -4299,7 +4302,7 @@ const b = { name: "mine", description: "toss a proximity mine that sticks to walls
fires nails at mobs within range", ammo: 0, - ammoPack: 2.7, + ammoPack: 2, have: false, do() {}, fire() { diff --git a/js/level.js b/js/level.js index 698be81..22e8661 100644 --- a/js/level.js +++ b/js/level.js @@ -15,8 +15,9 @@ const level = { // level.difficultyIncrease(30) // simulation.isHorizontalFlipped = true // m.setField("wormhole") - // b.giveGuns("wave beam") - // tech.giveTech("pressure wave") + // b.giveGuns("laser") + // tech.giveTech("laser diode") + // tech.giveTech("free-electron laser") // for (let i = 0; i < 9; i++) tech.giveTech("spherical harmonics") // tech.giveTech("decoherence") // for (let i = 0; i < 3; i++) tech.giveTech("packet length") @@ -53,7 +54,7 @@ const level = { // lore.techCount = 6 // simulation.isCheating = false //true; - // localSettings.loreCount = 2; //this sets what conversation is heard + // localSettings.loreCount = 0; //this sets what conversation is heard // localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage // level.onLevel = -1 //this sets level.levels[level.onLevel] = undefined which is required to run the conversation // level.null() @@ -90,7 +91,7 @@ const level = { powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "tech", false); } if (tech.isHealLowHealth) { - const len = Math.ceil((m.maxHealth - m.health) / 0.22) + const len = Math.ceil((m.maxHealth - m.health) / 0.26) for (let i = 0; i < len; i++) powerUps.spawn(player.position.x + 90 * (Math.random() - 0.5), player.position.y + 90 * (Math.random() - 0.5), "heal", false); } if (tech.isMACHO) spawn.MACHO() @@ -110,24 +111,24 @@ const level = { difficultyIncrease(num = 1) { for (let i = 0; i < num; i++) { simulation.difficulty++ - b.dmgScale *= 0.92; //damage done by player decreases each level + b.dmgScale *= 0.91; //damage done by player decreases each level if (simulation.accelScale < 5) simulation.accelScale *= 1.02 //mob acceleration increases each level if (simulation.lookFreqScale > 0.2) simulation.lookFreqScale *= 0.98 //mob cycles between looks decreases each level if (simulation.CDScale > 0.2) simulation.CDScale *= 0.97 //mob CD time decreases each level } - simulation.dmgScale = 0.385 * simulation.difficulty //damage done by mobs increases each level + simulation.dmgScale = 0.4 * simulation.difficulty //damage done by mobs increases each level simulation.healScale = 1 / (1 + simulation.difficulty * 0.055) //a higher denominator makes for lower heals // m.health += heal * simulation.healScale; }, difficultyDecrease(num = 1) { //used in easy mode for simulation.reset() for (let i = 0; i < num; i++) { simulation.difficulty-- - b.dmgScale /= 0.92; //damage done by player decreases each level + b.dmgScale /= 0.91; //damage done by player decreases each level if (simulation.accelScale > 0.2) simulation.accelScale /= 1.02 //mob acceleration increases each level if (simulation.lookFreqScale < 5) simulation.lookFreqScale /= 0.98 //mob cycles between looks decreases each level if (simulation.CDScale < 5) simulation.CDScale /= 0.97 //mob CD time decreases each level } if (simulation.difficulty < 1) simulation.difficulty = 0; - simulation.dmgScale = 0.385 * simulation.difficulty //damage done by mobs increases each level + simulation.dmgScale = 0.4 * simulation.difficulty //damage done by mobs increases each level if (simulation.dmgScale < 0.1) simulation.dmgScale = 0.1; simulation.healScale = 1 / (1 + simulation.difficulty * 0.055) }, @@ -2821,9 +2822,9 @@ const level = { powerUps.spawnBossPowerUp(-125, -1760); } else { if (Math.random() < 0.5) { - spawn.randomLevelBoss(700, -1550, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "shieldingBoss", "pulsarBoss"]); + spawn.randomLevelBoss(700, -1550, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "shieldingBoss", "pulsarBoss", "grenadierBoss"]); } else { - spawn.randomLevelBoss(675, -2775, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "shieldingBoss", "pulsarBoss"]); + spawn.randomLevelBoss(675, -2775, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "shieldingBoss", "pulsarBoss", "grenadierBoss"]); } } powerUps.addResearchToLevel() //needs to run after mobs are spawned @@ -3032,7 +3033,7 @@ const level = { spawn.randomMob(3600, 1725, 0.9); spawn.randomMob(4100, 1225, 0.9); spawn.randomMob(2825, 400, 0.9); - if (simulation.difficulty > 3) spawn.randomLevelBoss(6000, 2300, ["spiderBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "historyBoss", "orbitalBoss", "shieldingBoss"]); + if (simulation.difficulty > 3) spawn.randomLevelBoss(6000, 2300, ["spiderBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "historyBoss", "orbitalBoss", "grenadierBoss"]); powerUps.addResearchToLevel() //needs to run after mobs are spawned spawn.secondaryBossChance(7725, 2275) @@ -6362,6 +6363,7 @@ const level = { level.exit.x = 3900; level.exit.y = 1060; spawn.mapRect(level.exit.x, level.exit.y + 30, 100, 20) + document.body.style.backgroundColor = "#dcdcde"; var nextBlockSpawn = simulation.cycle + Math.floor(Math.random() * 60 + 30) const door = level.door(475, 900, 50, 200, 201) diff --git a/js/lore.js b/js/lore.js index ea3aea1..adee782 100644 --- a/js/lore.js +++ b/js/lore.js @@ -139,17 +139,17 @@ const lore = { sentence: 0, //what part of the conversation is playing conversation: [ [ //first time they meet, and testing gets unlocked - () => { setTimeout(() => { lore.miriam.text("I've never seen it generate this level before.") }, 5000); }, + () => { + lore.unlockTesting(); + setTimeout(() => { lore.miriam.text("I've never seen it generate this level before.") }, 5000); + }, () => { lore.anand.text("Wow. Just a platform.") }, () => { lore.miriam.text("And that thing...") }, () => { lore.anand.text("Weird") }, () => { lore.anand.text("Maybe it's trapped.") }, () => { lore.miriam.text("Looks like testing mode is locked.") }, () => { lore.miriam.text("I'll unlock it with the console command.") }, - () => { - lore.unlockTesting(); - setTimeout(() => { lore.miriam.text("Hey little bot! Just press 'T' to enter testing mode and 'U' to go to the next level.") }, 1000); - }, + () => { setTimeout(() => { lore.miriam.text("Hey little bot! Just press 'T' to enter testing mode and 'U' to go to the next level.") }, 1000); }, () => { lore.anand.text("It can't process what you're saying.") }, () => { lore.miriam.text("ha hahahaha. I know, but it does seem to be getting smarter.") }, () => { diff --git a/js/powerup.js b/js/powerup.js index 67847a0..0b9e36a 100644 --- a/js/powerup.js +++ b/js/powerup.js @@ -371,7 +371,10 @@ const powerUps = { if (tech.isAmmoForGun && b.inventory.length > 0 && b.activeGun) { const target = b.guns[b.activeGun] if (target.ammo !== Infinity) { - const ammoAdded = Math.ceil(Math.random() * target.ammoPack) + Math.ceil(0.7 * Math.random() * target.ammoPack) + + // const ammoAdded = Math.ceil(Math.random() * target.ammoPack) + Math.ceil(0.7 * Math.random() * target.ammoPack) + // const ammoAdded = Math.ceil((Math.random() + 0.5 * Math.random()) * target.ammoPack) + const ammoAdded = Math.ceil((0.5 * Math.random() + 0.4 * Math.random()) * target.ammoPack) target.ammo += ammoAdded simulation.makeTextLog(`${target.name}.ammo += ${ammoAdded}`) } @@ -379,7 +382,7 @@ const powerUps = { for (let i = 0, len = b.inventory.length; i < len; i++) { const target = b.guns[b.inventory[i]] if (target.ammo !== Infinity) { - const ammoAdded = Math.ceil(Math.random() * target.ammoPack) + const ammoAdded = Math.ceil((0.5 * Math.random() + 0.4 * Math.random()) * target.ammoPack) //Math.ceil(Math.random() * target.ammoPack) target.ammo += ammoAdded simulation.makeTextLog(`${target.name}.ammo += ${ammoAdded}`) } diff --git a/js/simulation.js b/js/simulation.js index e84f71c..4806749 100644 --- a/js/simulation.js +++ b/js/simulation.js @@ -345,6 +345,14 @@ const simulation = { } }, switchGun() { + if (tech.isLongitudinal && b.guns[b.activeGun].name === "wave beam") { + for (i = 0, len = b.guns.length; i < len; i++) { //find which gun + if (b.guns[i].name === "wave beam") { + b.guns[i].waves = []; //empty array of wave bullets + break; + } + } + } if (tech.isCrouchAmmo) tech.isCrouchAmmo = 1 //this prevents hacking the tech by switching guns b.activeGun = b.inventory[b.inventoryGun]; if (b.guns[b.activeGun].charge) b.guns[b.activeGun].charge = 0; //if switching into foam set charge to 0 @@ -662,6 +670,14 @@ const simulation = { }, clearNow: false, clearMap() { + if (tech.isLongitudinal) { + for (i = 0, len = b.guns.length; i < len; i++) { //find which gun + if (b.guns[i].name === "wave beam") { + b.guns[i].waves = []; //empty array of wave bullets + break; + } + } + } if (tech.isMineAmmoBack) { let count = 0; for (i = 0, len = bullet.length; i < len; i++) { //count mines left on map @@ -676,7 +692,6 @@ const simulation = { } } } - if (tech.isMutualism && !tech.isEnergyHealth) { for (let i = 0; i < bullet.length; i++) { if (bullet[i].isMutualismActive) { @@ -686,7 +701,6 @@ const simulation = { } } } - if (tech.isEndLevelPowerUp) { for (let i = 0; i < powerUp.length; i++) { if (powerUp[i].name === "tech") { @@ -701,10 +715,7 @@ const simulation = { } } powerUps.totalPowerUps = powerUp.length - - let holdTarget; //if player is holding something this remembers it before it gets deleted - if (m.holdingTarget) holdTarget = m.holdingTarget; - + let holdTarget = (m.holdingTarget) ? m.holdingTarget : undefined //if player is holding something this remembers it before it gets deleted tech.deathSpawnsFromBoss = 0; simulation.fallHeight = 3000; m.fireCDcycle = 0 diff --git a/js/spawn.js b/js/spawn.js index 4793c55..c3412de 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -258,7 +258,7 @@ const spawn = { me.memory = Infinity; me.hasRunDeathScript = false me.locatePlayer(); - const density = 0.23 + const density = 0.2 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() { diff --git a/js/tech.js b/js/tech.js index 80d8edb..81a80bd 100644 --- a/js/tech.js +++ b/js/tech.js @@ -169,7 +169,7 @@ if (tech.isEnergyDamage) dmg *= 1 + m.energy / 9; if (tech.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038 if (tech.isRerollDamage) dmg *= 1 + 0.042 * powerUps.research.count - if (tech.isOneGun && b.inventory.length < 2) dmg *= 1.22 + if (tech.isOneGun && b.inventory.length < 2) dmg *= 1.35 if (tech.isNoFireDamage && m.cycle > m.fireCDcycle + 120) dmg *= 1.9 if (tech.isSpeedDamage) dmg *= 1 + Math.min(0.43, player.speed * 0.015) if (tech.isBotDamage) dmg *= 1 + 0.06 * b.totalBots() @@ -195,7 +195,7 @@ }, tech: [{ name: "integrated armament", - description: `increase damage by 22%
your inventory can only hold 1 gun`, + description: `increase damage by 35%
your inventory can only hold 1 gun`, maxCount: 1, count: 0, frequency: 2, @@ -2522,7 +2522,7 @@ }, { name: "negative entropy", - description: `at the start of each level
spawn a heal for every 22 missing health`, + description: `at the start of each level
spawn a heal for every 26 missing health`, maxCount: 1, count: 0, frequency: 1, @@ -3984,8 +3984,8 @@ for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "wave beam") { b.guns[i].chooseFireMethod() - b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * 0.125 - b.guns[i].ammo = Math.ceil(b.guns[i].ammo * 0.125); + b.guns[i].ammoPack = b.guns[i].defaultAmmoPack / 8 + b.guns[i].ammo = Math.ceil(b.guns[i].ammo / 8); simulation.updateGunHUD(); break } @@ -4638,7 +4638,7 @@ } }, { - name: "laser diodes", + name: "laser diode", description: "all lasers drain 30% less energy
affects laser-gun, laser-bot, and laser-mines", isGunTech: true, maxCount: 1, @@ -4646,18 +4646,22 @@ frequency: 2, frequencyDefault: 2, allowed() { - return tech.haveGunCheck("laser") || tech.laserBotCount > 1 || tech.isLaserMine + return (tech.haveGunCheck("laser") || tech.laserBotCount > 1 || tech.isLaserMine) && tech.laserDamage === 0.15 }, - requires: "laser", + requires: "laser, not free-electron", effect() { tech.isLaserDiode = 0.70; //100%-37% + tech.laserColor = "rgb(0, 11, 255)" + tech.laserColorAlpha = "rgba(0, 11, 255,0.5)" }, remove() { tech.isLaserDiode = 1; + tech.laserColor = "#f02" + tech.laserColorAlpha = "rgba(255, 0, 0, 0.5)" } }, { - name: "gamma-ray laser", + name: "free-electron laser", description: "increase all laser damage by 200%
increase all laser energy drain by 250%", isGunTech: true, maxCount: 1, @@ -4665,9 +4669,9 @@ frequency: 2, frequencyDefault: 2, allowed() { - return (tech.haveGunCheck("laser") || tech.isLaserMine || tech.laserBotCount > 1) && !tech.isPulseLaser + return (tech.haveGunCheck("laser") || tech.isLaserMine || tech.laserBotCount > 1) && !tech.isPulseLaser && tech.isLaserDiode === 1 }, - requires: "laser, not pulse", + requires: "laser, not pulse, diodes", effect() { tech.laserFieldDrain = 0.007 //base is 0.002 tech.laserDamage = 0.45; //base is 0.15 diff --git a/style.css b/style.css index aaf64dc..98c8f86 100644 --- a/style.css +++ b/style.css @@ -610,6 +610,8 @@ summary { .color-laser { color: #f02; + /* color: #000bff; */ + /* color: #83f; */ /* text-shadow: 0px 0px 2px rgba(255, 0, 119, 0.3); */ /* text-shadow: 0px 0px 1.5px rgba(0, 0, 0, 1), 0px 0px 5px rgba(255, 0, 0, 1); */ font-weight: 100; diff --git a/todo.txt b/todo.txt index 0784570..9e0610e 100644 --- a/todo.txt +++ b/todo.txt @@ -1,21 +1,36 @@ ******************************************************** NEXT PATCH ******************************************************** -pressure wave balance - slightly more ammo -gamma-ray laser does 200% damage and 250% more drain (was 150% damage, 200% drain) -gamma ray now doesn't lock out other laser tech -hidden variable now gives 15, not 30 heals +"gamma-ray laser" renamed "free-electron laser" to make more scientific sense + since gamma rays would go right through walls +laser diode now makes lasers blue +free-electron laser can no longer work with laser diode + +pressure wave has a bit more damage + crouch mode works different (much higher fire rate, low arc) + +integrated armament gives 35% dmg (was 22%) + but I fixed a bug where it gave an extra 33% ammo + +mine gun gets 25% less ammo +all mines do 30% more damage + +trying to make shotgun better at close range and worse at distance + shotgun slug is much slower, but does 60% more damage + nail shot has a 20% wider spread, and is 20% slower, but does 20% more damage + +finalBoss has 15% less health + +to balance all the buffs + ammo power ups give 15% less ammo + damage done by mobs now scales up a bit faster each level + damage done by you now scales down a bit faster each level ******************************************************** TODO ******************************************************** -wave arcs - do something similar to laser - find intersection of the small angle approximation of the arc and all mobs - tech: this.arc: Math.PI/8 // increase or decrease arc - wipe arcs on next level +make the player get a buff after using wormhole + while energy lasts: drain energy and give damage buff -try crosshair invert colors - -tech wave gun - no bullets just draw circle arcs that do damage to mobs near the circle arc +tech pressure wave - reduce range, but make bullets circles, not arcs tech: quantized shields - harmonic standing wave field can only lose 33 energy per hit draw 1,2,3 levels of the field based on energy? @@ -183,6 +198,9 @@ n-gon outreach ideas ******************************************************** BUGS ******************************************************** +door to exit in vats does nothing + did I do that? + death while in power up selection menu doesn't reset properly of course it's not possible to die in this menu unless you use testing and shift+X