eddy current brake
mod perfect diamagnetism: eddy current brake - mobs have a speed limit when they are near you
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
27
js/mods.js
27
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<br>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<br>at least 2 rerolls",
|
||||
effect() {
|
||||
mod.renormalization = true;
|
||||
},
|
||||
@@ -2470,6 +2470,22 @@ const mod = {
|
||||
mod.isStunField = 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "eddy current brake",
|
||||
description: "you are <strong>surrounded</strong> by a field that<br>limits the <strong>top speed</strong> 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 <strong>400%</strong> <strong class='color-d'>damage</strong><br>to <strong>stunned</strong> mobs",
|
||||
@@ -3006,5 +3022,6 @@ const mod = {
|
||||
isNoFireDamage: null,
|
||||
duplicateChance: null,
|
||||
beamSplitter: null,
|
||||
iceEnergy: null
|
||||
iceEnergy: null,
|
||||
isPerfectBrake: null
|
||||
}
|
||||
31
js/player.js
31
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
6
todo.txt
6
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?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user