cloaking field

mod: waste heat recovery is removed
mod - fracture analysis only applies to stunned mobs (not unaware mobs)

phase field is removed
new field: metamaterial cloaking
mod: phase decoherence - intangible to mobs while cloaked, but passing through mobs drains energy
mod: flashbang - stun mobs as you exit cloak
This commit is contained in:
landgreen
2020-09-19 09:11:55 -07:00
parent 2e7016d3d6
commit f334372281
10 changed files with 454 additions and 267 deletions

View File

@@ -292,13 +292,16 @@ const mobs = {
this.seePlayer.position.x = player.position.x;
this.seePlayer.position.y = player.position.y;
},
// locatePlayerByDist() {
// if (this.distanceToPlayer2() < this.locateRange) {
// this.locatePlayer();
// }
// },
alertNearByMobs() {
//this.alertRange2 is set at the very bottom of this mobs, after mob is made
for (let i = 0; i < mob.length; i++) {
if (!mob[i].seePlayer.recall && Vector.magnitudeSquared(Vector.sub(this.position, mob[i].position)) < this.alertRange2) {
mob[i].locatePlayer();
}
}
},
alwaysSeePlayer() {
if (!mech.isStealth) {
if (!mech.isCloak) {
this.seePlayer.recall = true;
this.seePlayer.position.x = player.position.x;
this.seePlayer.position.y = player.position.y;
@@ -310,7 +313,7 @@ const mobs = {
this.distanceToPlayer2() < this.seeAtDistance2 &&
Matter.Query.ray(map, this.position, this.mechPosRange()).length === 0 &&
Matter.Query.ray(body, this.position, this.mechPosRange()).length === 0 &&
!mech.isStealth
!mech.isCloak
) {
this.foundPlayer();
} else if (this.seePlayer.recall) {
@@ -320,7 +323,7 @@ const mobs = {
},
seePlayerCheckByDistance() {
if (!(game.cycle % this.seePlayerFreq)) {
if (this.distanceToPlayer2() < this.seeAtDistance2 && !mech.isStealth) {
if (this.distanceToPlayer2() < this.seeAtDistance2 && !mech.isCloak) {
this.foundPlayer();
} else if (this.seePlayer.recall) {
this.lostPlayer();
@@ -331,7 +334,7 @@ const mobs = {
if (!(game.cycle % this.seePlayerFreq)) {
if (
(this.distanceToPlayer2() < this.seeAtDistance2 || (Matter.Query.ray(map, this.position, this.mechPosRange()).length === 0 && Matter.Query.ray(body, this.position, this.mechPosRange()).length === 0)) &&
!mech.isStealth
!mech.isCloak
) {
this.foundPlayer();
} else if (this.seePlayer.recall) {
@@ -363,7 +366,7 @@ const mobs = {
this.distanceToPlayer2() < this.seeAtDistance2 &&
Matter.Query.ray(map, this.position, this.mechPosRange()).length === 0 &&
Matter.Query.ray(body, this.position, this.mechPosRange()).length === 0 &&
!mech.isStealth
!mech.isCloak
) {
this.foundPlayer();
} else if (this.seePlayer.recall) {
@@ -411,7 +414,7 @@ const mobs = {
if (game.cycle % 7 && this.seePlayer.yes) {
ctx.setLineDash([125 * Math.random(), 125 * Math.random()]);
// ctx.lineDashOffset = 6*(game.cycle % 215);
if (this.distanceToPlayer() < this.laserRange && !mech.isStealth) {
if (this.distanceToPlayer() < this.laserRange) {
if (mech.immuneCycle < mech.cycle) mech.damage(0.0003 * game.dmgScale);
if (mech.energy > 0.1) mech.energy -= 0.003
ctx.beginPath();
@@ -497,7 +500,7 @@ const mobs = {
};
vertexCollision(this.position, look, map);
vertexCollision(this.position, look, body);
if (!mech.isStealth) vertexCollision(this.position, look, [player]);
if (!mech.isCloak) vertexCollision(this.position, look, [player]);
// hitting player
if (best.who === player) {
if (mech.immuneCycle < mech.cycle) {
@@ -538,7 +541,7 @@ const mobs = {
this.distanceToPlayer2() < this.seeAtDistance2 &&
Matter.Query.ray(map, this.position, player.position).length === 0 &&
Matter.Query.ray(body, this.position, player.position).length === 0 &&
!mech.isStealth
!mech.isCloak
) {
this.foundPlayer();
} else if (this.seePlayer.recall) {
@@ -644,14 +647,6 @@ const mobs = {
}
}
},
alertNearByMobs() {
//this.alertRange2 is set at the very bottom of this mobs, after mob is made
for (let i = 0; i < mob.length; i++) {
if (!mob[i].seePlayer.recall && Vector.magnitudeSquared(Vector.sub(this.position, mob[i].position)) < this.alertRange2) {
mob[i].locatePlayer();
}
}
},
curl(range = 1000, mag = -10) {
//cause all mobs, and bodies to rotate in a circle
applyCurl = function (center, array, isAntiGravity = true) {
@@ -1049,7 +1044,7 @@ const mobs = {
}
}
if (Math.random() < mod.isBotSpawner) b.randomBot(this.position, false)
if (mod.isExplodeMob) b.explosion(this.position, Math.min(425, Math.sqrt(this.mass + 3) * 70))
if (mod.isExplodeMob) b.explosion(this.position, Math.min(550, Math.sqrt(this.mass + 2.5) * 50))
if (mod.nailsDeathMob) b.targetedNail(this.position, mod.nailsDeathMob, 40 + 7 * Math.random())
} else if (mod.isShieldAmmo && this.shield) {
let type = "ammo"