custom run difficulty scaling

This commit is contained in:
landgreen
2020-01-18 07:51:03 -08:00
parent 14dc313517
commit 57126ab42e
8 changed files with 185 additions and 162 deletions

View File

@@ -895,7 +895,7 @@ const mech = {
pushMass(who) {
const speed = Vector.magnitude(Vector.sub(who.velocity, player.velocity))
const fieldBlockCost = 0.03 + Math.sqrt(who.mass) * speed * 0.003 //0.012
if (mech.fieldMeter > fieldBlockCost * 0.6) { //shield needs at least some of the cost to block
if (mech.fieldMeter > fieldBlockCost * 0.2) { //shield needs at least some of the cost to block
mech.fieldMeter -= fieldBlockCost * mech.fieldShieldingScale;
if (mech.fieldMeter < 0) mech.fieldMeter = 0;
mech.drawHold(who);