diff --git a/js/game.js b/js/game.js index 7b1c6b0..aa82260 100644 --- a/js/game.js +++ b/js/game.js @@ -842,6 +842,10 @@ const game = { }, checks() { if (!(mech.cycle % 60)) { //once a second + + //every second energy above max energy loses 25% + if (mech.energy > mech.maxEnergy) mech.energy = 1 + (mech.maxEnergy - mech.energy) * 0.75 + if (mech.pos.y > game.fallHeight) { // if 4000px deep if (game.difficultyMode > 2) { mech.death(); diff --git a/js/level.js b/js/level.js index 7206aa8..60bd594 100644 --- a/js/level.js +++ b/js/level.js @@ -10,7 +10,7 @@ const level = { levels: ["skyscrapers", "rooftops", "warehouse", "highrise", "office", "aerie", "satellite", "sewers", "testChamber"], start() { if (level.levelsCleared === 0) { //this code only runs on the first level - // level.difficultyIncrease(8) + level.difficultyIncrease(8) // game.enableConstructMode() //used to build maps in testing mode // game.zoomScale = 1000; // game.setZoom(); @@ -20,7 +20,7 @@ const level = { // for (let i = 0; i < 10; i++) { // mod.giveMod("laser-bot"); // } - // mod.giveMod("orbit-bot upgrade") + // mod.giveMod("eddy current brake") level.intro(); //starting level diff --git a/js/mods.js b/js/mods.js index 470f51b..1143333 100644 --- a/js/mods.js +++ b/js/mods.js @@ -1440,9 +1440,9 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isSuperDeterminism && !mod.isRerollHaste + return powerUps.reroll.rerolls < 3 && !mod.isSuperDeterminism && !mod.isRerollHaste }, - requires: "not superdeterminism or Ψ(t) collapse", + requires: "not superdeterminism or Ψ(t) collapse
fewer than 3 rerolls", effect: () => { mod.manyWorlds = true; }, @@ -1456,9 +1456,9 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isSuperDeterminism && !mod.isRerollHaste + return (powerUps.reroll.rerolls > 1 || build.isCustomSelection) && !mod.isSuperDeterminism && !mod.isRerollHaste }, - requires: "not superdeterminism or Ψ(t) collapse", + requires: "not superdeterminism or Ψ(t) collapse
at least 2 rerolls", effect() { mod.renormalization = true; }, @@ -2470,6 +2470,22 @@ const mod = { mod.isStunField = 0; } }, + { + name: "eddy current brake", + description: "you are surrounded by a field that
limits the top speed of mobs", + maxCount: 1, + count: 0, + allowed() { + return mech.fieldUpgrades[mech.fieldMode].name === "perfect diamagnetism" + }, + requires: "perfect diamagnetism", + effect() { + mod.isPerfectBrake = true; + }, + remove() { + mod.isPerfectBrake = false; + } + }, { name: "fracture analysis", description: "bullet impacts do 400% damage
to stunned mobs", @@ -3006,5 +3022,6 @@ const mod = { isNoFireDamage: null, duplicateChance: null, beamSplitter: null, - iceEnergy: null + iceEnergy: null, + isPerfectBrake: null } \ No newline at end of file diff --git a/js/player.js b/js/player.js index 7e50818..96c2d62 100644 --- a/js/player.js +++ b/js/player.js @@ -1303,20 +1303,6 @@ const mech = { // mech.fieldArc = 0.3; //run calculateFieldThreshold after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob) // mech.calculateFieldThreshold(); mech.hold = function () { - - //cap mob speed based on distance - for (let i = 0; i < mob.length; i++) { - const distance = Vector.magnitude(Vector.sub(mech.pos, mob[i].position)) - const range = 1000 - if (distance < range) { - const cap = Math.max(0.01 * distance, 4) - if (mob[i].speed > cap) { - Matter.Body.setVelocity(mob[i], Vector.mult(Vector.normalise(mob[i].velocity), cap)); //set velocity to cap, but keep the direction - } - } - } - - const wave = Math.sin(mech.cycle * 0.022); mech.fieldRange = 170 + 12 * wave mech.fieldArc = 0.33 + 0.045 * wave //run calculateFieldThreshold after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob) @@ -1361,6 +1347,23 @@ const mech = { mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists) } mech.drawFieldMeter() + + if (mod.isPerfectBrake) { //cap mob speed around player + const range = 400 + 120 * wave + for (let i = 0; i < mob.length; i++) { + const distance = Vector.magnitude(Vector.sub(mech.pos, mob[i].position)) + if (distance < range) { + const cap = mob[i].isShielded ? 7 : 3.5 + if (mob[i].speed > cap && Vector.dot(mob[i].velocity, Vector.sub(mech.pos, mob[i].position)) > 0) { // if velocity is directed towards player + Matter.Body.setVelocity(mob[i], Vector.mult(Vector.normalise(mob[i].velocity), cap)); //set velocity to cap, but keep the direction + } + } + } + ctx.beginPath(); + ctx.arc(mech.pos.x, mech.pos.y, range, 0, 2 * Math.PI); + ctx.fillStyle = "hsla(200,50%,61%,0.08)"; + ctx.fill(); + } } } }, diff --git a/todo.txt b/todo.txt index 77ba18d..40f25b6 100644 --- a/todo.txt +++ b/todo.txt @@ -1,11 +1,7 @@ -laser bots now use the same laser code as the player -mod: thermoelectric effect - ice IX bullets give you 7% energy after they collides with mobs +mod perfect diamagnetism: eddy current brake - mobs have a speed limit when they are near you ************** TODO - n-gon ************** -a gun that gives back energy - if your energy is below 90% your drones stay near you and give energy regen - buff neutron bomb? less fire CD?