added several new mods

This commit is contained in:
landgreen
2020-02-09 16:13:17 -08:00
parent b4dfb7a51d
commit b6604643db
7 changed files with 254 additions and 185 deletions

View File

@@ -100,7 +100,9 @@ function collisionChecks(event) {
}
function collidePlayer(obj, speedThreshold = 12, massThreshold = 2) {
if (obj.classType === "body" && obj.speed > speedThreshold && obj.mass > massThreshold) { //dmg from hitting a body
//player dmg from hitting a body
if (obj.classType === "body" && obj.speed > speedThreshold && obj.mass > massThreshold &&
(obj.velocity.y > 0 || player.velocity.y > 0)) {
const v = Vector.magnitude(Vector.sub(player.velocity, obj.velocity));
if (v > speedThreshold && mech.collisionImmune < mech.cycle) {
mech.collisionImmune = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles