eddy current brake

mod perfect diamagnetism: eddy current brake - mobs have a speed limit when they are near you
This commit is contained in:
landgreen
2020-10-05 08:55:48 -07:00
parent 7947e69d4d
commit 0d2a570ebd
5 changed files with 46 additions and 26 deletions

View File

@@ -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();