time stop field added, extra mech.cycle

This commit is contained in:
landgreen
2019-10-16 06:51:35 -07:00
parent bbf3b9b79f
commit 963c930120
7 changed files with 338 additions and 291 deletions

View File

@@ -89,9 +89,9 @@ function mobCollisionChecks(event) {
function collide(obj) {
//player and mob collision
if (obj === playerBody || obj === playerHead) {
if (mech.damageImmune < game.cycle) {
if (mech.damageImmune < mech.cycle) {
//player is immune to mob collision damage for 30 cycles
mech.damageImmune = game.cycle + 30;
mech.damageImmune = mech.cycle + 30;
mob[k].foundPlayer();
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * game.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
mech.damage(dmg);