bug fixes

This commit is contained in:
landgreen
2020-12-02 18:54:50 -08:00
parent c855508dda
commit 257a9db297
8 changed files with 52 additions and 51 deletions

View File

@@ -101,13 +101,13 @@ function collisionChecks(event) {
(obj === playerBody || obj === playerHead) &&
!(mod.isFreezeHarmImmune && (mob[k].isSlowed || mob[k].isStunned))
) {
mech.immuneCycle = mech.cycle + mod.collisionImmuneCycles; //player is immune to collision damage for 30 cycles
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);
if (mod.isPiezo) mech.energy += mech.maxEnergy * 2;
if (mod.isBayesian) powerUps.ejectMod()
if (mob[k].onHit) mob[k].onHit(k);
mech.immuneCycle = mech.cycle + mod.collisionImmuneCycles; //player is immune to collision damage for 30 cycles
//extra kick between player and mob //this section would be better with forces but they don't work...
let angle = Math.atan2(player.position.y - mob[k].position.y, player.position.x - mob[k].position.x);
Matter.Body.setVelocity(player, {