added mine mod and felechette mod

This commit is contained in:
landgreen
2020-02-26 05:58:29 -08:00
parent 86673b5d21
commit e0354c28e3
5 changed files with 140 additions and 59 deletions

View File

@@ -97,8 +97,12 @@ function collisionChecks(event) {
function collidePlayer(obj, speedThreshold = 12, massThreshold = 2) {
//player dmg from hitting a body
if (obj.classType === "body" && obj.speed > speedThreshold && obj.mass > massThreshold &&
(obj.velocity.y > 0 || player.velocity.y > 0)) {
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.collisionImmuneCycle < mech.cycle) {
mech.collisionImmuneCycle = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles