diff --git a/index.html b/index.html index 4c6cfa1..bf45843 100644 --- a/index.html +++ b/index.html @@ -233,6 +233,24 @@ animation: dash 4.8s ease-in forwards; } + .draw-lines-dash { + stroke-dasharray: 4; + stroke-dashoffset: 4; + animation: dash 4.8s ease-in forwards; + } + + .draw-lines-o { + stroke-dasharray: 11; + stroke-dashoffset: 11; + animation: dash 4.8s ease-in forwards; + } + + .draw-lines-g { + stroke-dasharray: 17; + stroke-dashoffset: 17; + animation: dash 4.8s ease-in forwards; + } + .draw-lines-box-1 { stroke-dasharray: 1000; stroke-dashoffset: 1000; @@ -285,20 +303,20 @@ + + + + + + + - - + --> diff --git a/js/bullets.js b/js/bullets.js index b9ca8b3..9e0a635 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -77,9 +77,10 @@ const b = { isModBotSpawner: null, modWaveHelix: null, isModSporeFollow: null, + isModNailPoison: null, modOnHealthChange() { //used with acid mod if (b.isModAcidDmg && mech.health > 0.8) { - b.modAcidDmg = 0.7 + b.modAcidDmg = 0.5 if (!build.isCustomSelection) { setTimeout(function () { if (document.getElementById("mod-acid")) document.getElementById("mod-acid").innerHTML = " (on)" @@ -108,22 +109,6 @@ const b = { }, 10); }, mods: [{ - name: "depleted uranium rounds", - description: `your bullets are +13% larger
increased mass and physical damage`, - count: 0, - maxCount: 9, - allowed() { - return b.haveGunCheck("minigun") || b.haveGunCheck("shotgun") || b.haveGunCheck("super balls") || b.haveGunCheck("foam") - }, - requires: "minigun, shotgun, super balls, foam", - effect() { - b.modBulletSize += 0.13 - }, - remove() { - b.modBulletSize = 1; - } - }, - { name: "capacitor", nameInfo: "", description: "increase damage based on stored energy
+1% damage for every 5% energy", @@ -225,38 +210,6 @@ const b = { b.isModHarmDamage = false; } }, - { - name: "high explosives", - description: "explosions do +20% more damage
explosive area is +44% larger", - maxCount: 3, - count: 0, - allowed() { - return b.haveGunCheck("missiles") || b.haveGunCheck("flak") || b.haveGunCheck("grenades") || b.haveGunCheck("vacuum bomb") || b.haveGunCheck("pulse") || b.isModMissileField; - }, - requires: "an explosive gun", - effect: () => { - b.modExplosionRadius += 0.2; - }, - remove() { - b.modExplosionRadius = 1; - } - }, - { - name: "electric reactive armor", - description: "explosions drain your energy
instead of harming you", - maxCount: 1, - count: 0, - allowed() { - return b.modExplosionRadius > 1 || b.isModExplodeMob - }, - requires: "high explosives", - effect: () => { - b.isModImmuneExplosion = true; - }, - remove() { - b.isModImmuneExplosion = false; - } - }, { name: "thermal runaway", description: "mobs explode when they die
be careful", @@ -413,23 +366,6 @@ const b = { b.isModDroneOnDamage = false; } }, - { - name: "Lorentzian topology", - description: "your bullets last +33% longer", - maxCount: 3, - count: 0, - allowed() { - return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || b.haveGunCheck("spores") || b.haveGunCheck("drones") || b.haveGunCheck("super balls") || b.haveGunCheck("foam") || b.haveGunCheck("wave beam") || b.haveGunCheck("ice IX") - }, - requires: "drones, spores, super balls,
foam, wave beam, or ice IX", - effect() { - b.isModBulletsLastLonger += 0.33 - }, - remove() { - b.isModBulletsLastLonger = 1; - } - }, - { name: "zoospore vector", description: "mobs discharge spores on death
+11% chance", @@ -727,7 +663,7 @@ const b = { }, { name: "recursive healing", - description: "healing power ups trigger one extra time", + description: "healing power ups trigger a 2nd time", maxCount: 9, count: 0, allowed() { @@ -808,7 +744,7 @@ const b = { }, { name: "leveraged investment", - description: "remove all future ammo power ups
spawn 6 mods and 3 healing power ups", + description: "remove all future ammo power ups
spawn 6 mods and 3 healing power ups", maxCount: 1, count: 0, allowed() { @@ -884,6 +820,22 @@ const b = { //nothing to undo } }, + { + name: "depleted uranium rounds", + description: `your bullets are +13% larger
increased mass and physical damage`, + count: 0, + maxCount: 9, + allowed() { + return b.haveGunCheck("minigun") || b.haveGunCheck("shotgun") || b.haveGunCheck("super balls") + }, + requires: "minigun, shotgun, super balls", + effect() { + b.modBulletSize += 0.13 + }, + remove() { + b.modBulletSize = 1; + } + }, { name: "ice crystal nucleation", description: "your minigun uses energy to condense
unlimited freezing bullets from water vapor", @@ -999,7 +951,7 @@ const b = { }, { name: "irradiated needles", - description: "fléchette needles are exposed to radiation
needles do 2x damage spread over 6 seconds", + description: "needles are exposed to plutonium-238
2x damage spread over 6 seconds", maxCount: 1, count: 0, allowed() { @@ -1064,6 +1016,38 @@ const b = { b.isModWaveReflect = false } }, + { + name: "high explosives", + description: "explosions do +20% more damage
explosive area is +44% larger", + maxCount: 3, + count: 0, + allowed() { + return b.haveGunCheck("missiles") || b.haveGunCheck("flak") || b.haveGunCheck("grenades") || b.haveGunCheck("vacuum bomb") || b.haveGunCheck("pulse") || b.isModMissileField; + }, + requires: "an explosive gun", + effect: () => { + b.modExplosionRadius += 0.2; + }, + remove() { + b.modExplosionRadius = 1; + } + }, + { + name: "electric reactive armor", + description: "explosions give you energy
instead of harming you", + maxCount: 1, + count: 0, + allowed() { + return b.haveGunCheck("missiles") || b.haveGunCheck("flak") || b.haveGunCheck("grenades") || b.haveGunCheck("vacuum bomb") || b.haveGunCheck("pulse") || b.isModMissileField; + }, + requires: "an explosive gun", + effect: () => { + b.isModImmuneExplosion = true; + }, + remove() { + b.isModImmuneExplosion = false; + } + }, { name: "self-replication", description: "when missiles explode
they fire +1 smaller missiles", @@ -1148,6 +1132,22 @@ const b = { b.isModMineAmmoBack = false; } }, + { + name: "irradiated nails", + description: "nails are made with a cobalt-60 alloy
66% extra damage over 6 seconds", + maxCount: 1, + count: 0, + allowed() { + return b.modNailBotCount || b.haveGunCheck("mine") || b.modGrenadeFragments || b.isModRailNails || b.isModBotSpawner + }, + requires: "nails", + effect() { + b.isModNailPoison = true; + }, + remove() { + b.isModNailPoison = false; + } + }, { name: "tinsellated flagella", description: "spores accelerate 50% faster", @@ -1180,6 +1180,22 @@ const b = { b.isModSporeFollow = false } }, + { + name: "Lorentzian topology", + description: "your bullets last +33% longer", + maxCount: 3, + count: 0, + allowed() { + return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || b.haveGunCheck("spores") || b.haveGunCheck("drones") || b.haveGunCheck("super balls") || b.haveGunCheck("foam") || b.haveGunCheck("wave beam") || b.haveGunCheck("ice IX") + }, + requires: "drones, spores, super balls,
foam, wave beam, or ice IX", + effect() { + b.isModBulletsLastLonger += 0.33 + }, + remove() { + b.isModBulletsLastLonger = 1; + } + }, { name: "redundant systems", description: "drone collisions no longer reduce their lifespan", @@ -1214,7 +1230,7 @@ const b = { }, { name: "foam stabilization", - description: "foam can stick to shields", + description: "foam can stick to shields", maxCount: 1, count: 0, allowed() { @@ -1230,7 +1246,7 @@ const b = { }, { name: "fragmenting projectiles", - description: "rail gun fragments into nails
after hitting mobs at high speeds", + description: "rail gun fragments into nails
after hitting mobs at high speeds", maxCount: 1, count: 0, allowed() { @@ -1688,12 +1704,7 @@ const b = { if (dist < radius) { if (b.isModImmuneExplosion) { - const drain = Math.max(radius * 0.0003, 0.15) - if (mech.energy > drain) { - mech.energy -= drain - } else { - mech.damage(radius * 0.0001); //do half damage if have the mod, but out of mana - } + mech.energy += Math.max(radius * 0.0003, 0.15) } else { mech.damage(radius * 0.0002); //normal player damage from explosions } @@ -1754,8 +1765,6 @@ const b = { mob[i].force.y += knock.y; radius *= 0.93 //reduced range for each additional explosion target damageScale *= 0.8 //reduced damage for each additional explosion target - // mobs.statusStun(mob[i]) - // if (isBurn) mobs.statusBurn(mob[i], 0.4) // (2.2) * 1.3 * 30/180 // 6 ticks (3 seconds) } else if (!mob[i].seePlayer.recall && dist < alertRange) { mob[i].locatePlayer(); knock = Vector.mult(Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) / 80); @@ -1767,7 +1776,7 @@ const b = { }, missile(where, dir, speed, size = 1, spawn = 0) { const me = bullet.length; - bullet[me] = Bodies.rectangle(where.x, where.y, 30 * b.modBulletSize * size, 4 * b.modBulletSize * size, b.fireAttributes(dir)); + bullet[me] = Bodies.rectangle(where.x, where.y, 30 * size, 4 * size, b.fireAttributes(dir)); const thrust = 0.00417 * bullet[me].mass; Matter.Body.setVelocity(bullet[me], { x: mech.Vx / 2 + speed * Math.cos(dir), @@ -1862,7 +1871,7 @@ const b = { }, mine(where, velocity, angle = 0, isAmmoBack = false) { const bIndex = bullet.length; - bullet[bIndex] = Bodies.rectangle(where.x, where.y, 45 * b.modBulletSize, 16 * b.modBulletSize, { + bullet[bIndex] = Bodies.rectangle(where.x, where.y, 45, 16, { angle: angle, friction: 1, frictionStatic: 1, @@ -2006,7 +2015,7 @@ const b = { }, spore(who) { //used with the mod upgrade in mob.death() const bIndex = bullet.length; - const side = 4 * b.modBulletSize; + const side = 4; bullet[bIndex] = Bodies.polygon(who.position.x, who.position.y, 5, side, { // density: 0.0015, //frictionAir: 0.01, inertia: Infinity, @@ -2015,13 +2024,14 @@ const b = { friction: 0, frictionAir: 0.025, thrust: b.isModFastSpores ? 0.001 : 0.0004, - dmg: 2.4, //damage done in addition to the damage from momentum + dmg: 2.8, //damage done in addition to the damage from momentum + lookFrequency: 97 + Math.floor(117 * Math.random()), classType: "bullet", collisionFilter: { category: cat.bullet, mask: cat.map | cat.mob | cat.mobBullet | cat.mobShield //no collide with body }, - endCycle: game.cycle + Math.floor((660 + Math.floor(Math.random() * 360)) * b.isModBulletsLastLonger), + endCycle: game.cycle + Math.floor((540 + Math.floor(Math.random() * 360)) * b.isModBulletsLastLonger), minDmgSpeed: 0, playerOffPosition: { //used when following player to keep spores separate x: 100 * (Math.random() - 0.5), @@ -2031,7 +2041,6 @@ const b = { this.endCycle = 0; //bullet ends cycle after doing damage }, onEnd() {}, - lookFrequency: 97 + Math.floor(93 * Math.random()), do() { //find mob targets if (!(game.cycle % this.lookFrequency)) { @@ -2055,7 +2064,6 @@ const b = { //accelerate towards mobs if (this.lockedOn && this.lockedOn.alive) { this.force = Vector.mult(Vector.normalise(Vector.sub(this.lockedOn.position, this.position)), this.mass * this.thrust) - } else if (b.isModSporeFollow && this.lockedOn !== undefined) { //move towards player //checking for undefined means that the spores don't go after the player until it has looked and not found a target const dx = this.position.x - mech.pos.x; @@ -2082,7 +2090,7 @@ const b = { const me = bullet.length; const THRUST = 0.004 const dir = mech.angle + spread * (Math.random() - 0.5); - const RADIUS = 18 * b.modBulletSize + const RADIUS = 18 bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 3, RADIUS, { angle: dir - Math.PI, inertia: Infinity, @@ -2103,7 +2111,7 @@ const b = { onDmg(who) { mobs.statusSlow(who, 60) this.endCycle = game.cycle - if (b.isModAlphaRadiation) mobs.statusPoison(who, 0.1, 180) + if (b.isModAlphaRadiation) mobs.statusDoT(who, 0.1, 180) }, onEnd() {}, do() { @@ -2152,7 +2160,7 @@ const b = { const me = bullet.length; const THRUST = 0.0015 const dir = mech.angle + 0.2 * (Math.random() - 0.5); - const RADIUS = (4.5 + 3 * Math.random()) * b.modBulletSize + const RADIUS = (4.5 + 3 * Math.random()) bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 8, RADIUS, { angle: dir, inertia: Infinity, @@ -2250,17 +2258,22 @@ const b = { }, nail(pos, velocity, dmg = 0) { const me = bullet.length; - bullet[me] = Bodies.rectangle(pos.x, pos.y, 25 * b.modBulletSize, 2 * b.modBulletSize, b.fireAttributes(Math.atan2(velocity.y, velocity.x))); + bullet[me] = Bodies.rectangle(pos.x, pos.y, 25, 2, b.fireAttributes(Math.atan2(velocity.y, velocity.x))); Matter.Body.setVelocity(bullet[me], velocity); World.add(engine.world, bullet[me]); //add bullet to world bullet[me].endCycle = game.cycle + 60 + 18 * Math.random(); bullet[me].dmg = dmg + bullet[me].onDmg = function (who) { + if (b.isModNailPoison) { + mobs.statusDoT(who, dmg * 0.055, 300) //66% / (360 / 30) one tick every 30 cycles in 360 cycles total + } + }; bullet[me].do = function () {}; }, nailBot(speed = 1) { const me = bullet.length; const dir = mech.angle; - const RADIUS = (10 + 5 * Math.random()) * b.modBulletSize + const RADIUS = (10 + 5 * Math.random()) bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 4, RADIUS, { angle: dir, friction: 0, @@ -2319,7 +2332,7 @@ const b = { laserBot(speed = 1) { const me = bullet.length; const dir = mech.angle; - const RADIUS = (14 + 6 * Math.random()) * b.modBulletSize + const RADIUS = (14 + 6 * Math.random()) bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 3, RADIUS, { angle: dir, friction: 0, @@ -2610,7 +2623,7 @@ const b = { }, { name: "flechettes", //3 - description: "fire a precise volley of high velocity needles
that apply chemical damage over 3 seconds", + description: "fire a volley of uranium-235 needles
does damage over 3 seconds", ammo: 0, ammoPack: 23, defaultAmmoPack: 23, @@ -2633,15 +2646,15 @@ const b = { function makeFlechette(angle = mech.angle) { const me = bullet.length; - bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 45 * b.modBulletSize, 1.4 * b.modBulletSize, b.fireAttributes(angle)); + bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 45, 1.4, b.fireAttributes(angle)); // Matter.Body.setDensity(bullet[me], 0.0001); //0.001 is normal bullet[me].endCycle = game.cycle + 180; bullet[me].dmg = 0; bullet[me].onDmg = function (who) { if (b.isModDotFlechette) { - mobs.statusPoison(who, 0.33, 360) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds) + mobs.statusDoT(who, 0.33, 360) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds) } else { - mobs.statusPoison(who, 0.33, 180) // (2.3) / 6 ticks (3 seconds) + mobs.statusDoT(who, 0.33, 180) // (2.3) / 6 ticks (3 seconds) } }; @@ -2675,7 +2688,7 @@ const b = { const dir = mech.angle const SPEED = 10 const wiggleMag = mech.crouch ? 6 : 12 - const size = 5 * b.modBulletSize * (b.modWaveHelix === 1 ? 1 : 0.7) + const size = 5 * (b.modWaveHelix === 1 ? 1 : 0.7) for (let i = 0; i < b.modWaveHelix; i++) { const me = bullet.length; bullet[me] = Bodies.polygon(mech.pos.x + 25 * Math.cos(dir), mech.pos.y + 25 * Math.sin(dir), 7, size, { @@ -2812,8 +2825,8 @@ const b = { b.muzzleFlash(30); const SPEED = mech.crouch ? 29 : 25 const END = Math.floor(mech.crouch ? 30 : 18); - const side1 = 17 * b.modBulletSize - const side2 = 4 * b.modBulletSize + const side1 = 17 + const side2 = 4 const totalBullets = 6 const angleStep = (mech.crouch ? 0.06 : 0.25) / totalBullets let dir = mech.angle - angleStep * totalBullets / 2; @@ -2855,7 +2868,7 @@ const b = { fire() { const me = bullet.length; const dir = mech.angle; // + Math.random() * 0.05; - bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 20 * b.modBulletSize, b.fireAttributes(dir, true)); + bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 20, b.fireAttributes(dir, true)); b.fireProps(mech.crouch ? 30 : 20, mech.crouch ? 43 : 32, dir, me); //cd , speed Matter.Body.setDensity(bullet[me], 0.0005); bullet[me].totalCycles = 100; @@ -2917,7 +2930,7 @@ const b = { fire() { const me = bullet.length; const dir = mech.angle; - bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 35 * b.modBulletSize, b.fireAttributes(dir, false)); + bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 35, b.fireAttributes(dir, false)); b.fireProps(10, mech.crouch ? 42 : 28, dir, me); //cd , speed Matter.Body.setDensity(bullet[me], 0.0002); @@ -3138,7 +3151,7 @@ const b = { mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 12 : 5) * b.modFireRate); // cool down const me = bullet.length; const dir = mech.angle + 0.2 * (Math.random() - 0.5) - const RADIUS = (8 + 16 * Math.random()) * b.modBulletSize + const RADIUS = (8 + 16 * Math.random()) bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 25, RADIUS, { angle: dir, density: 0.00005, // 0.001 is normal density @@ -3236,7 +3249,7 @@ const b = { isEasyToAim: false, fire() { const me = bullet.length; - bullet[me] = Bodies.rectangle(0, 0, 0.015 * b.modBulletSize, 0.0015 * b.modBulletSize, { + bullet[me] = Bodies.rectangle(0, 0, 0.015, 0.0015, { density: 0.01, //0.001 is normal //frictionAir: 0.01, //restitution: 0, // angle: 0, @@ -3329,7 +3342,7 @@ const b = { }); //knock back - const KNOCK = ((mech.crouch) ? 0.1 : 0.5) * b.modBulletSize * b.modBulletSize * this.charge * this.charge + const KNOCK = ((mech.crouch) ? 0.1 : 0.5) * this.charge * this.charge player.force.x -= KNOCK * Math.cos(mech.angle) player.force.y -= KNOCK * Math.sin(mech.angle) * 0.35 //reduce knock back in vertical direction to stop super jumps @@ -3764,7 +3777,7 @@ const b = { // const me = bullet.length; // const dir = mech.angle // const TOTAL_CYCLES = 1020 - // bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(dir), mech.pos.y + 30 * Math.sin(dir), 3 * b.modBulletSize, { + // bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(dir), mech.pos.y + 30 * Math.sin(dir), 3 , { // density: 0.05, // //frictionAir: 0.01, // restitution: 0, @@ -3836,7 +3849,7 @@ const b = { // // mobs.alert(800); // const me = bullet.length; // const dir = mech.angle; - // bullet[me] = Bodies.rectangle(mech.pos.x + 50 * Math.cos(mech.angle), mech.pos.y + 50 * Math.sin(mech.angle), 70 * b.modBulletSize, 30 * b.modBulletSize, b.fireAttributes(dir)); + // bullet[me] = Bodies.rectangle(mech.pos.x + 50 * Math.cos(mech.angle), mech.pos.y + 50 * Math.sin(mech.angle), 70 , 30 , b.fireAttributes(dir)); // b.fireProps(mech.crouch ? 55 : 40, 50, dir, me); //cd , speed // bullet[me].endCycle = game.cycle + Math.floor(180 * b.isModBulletsLastLonger); // bullet[me].do = function () { @@ -3844,7 +3857,7 @@ const b = { // }; // //knock back - // const KNOCK = ((mech.crouch) ? 0.025 : 0.25) * b.modBulletSize * b.modBulletSize + // const KNOCK = ((mech.crouch) ? 0.025 : 0.25) // player.force.x -= KNOCK * Math.cos(dir) // player.force.y -= KNOCK * Math.sin(dir) * 0.3 //reduce knock back in vertical direction to stop super jumps // }, @@ -3858,7 +3871,7 @@ const b = { // fire() { // const dir = mech.angle + 0.2 * (Math.random() - 0.5); // const me = bullet.length; - // const RADIUS = 6 * b.modBulletSize + // const RADIUS = 6 // bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), RADIUS, { // angle: dir, // inertia: Infinity, diff --git a/js/game.js b/js/game.js index ab01791..6394034 100644 --- a/js/game.js +++ b/js/game.js @@ -89,7 +89,6 @@ const game = { x: 0, y: 0 }, - g: 0.001, onTitlePage: true, paused: false, diff --git a/js/index.js b/js/index.js index 419e672..3b52c3d 100644 --- a/js/index.js +++ b/js/index.js @@ -537,6 +537,14 @@ function cycle() { } game.loop(); + if (isNaN(mech.health)) { + console.log(`mech.health = ${mech.health}`) + game.paused = true; + game.replaceTextLog = true; + build.pauseGrid() + document.body.style.cursor = "auto"; + alert("health is NaN, please report this bug to the discord \n https://discordapp.com/invite/2eC9pgJ") + } // for (let i = 0, len = loop.length; i < len; i++) { // loop[i]() // } diff --git a/js/level.js b/js/level.js index d7b724b..b8a32ac 100644 --- a/js/level.js +++ b/js/level.js @@ -13,10 +13,10 @@ const level = { levelsCleared: 0, start() { if (build.isURLBuild && level.levelsCleared === 0) build.onLoadPowerUps(); - if (level.levelsCleared === 0) { + if (level.levelsCleared === 0) { //this code only runs on the first level // level.difficultyIncrease(9) // b.giveGuns("vacuum bomb") - // mech.setField("phase decoherence field") + // mech.setField("pilot wave") // mech.energy = 0.1; // b.giveMod("negative feedback"); // b.giveMod("photovoltaics"); @@ -147,9 +147,9 @@ const level = { spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump // spawn.laserBoss(2900, -500) - spawn.beamer(1200, -500) + // spawn.sucker(1200, -500) // spawn.timeSkipBoss(2900, -500) - // spawn.randomMob(3200, -500) + spawn.randomMob(1600, -500) }, bosses() { @@ -671,7 +671,7 @@ const level = { }); level.fill.push({ - x: 1760, + x: 1735, y: -1550, width: 1390, height: 550, @@ -701,7 +701,7 @@ const level = { //spawn.mapRect(-700, 0, 6250, 100); //ground spawn.mapRect(3400, 0, 2150, 100); //ground - spawn.mapRect(-700, -2000, 2110, 50); //Top left ledge + spawn.mapRect(-700, -2000, 2125, 50); //Top left ledge spawn.bodyRect(1300, -2125, 50, 125, 0.8); spawn.bodyRect(1307, -2225, 50, 100, 0.8); spawn.mapRect(-700, -2350, 50, 400); //far left starting left wall @@ -733,7 +733,7 @@ const level = { spawn.bodyRect(2710, -1250, 125, 125, 0.8); spawn.bodyRect(2705, -1350, 75, 100, 0.8); spawn.mapRect(3500, -1600, 350, 50); - spawn.mapRect(1750, -1600, 1410, 50); + spawn.mapRect(1725, -1600, 1435, 50); spawn.bodyRect(3100, -1015, 375, 15); spawn.bodyRect(3500, -850, 75, 125, 0.8); spawn.mapRect(3450, -1000, 50, 580); //left building wall diff --git a/js/mobs.js b/js/mobs.js index 9672ed4..dc48002 100644 --- a/js/mobs.js +++ b/js/mobs.js @@ -111,7 +111,7 @@ const mobs = { }) } }, - statusPoison(who, tickDamage, cycles = 180) { + statusDoT(who, tickDamage, cycles = 180) { if (!who.isShielded) { who.status.push({ effect() { @@ -126,40 +126,44 @@ const mobs = { time: game.drawTime }); } - }, - type: "poison", - endCycle: game.cycle + cycles, - startCycle: game.cycle - }) - } - }, - statusBurn(who, tickDamage, cycles = 90 + Math.floor(90 * Math.random())) { - if (!who.isShielded) { - //remove other "burn" effects on this mob - let i = who.status.length - while (i--) { - if (who.status[i].type === "burn") who.status.splice(i, 1); - } - who.status.push({ - effect() { - if ((game.cycle - this.startCycle) % 15 === 0) { - let dmg = b.dmgScale * tickDamage * 0.5 * (1 + Math.random()) - who.damage(dmg); - game.drawList.push({ //add dmg to draw queue - x: who.position.x, - y: who.position.y, - radius: Math.log(2 * dmg + 1.1) * 40, - color: `rgba(255,${Math.floor(200*Math.random())},0,0.9)`, - time: game.drawTime - }); + if (true) { + //check for nearby mobs + } }, - type: "burn", + // type: "DoT", endCycle: game.cycle + cycles, startCycle: game.cycle }) } }, + // statusBurn(who, tickDamage, cycles = 90 + Math.floor(90 * Math.random())) { + // if (!who.isShielded) { + // //remove other "burn" effects on this mob + // let i = who.status.length + // while (i--) { + // if (who.status[i].type === "burn") who.status.splice(i, 1); + // } + // who.status.push({ + // effect() { + // if ((game.cycle - this.startCycle) % 15 === 0) { + // let dmg = b.dmgScale * tickDamage * 0.5 * (1 + Math.random()) + // who.damage(dmg); + // game.drawList.push({ //add dmg to draw queue + // x: who.position.x, + // y: who.position.y, + // radius: Math.log(2 * dmg + 1.1) * 40, + // color: `rgba(255,${Math.floor(200*Math.random())},0,0.9)`, + // time: game.drawTime + // }); + // } + // }, + // type: "burn", + // endCycle: game.cycle + cycles, + // startCycle: game.cycle + // }) + // } + // }, //********************************************************************************************** //********************************************************************************************** diff --git a/js/player.js b/js/player.js index 4a28073..adb2689 100644 --- a/js/player.js +++ b/js/player.js @@ -1722,15 +1722,15 @@ const mech = { mech.hold = function () { if (mech.energy > mech.fieldEnergyMax - 0.02 && mech.fieldCDcycle < mech.cycle) { if (b.isModSporeField) { - mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones + // mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones const len = Math.floor(6 + 4 * Math.random()) - mech.energy -= len * 0.06; + mech.energy -= len * 0.074; for (let i = 0; i < len; i++) { b.spore(player) } } else if (b.isModMissileField) { - mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones - mech.energy -= 0.44; + // mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones + mech.energy -= 0.5; b.missile({ x: mech.pos.x + 40 * Math.cos(mech.angle), y: mech.pos.y + 40 * Math.sin(mech.angle) - 3 @@ -1740,11 +1740,11 @@ const mech = { 1, b.modBabyMissiles) } else if (b.isModIceField) { // mech.fieldCDcycle = mech.cycle + 17; // set cool down to prevent +energy from making huge numbers of drones - mech.energy -= 0.055; + mech.energy -= 0.061; b.iceIX(1) } else { - mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones - mech.energy -= 0.34; + // mech.fieldCDcycle = mech.cycle + 10; // set cool down to prevent +energy from making huge numbers of drones + mech.energy -= 0.33; b.drone(1) } @@ -1891,5 +1891,63 @@ const mech = { } } }, + // { + // name: "pilot wave", + // description: "push stuff", + // isEasyToAim: false, + // effect: () => { + // game.replaceTextLog = true; //allow text over write + // mech.lastMouseInGame = { + // x: game.mouseInGame.x, + // y: game.mouseInGame.y + // } + // mech.drop(); + // mech.fieldPhase = 0; + // mech.hold = function () { + // if ((keys[32] || game.mouseDownRight && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed + // mech.grabPowerUp(); + // //disable if player is inside field + + // const radius = 100 + // if (mech.energy > 0.05) { + // // && Vector.magnitude(Vector.sub(game.mouseInGame, player.position)) > radius * 1.5 + // //find mouse velocity + // const diff = Vector.sub(game.mouseInGame, mech.lastMouseInGame) + // const velocity = Vector.mult(Vector.normalise(diff), Math.min(Vector.magnitude(diff), 60)) //limit velocity + // //find nearby blocks + // for (let i = 0, len = body.length; i < len; ++i) { + // if (Vector.magnitude(Vector.sub(body[i].position, game.mouseInGame)) < radius) { + + // // Matter.Query.collides(body, bodies) + // Matter.Body.setVelocity(body[i], velocity); //give block mouse velocity + // body[i].force.y -= body[i].mass * game.g; //antigravity + // //maybe give blocks some weak attraction to mouse + // } + // } + // ctx.beginPath(); + // const rotate = mech.cycle * 0.008; + // mech.fieldPhase += 0.2 // - 0.5 * Math.sqrt(Math.min(mech.energy, 1)); + // const off1 = 1 + 0.06 * Math.sin(mech.fieldPhase); + // const off2 = 1 - 0.06 * Math.sin(mech.fieldPhase); + // ctx.beginPath(); + // ctx.ellipse(game.mouseInGame.x, game.mouseInGame.y, radius * off1, radius * off2, rotate, 0, 2 * Math.PI); + // // ctx.arc(game.mouseInGame.x, game.mouseInGame.y, this.fieldRange, 0, 2 * Math.PI); + // ctx.fillStyle = "#eef"; + // ctx.globalCompositeOperation = "difference"; + // ctx.fill(); + // ctx.strokeStyle = "#000"; + // ctx.lineWidth = 1; + // ctx.stroke(); + // ctx.globalCompositeOperation = "source-over"; + // } + // } + // mech.lastMouseInGame = { //constantly log last mouse position so you can calc mouse velocity + // x: game.mouseInGame.x, + // y: game.mouseInGame.y + // } + // mech.drawFieldMeter() + // } + // } + // }, ], }; \ No newline at end of file diff --git a/todo.txt b/todo.txt index a6b64e0..ecc63ad 100644 --- a/todo.txt +++ b/todo.txt @@ -1,12 +1,35 @@ mod - spores follow player +mod - nails do 66% extra damage over 6 seconds + ************** TODO - n-gon ************** +field - pilot wave + while mouse is down blocks (and mobs?) are move with the mouse + players can do serious damage by flicking the mouse and firing blocks + on mouse down calculate relative position of block to mouse and maintain that as mouse moves + on mouse up give blocks the computed mouse velocity + use a gravity effect that pulls blocks in range towards the center of the mouse + maybe no force in the very center to prevent clumping + draw a ellipse around the mouse that wobbles like phase decoherence field, and changes color maybe like negative mass field + +make flurooantimonic acid mod a damage over time + rename to radiation damage? + +mod - radiation damage over time effects can spread to nearby mobs + do a check for nearby mobs on each tick + +try adding a subtile shift of color towards red, green or blue + block, map, background, text? color + could be random as each level loads + player health becomes NaN occurred a few times at higher levels game.dmgScale, game.healScale not corrupted + didn't occur: shotgun / laser with all mods that have no requirements + mod - killing a stunned mob gives something ammo or heal power up?