diff --git a/js/bullets.js b/js/bullets.js index ef0c900..ef12c8f 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -73,7 +73,7 @@ const b = { }, mods: [{ name: "depleted uranium rounds", - description: `your bullets are +13% larger
increased mass and physical damage`, + description: `your bullets are +13% larger
increased mass and physical damage`, count: 0, maxCount: 9, allowed() { @@ -89,7 +89,7 @@ const b = { }, { name: "fluoroantimonic acid", - description: "each bullet does extra chemical damage
active when you are above 80% base health", + description: "each bullet does instant damage
active when you are above 80% base health", maxCount: 1, count: 0, allowed() { @@ -108,7 +108,7 @@ const b = { }, { name: "kinetic bombardment", - description: "do up to 33% more damage at a distance
increase maxes out at about 40 steps away", + description: "do up to 33% more damage at a distance
increase maxes out at about 40 steps away", maxCount: 1, count: 0, allowed() { @@ -156,7 +156,7 @@ const b = { }, { name: "high explosives", - description: "explosions do +20% more damage
explosive area is +44% larger", + description: "explosions do +20% more damage
explosive area is +44% larger", maxCount: 3, count: 0, allowed() { @@ -172,7 +172,7 @@ const b = { }, { name: "electric reactive armour", - description: "explosions do no harm
explosions drain energy", + description: "explosions drain your energy
instead of harming you", maxCount: 1, count: 0, allowed() { @@ -306,7 +306,7 @@ const b = { { name: "zoospore vector", - description: "mobs discharge spores on death
+11% chance", + description: "mobs discharge spores on death
+11% chance", maxCount: 9, count: 0, allowed() { @@ -409,7 +409,7 @@ const b = { }, { name: "basidio-stomp", - description: "hard landings disrupt spores from the ground
immune to harm from falling", + description: "hard landings disrupt spores in the ground
immune to harm from falling", maxCount: 1, count: 0, allowed() { @@ -655,6 +655,22 @@ const b = { b.isModBayesian = 0; } }, + { + name: "+1 cardinality", + description: "one extra choice when selecting power ups", + maxCount: 1, + count: 0, + allowed() { + return true + }, + requires: "", + effect: () => { + b.isModFourOptions = true; + }, + remove() { + b.isModFourOptions = false; + } + }, { name: "catabolism", description: "gain ammo when you fire while out of ammo
drains 3% of current remaining health", @@ -696,19 +712,31 @@ const b = { } }, { - name: "+1 cardinality", - description: "one extra choice when selecting power ups", + name: "reallocation", + description: "convert 1 random mod into 2 new guns
recursive mods can lose all stacks", maxCount: 1, count: 0, allowed() { - return true + return (b.modCount > 0) && !build.isCustomSelection }, - requires: "", + requires: "at least 1 mod", effect: () => { - b.isModFourOptions = true; + const have = [] //find which mods you have + for (let i = 0; i < b.mods.length; i++) { + if (b.mods[i].count > 0) have.push(i) + } + const choose = have[Math.floor(Math.random() * have.length)] + b.mods[choose].remove(); // remove a random mod form the list of mods you have + b.mods[choose].count = 0; + game.updateModHUD(); + + for (let i = 0; i < 2; i++) { + powerUps.spawn(mech.pos.x, mech.pos.y, "gun"); + if (Math.random() < b.isModBayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "gun"); + } }, remove() { - b.isModFourOptions = false; + //nothing to remove } }, { @@ -737,7 +765,7 @@ const b = { { name: "ice crystal nucleation", - description: "your minigun condenses unlimited ammo
ice bullets made from water vapor slow mobs", + description: "your minigun condenses unlimited ammo
ice bullets made from water vapor slow mobs", maxCount: 1, count: 0, allowed() { @@ -834,7 +862,7 @@ const b = { }, { name: "irradiated needles", - description: "fléchette needles are exposed to radiation
needles do 3x damage over 6 seconds", + description: "fléchette needles are exposed to radiation
needles do 2x damage spread over 6 seconds", maxCount: 1, count: 0, allowed() { @@ -936,7 +964,7 @@ const b = { }, { name: "tinsellated flagella", - description: "spores accelerate 33% faster", + description: "spores accelerate 33% faster", maxCount: 1, count: 0, allowed() { @@ -1088,7 +1116,7 @@ const b = { }, { name: "mycelium manufacturing", - description: "nano-scale manufacturing is repurposed
excess energy used to grow spores", + description: "nano-scale manufacturing is repurposed
excess energy used to grow spores", maxCount: 1, count: 0, allowed() { @@ -1335,7 +1363,7 @@ const b = { } } }, - explosion(where, radius) { + explosion(where, radius, isBurn = false) { radius *= b.modExplosionRadius // typically explode is used for some bullets with .onEnd //add dmg to draw queue @@ -1430,7 +1458,9 @@ const b = { mob[i].force.x += knock.x; 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 + damageScale *= 0.8 //reduced damage for each additional explosion target + // mobs.statusBlind(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); @@ -1690,7 +1720,7 @@ const b = { friction: 0, frictionAir: 0.025, thrust: b.isModFastSpores ? 0.0008 : 0.0004, - dmg: 2.2, //damage done in addition to the damage from momentum + dmg: 0, //2.2, //damage done in addition to the damage from momentum classType: "bullet", collisionFilter: { category: cat.bullet, @@ -1698,7 +1728,8 @@ const b = { }, endCycle: game.cycle + Math.floor((660 + Math.floor(Math.random() * 240)) * b.isModBulletsLastLonger), minDmgSpeed: 0, - onDmg() { + onDmg(who) { + mobs.statusPoison(who, 0.5, 180) // (2.2) * 1.3 * 30/180 // 6 ticks (3 seconds) this.endCycle = 0; //bullet ends cycle after doing damage }, onEnd() {}, @@ -2063,7 +2094,7 @@ const b = { }, guns: [{ name: "minigun", //0 - description: "rapidly fire a stream of small bullets", + description: "rapidly fire a stream of small bullets", ammo: 0, ammoPack: 55, defaultAmmoPack: 55, @@ -2167,7 +2198,7 @@ const b = { }, { name: "fléchettes", //3 - description: "fire a volley of precise high velocity needles", + description: "fire a precise volley of high velocity needles
needles deliver chemical damage over 3 seconds", ammo: 0, ammoPack: 22, defaultAmmoPack: 22, @@ -2193,14 +2224,14 @@ const b = { 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)); Matter.Body.setDensity(bullet[me], 0.0001); //0.001 is normal bullet[me].endCycle = game.cycle + 180; - if (b.isModDotFlechette) { - bullet[me].dmg = 0; - bullet[me].onDmg = function (who) { - mobs.statusDot(who, 0.35, 360) // (1.4) * 3 / 12 ticks (6 seconds) - }; - } else { - bullet[me].dmg = 1.4; - } + bullet[me].dmg = 0; + bullet[me].onDmg = function (who) { + if (b.isModDotFlechette) { + mobs.statusPoison(who, 0.38, 360) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds) + } else { + mobs.statusPoison(who, 0.38, 180) // (2.3) / 6 ticks (3 seconds) + } + }; bullet[me].do = function () { if (this.speed < 10) this.force.y += this.mass * 0.0003; //no gravity until it slows don to improve aiming @@ -2332,7 +2363,7 @@ const b = { }, { name: "missiles", - description: "fire missiles that accelerate towards mobs
explodes when near target", + description: "fire missiles that accelerate towards mobs
explodes when near target", ammo: 0, ammoPack: 4, have: false, @@ -2354,7 +2385,7 @@ const b = { }, { name: "flak", - description: "fire a cluster of short range projectiles
explodes on contact or after half a second", + description: "fire a cluster of short range projectiles
explodes on contact or after half a second", ammo: 0, ammoPack: 6, defaultAmmoPack: 6, //use to revert ammoPack after mod changes drop rate @@ -2400,7 +2431,7 @@ const b = { }, { name: "grenades", //7 - description: "lob a single bouncy projectile
explodes on contact or after one second", + description: "lob a single bouncy projectile
explodes on contact or after one second", ammo: 0, ammoPack: 7, have: false, @@ -2559,7 +2590,7 @@ const b = { }, { name: "spores", //10 - description: "fire orbs that discharge spores
spores seek out mobs", + description: "fire sporangiums that discharge spores
spores do damage over 3 seconds", ammo: 0, ammoPack: (game.difficultyMode > 3) ? 3 : 4, have: false, @@ -3120,7 +3151,7 @@ const b = { }, { name: "pulse", //15 - description: "convert 25% of your energy into a pulsed laser
instantly initiates a fusion explosion", + description: "convert 25% of your energy into a pulsed laser
instantly initiates a fusion explosion", ammo: 0, ammoPack: Infinity, have: false, @@ -3202,7 +3233,7 @@ const b = { //use energy to explode const energy = 0.3 * Math.min(mech.energy, 1.75) mech.energy -= energy - if (best.who) b.explosion(path[1], 1000 * energy) + if (best.who) b.explosion(path[1], 1000 * energy, true) mech.fireCDcycle = mech.cycle + Math.floor(60 * b.modFireRate); // cool down //draw laser beam diff --git a/js/level.js b/js/level.js index 2a44256..f4aac78 100644 --- a/js/level.js +++ b/js/level.js @@ -14,13 +14,13 @@ const level = { start() { if (level.levelsCleared === 0) { // level.difficultyIncrease(9) - b.giveGuns("fléchettes") + // b.giveGuns("fléchettes") // mech.setField("phase decoherence field") - b.giveMod("irradiated needles"); + // b.giveMod("irradiated needles"); // b.giveMod("reflective cavity"); - // level.intro(); //starting level - level.testingMap(); + level.intro(); //starting level + // level.testingMap(); // level.bosses(); // level.satellite(); // level.skyscrapers(); diff --git a/js/mobs.js b/js/mobs.js index 0816df9..82c46d3 100644 --- a/js/mobs.js +++ b/js/mobs.js @@ -54,7 +54,6 @@ const mobs = { while (i--) { if (who.status[i].type === "slow") who.status.splice(i, 1); } - //add a new slow effect who.status.push({ effect() { Matter.Body.setVelocity(who, { @@ -78,7 +77,25 @@ const mobs = { endCycle: game.cycle + cycles, }) }, - statusDot(who, tickDamage, cycles = 180) { + statusBlind(who, cycles = 60) { + //remove other "stun" effects on this mob + let i = who.status.length + while (i--) { + if (who.status[i].type === "blind") who.status.splice(i, 1); + } + who.status.push({ + effect() { + // Matter.Body.setVelocity(who, { + // x: 0, + // y: 0 + // }); + // Matter.Body.setAngularVelocity(who, 0); + }, + type: "blind", + endCycle: game.cycle + cycles, + }) + }, + statusPoison(who, tickDamage, cycles = 180) { who.status.push({ effect() { if ((game.cycle - this.startCycle) % 30 === 0) { @@ -88,12 +105,37 @@ const mobs = { x: who.position.x, y: who.position.y, radius: Math.log(2 * dmg + 1.1) * 40, - color: game.playerDmgColor, + color: "rgba(0,80,80,0.9)", time: game.drawTime }); } }, - type: "dot", + type: "poison", + endCycle: game.cycle + cycles, + startCycle: game.cycle + }) + }, + statusBurn(who, tickDamage, cycles = 90 + Math.floor(90 * Math.random())) { + //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(255*Math.random())},0,0.9)`, + time: game.drawTime + }); + } + }, + type: "burn", endCycle: game.cycle + cycles, startCycle: game.cycle }) @@ -282,38 +324,26 @@ const mobs = { x: player.position.x, // + (Math.random() - 0.5) * 50, y: player.position.y + (Math.random() - 0.5) * 110 }; - //mob vision for testing - // ctx.beginPath(); - // ctx.lineWidth = "5"; - // ctx.strokeStyle = "#ff0"; - // ctx.moveTo(this.position.x, this.position.y); - // ctx.lineTo(targetPos.x, targetPos.y); - // ctx.stroke(); - // return targetPos; }, - - hacked() { //set this.hackedTarget variable before running this method - //find a new target - if (!(game.cycle % this.seePlayerFreq)) { - this.hackedTarget = null - for (let i = 0, len = mob.length; i < len; i++) { - if (mob[i] !== this) { - // const DIST = Vector.magnitude(Vector.sub(this.position, mob[j])); - if (Matter.Query.ray(map, this.position, mob[i].position).length === 0 && - Matter.Query.ray(body, this.position, mob[i].position).length === 0) { - this.hackedTarget = mob[i] - } - } - } - } - - //acceleration towards targets - if (this.hackedTarget) { - this.force = Vector.mult(Vector.normalise(Vector.sub(this.hackedTarget.position, this.position)), this.mass * 0.0015) - } - - }, - + // hacked() { //set this.hackedTarget variable before running this method + // //find a new target + // if (!(game.cycle % this.seePlayerFreq)) { + // this.hackedTarget = null + // for (let i = 0, len = mob.length; i < len; i++) { + // if (mob[i] !== this) { + // // const DIST = Vector.magnitude(Vector.sub(this.position, mob[j])); + // if (Matter.Query.ray(map, this.position, mob[i].position).length === 0 && + // Matter.Query.ray(body, this.position, mob[i].position).length === 0) { + // this.hackedTarget = mob[i] + // } + // } + // } + // } + // //acceleration towards targets + // if (this.hackedTarget) { + // this.force = Vector.mult(Vector.normalise(Vector.sub(this.hackedTarget.position, this.position)), this.mass * 0.0015) + // } + // }, laserBeam() { if (game.cycle % 7 && this.seePlayer.yes) { ctx.setLineDash([125 * Math.random(), 125 * Math.random()]); @@ -564,66 +594,7 @@ const mobs = { mob[i].locatePlayer(); } } - //add alert to draw queue - // game.drawList.push({ - // x: this.position.x, - // y: this.position.y, - // radius: Math.sqrt(this.alertRange2), - // color: "rgba(0,0,0,0.02)", - // time: game.drawTime - // }); }, - // zoom() { - // this.zoomMode--; - // if (this.zoomMode > 150) { - // this.drawTrail(); - // if (this.seePlayer.recall) { - // //attraction to player - // const forceMag = this.accelMag * this.mass; - // const angle = Math.atan2(player.position.y - this.position.y, player.position.x - this.position.x); - // this.force.x += forceMag * Math.cos(angle); - // this.force.y += forceMag * Math.sin(angle); - // } - // } else if (this.zoomMode < 0) { - // this.zoomMode = 300; - // this.setupTrail(); - // } - // }, - // setupTrail() { - // this.trail = []; - // for (let i = 0; i < this.trailLength; ++i) { - // this.trail.push({ - // x: this.position.x, - // y: this.position.y - // }); - // } - // }, - // drawTrail() { - // //dont' forget to run setupTrail() after mob spawn - // const t = this.trail; - // const len = t.length; - // t.pop(); - // t.unshift({ - // x: this.position.x, - // y: this.position.y - // }); - // //draw - // ctx.strokeStyle = this.trailFill; - // ctx.beginPath(); - // // ctx.moveTo(t[0].x, t[0].y); - // // ctx.lineTo(t[0].x, t[0].y); - // // ctx.globalAlpha = 0.2; - // // ctx.lineWidth = this.radius * 3; - // // ctx.stroke(); - // ctx.globalAlpha = 0.5 / len; - // ctx.lineWidth = this.radius * 1.95; - // for (let i = 0; i < len; ++i) { - // // ctx.lineWidth *= 0.96; - // ctx.lineTo(t[i].x, t[i].y); - // ctx.stroke(); - // } - // ctx.globalAlpha = 1; - // }, curl(range = 1000, mag = -10) { //cause all mobs, and bodies to rotate in a circle applyCurl = function (center, array) { diff --git a/style.css b/style.css index 3322b5b..d2f309a 100644 --- a/style.css +++ b/style.css @@ -421,6 +421,11 @@ em { letter-spacing: 1px; } +.color-p { + color: #067; + letter-spacing: 1px; +} + .color-h { color: #0b7; letter-spacing: 1px; diff --git a/todo.txt b/todo.txt index 3efc9d2..0f8573c 100644 --- a/todo.txt +++ b/todo.txt @@ -1,7 +1,7 @@ ************** TODO - n-gon ************** -mod - lose your field, gain two guns? - lose a random mod, gain a gun? +mod - status effects last 1 second longer + stun, slow, poison mod - time dilation - Quantum Recovery Expending all your energy while using the field will @@ -21,11 +21,12 @@ bug - getting stuck in crouch mode mobs - add in a function to the main loops that does injected code for each mob each mob would get an object with a game.cycle for ending and a method to run each cycle until the end is met this could be a DoT, graphics, slow, blind - stun - blind, slow, but increased gravity effects - mod - flechettes mod for DoT poison damage + stun - combine blind, slow + with increased gravity effects, but how + burn effect doesn't look right, too similar to poison mod - grenade explosions stun enemies mod - vacuum bomb does DoT damage after exploding - + settings - auto aim at nearest mob settings - custom keys binding @@ -41,13 +42,6 @@ gun - buff vacuum bomb mod - make bodies destroyable they drop ammo and heals -mod - BIOS update - lose all mods other than BIOS update - deal +100% damage from all sources -mod - Infrared Sensors - You can see invisible enemies - this seems weak, maybe add to one of the fields - mod - mines - fire something instead of needles on activation foam?, flak?, vacuum bomb, super balls make a different mod for each type of bullet mine can fire