mod: CPT reversal - avoid damage by rewinding to your past, but use up all your energy
  requires wormhole or time dilation

several minor buffs to wormhole
small changes to mob distribution on a few maps
This commit is contained in:
landgreen
2020-11-27 04:26:30 -08:00
parent 0c319d3049
commit 6c5928c052
9 changed files with 272 additions and 169 deletions

View File

@@ -2259,7 +2259,7 @@ const b = {
// check if inside a mob
q = Matter.Query.point(mob, this.position)
for (let i = 0; i < q.length; i++) {
let dmg = b.dmgScale * 0.36 / Math.sqrt(q[i].mass) * (mod.waveHelix === 1 ? 1 : 0.8) //1 - 0.4 = 0.6 for helix mod 40% damage reduction
let dmg = b.dmgScale * 0.4 / Math.sqrt(q[i].mass) * (mod.waveHelix === 1 ? 1 : 0.8) //1 - 0.4 = 0.6 for helix mod 40% damage reduction
q[i].damage(dmg);
q[i].foundPlayer();
game.drawList.push({ //add dmg to draw queue
@@ -2292,7 +2292,7 @@ const b = {
for (let i = 0; i < q.length; i++) {
slowCheck = 0.3;
Matter.Body.setPosition(this, Vector.add(this.position, q[i].velocity)) //move with the medium
let dmg = b.dmgScale * 0.36 / Math.sqrt(q[i].mass) * (mod.waveHelix === 1 ? 1 : 0.8) //1 - 0.4 = 0.6 for helix mod 40% damage reduction
let dmg = b.dmgScale * 0.4 / Math.sqrt(q[i].mass) * (mod.waveHelix === 1 ? 1 : 0.8) //1 - 0.4 = 0.6 for helix mod 40% damage reduction
q[i].damage(dmg);
q[i].foundPlayer();
game.drawList.push({ //add dmg to draw queue

View File

@@ -13,13 +13,13 @@ const level = {
start() {
if (level.levelsCleared === 0) { //this code only runs on the first level
// game.enableConstructMode() //used to build maps in testing mode
// level.difficultyIncrease(8)
// level.difficultyIncrease(89)
// game.zoomScale = 1000;
// game.setZoom();
// mech.setField("wormhole")
// b.giveGuns("laser")
// mod.is3Missiles = true
// mod.giveMod("history laser")
// mod.giveMod("CPT reversal")
// mod.giveMod("diffuse beam")
level.intro(); //starting level
@@ -156,7 +156,7 @@ const level = {
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
// spawn.boost(1500, 0, 900);
// spawn.starter(1900, -500, 20)
spawn.starter(1900, -500, 20)
// spawn.sucker(2900, -500)
// spawn.launcherBoss(1200, -500)
// spawn.laserTargetingBoss(1600, -400)
@@ -171,7 +171,7 @@ const level = {
// spawn.nodeBoss(1200, -500, "launcher")
// spawn.snakeBoss(1200, -500)
spawn.powerUpBoss(2900, -500)
// spawn.powerUpBoss(2900, -500)
// spawn.randomMob(1600, -500)
},
template() {
@@ -762,7 +762,11 @@ const level = {
spawn.randomMob(-75, -850, -0.1);
spawn.randomMob(1300, -600, -0.1);
spawn.randomMob(550, -3400, 0);
if (game.difficulty > 50) {
spawn.randomMob(0, -1175, 0.5);
spawn.randomMob(-75, -1150, 0.5);
spawn.randomMob(1075, -625, 0.5);
spawn.randomMob(1725, -575, 0.5);
if (game.difficulty > 40) {
spawn.randomMob(2300, -2775, -0.5);
spawn.randomMob(600, -925, -0.5);
spawn.randomMob(1550, -2750, -0.5);
@@ -770,7 +774,7 @@ const level = {
spawn.randomMob(-75, -1475, 0);
spawn.randomBoss(600, -2600, 0);
}
if (game.difficulty < 32) {
if (game.difficulty < 25) {
spawn.randomMob(700, -1650, 0);
spawn.randomMob(600, -3500, 0.2);
spawn.randomMob(-75, -1175, 0.2);
@@ -871,12 +875,6 @@ const level = {
spawn.mapRect(2625, 2288, 650, 50);
spawn.mapRect(2700, 2276, 500, 50);
// spawn.mapRect(3000, 400, 1000, 1250);
// spawn.mapRect(3000, 1925, 1000, 150);
// spawn.mapRect(3100, 1875, 800, 100);
// spawn.mapRect(3100, 1600, 800, 100);
// spawn.mapRect(3100, 350, 800, 100);
// spawn.mapRect(3100, 2025, 800, 100);
spawn.mapRect(2400, 0, 200, 1925); //left down tube wall
spawn.mapRect(600, 2300, 3750, 200);
@@ -889,7 +887,6 @@ const level = {
spawn.mapRect(500, 1700, 200, 800); //left wall
spawn.mapRect(675, 1875, 325, 150, 0.5);
spawn.mapRect(4450, 2900, 4900, 200); //boss room floor
spawn.mapRect(4150, 2600, 400, 500);
spawn.mapRect(6250, 2675, 700, 325);
@@ -909,25 +906,30 @@ const level = {
spawn.mapRect(9300, 2590, 650, 25);
spawn.mapRect(9700, 2580, 100, 50);
spawn.randomBoss(1300, 2100, 0.5);
spawn.randomMob(8300, 2100, 0.2);
spawn.randomSmallMob(2575, -75, 0.2); //entrance
spawn.randomMob(8125, 2450, 0.25);
spawn.randomSmallMob(3200, 250, 0.3);
spawn.randomMob(2425, 2150, 0.3);
spawn.randomSmallMob(3500, 250, 0.4);
spawn.randomMob(3800, 2175, 0.4);
spawn.randomSmallMob(1100, -300, 0.4); //entrance
spawn.randomMob(4450, 2500, 0.5);
spawn.randomMob(6350, 2525, 0.5);
spawn.randomBoss(9200, 2400, 0.6);
spawn.randomSmallMob(1900, -250, 0.6); //entrance
spawn.randomMob(1500, 2100, 0.7);
spawn.randomSmallMob(1700, -150, 0.7); //entrance
spawn.randomMob(8800, 2725, 0.8);
spawn.randomMob(7300, 2200, 0.8);
spawn.randomMob(2075, 2025, 0.8);
spawn.randomMob(3475, 2175, 0.8);
spawn.randomBoss(1300, 2100, 0.1);
spawn.randomMob(8300, 2100, 0.1);
spawn.randomSmallMob(2575, -75, 0.1); //entrance
spawn.randomMob(8125, 2450, 0.1);
spawn.randomSmallMob(3200, 250, 0.1);
spawn.randomMob(2425, 2150, 0.1);
spawn.randomSmallMob(3500, 250, 0.2);
spawn.randomMob(3800, 2175, 0.2);
spawn.randomSmallMob(1100, -300, 0.2); //entrance
spawn.randomMob(4450, 2500, 0.2);
spawn.randomMob(6350, 2525, 0.2);
spawn.randomBoss(9200, 2400, 0.3);
spawn.randomSmallMob(1900, -250, 0.3); //entrance
spawn.randomMob(1500, 2100, 0.4);
spawn.randomSmallMob(1700, -150, 0.4); //entrance
spawn.randomMob(8800, 2725, 0.5);
spawn.randomMob(7300, 2200, 0.5);
spawn.randomMob(2075, 2025, 0.5);
spawn.randomMob(3475, 2175, 0.5);
spawn.randomMob(8900, 2825, 0.5);
spawn.randomMob(9600, 2425, 0.9);
spawn.randomMob(3600, 1725, 0.9);
spawn.randomMob(4100, 1225, 0.9);
spawn.randomMob(2825, 400, 0.9);
if (game.difficulty > 3) spawn.randomLevelBoss(6000, 2300, ["spiderBoss", "launcherBoss", "laserTargetingBoss"]);
powerUps.addRerollToLevel() //needs to run after mobs are spawned
},
@@ -996,13 +998,6 @@ const level = {
height: 775,
color: "rgba(0,20,40,0.2)"
});
level.fill.push({
x: 1800,
y: -475,
width: 850,
height: 775,
color: "rgba(0,20,40,0.2)"
});
level.fillBG.push({
x: -250,
y: -750,
@@ -1037,19 +1032,26 @@ const level = {
color: "#d0d4d6"
});
//tall platform
spawn.mapVertex(2225, -450, "325 0 250 80 -250 80 -325 0 -250 -80 250 -80"); //base
spawn.mapVertex(2225, -250, "325 0 250 80 -250 80 -325 0 -250 -80 250 -80"); //base
spawn.mapRect(1725, -2800, 1000, 50); //super high shade
spawn.mapRect(1800, -500, 850, 100); //far left starting ceiling
spawn.mapRect(1800, -300, 850, 100); //far left starting ceiling
spawn.bodyRect(2400, -2950, 150, 150); //shield from laser
level.fillBG.push({
x: 2000,
y: -2800,
width: 450,
height: 2300,
height: 2500,
color: "#d0d4d6"
});
level.fill.push({
x: 1800,
y: -275,
width: 850,
height: 775,
color: "rgba(0,20,40,0.2)"
});
//tall platform
spawn.mapVertex(3350, 200, "375 0 -375 0 -250 -250 250 -250"); //base
spawn.mapVertex(3350, 200, "400 0 -400 0 -275 -275 275 -275"); //base
spawn.bodyRect(3400, -150, 150, 150);
spawn.mapRect(2850, -3150, 1000, 50); //super high shade
spawn.bodyRect(3675, -3470, 525, 20); //plank
@@ -1089,16 +1091,9 @@ const level = {
spawn.mapRect(4600, -1300, 450, 100);
//steep stairs
// spawn.mapRect(4100, -1700, 100, 100);
// spawn.mapRect(4200, -2050, 100, 450);
// spawn.mapRect(4300, -2400, 100, 800);
// spawn.mapRect(4400, -2750, 100, 1150);
// spawn.mapRect(4500, -3100, 100, 1500);
spawn.mapRect(4100, -2250, 100, 650);
spawn.mapRect(4100, -3450, 100, 650); //left top shelf
spawn.mapRect(4600, -3450, 100, 1850);
// spawn.mapRect(4200, -3450, 100, 400); //left top shelf
// spawn.mapRect(4300, -3450, 100, 100); //left top shelf
level.fill.push({
x: 4100,
y: -3450,
@@ -1106,31 +1101,24 @@ const level = {
height: 2250,
color: "rgba(0,20,40,0.13)"
});
// level.fill.push({
// x: 4100,
// y: -1600,
// width: 600,
// height: 300,
// color: "rgba(0,20,40,0.13)"
// });
spawn.randomSmallMob(4400, -3500);
spawn.randomSmallMob(4800, -800);
spawn.randomSmallMob(800, 150);
spawn.randomMob(700, -600, 0.8);
spawn.randomMob(3100, -3600, 0.7);
spawn.randomMob(3300, -1000, 0.7);
spawn.randomMob(4200, -250, 0.7);
spawn.randomMob(4900, -1500, 0.6);
spawn.randomMob(1200, 100, 0.4);
spawn.randomMob(800, -2600);
spawn.randomMob(700, -600, 0.3);
spawn.randomMob(3100, -3600, 0.3);
spawn.randomMob(3300, -1000, 0.3);
spawn.randomMob(4200, -250, 0.3);
spawn.randomMob(4900, -1500, 0.3);
spawn.randomMob(3800, 175, 0.4);
spawn.randomMob(5750, 125, 0.4);
spawn.randomMob(5900, -1500, 0.4);
spawn.randomMob(4700, -800, 0.4);
spawn.randomMob(1400, -400, 0.3);
spawn.randomMob(1200, 100, 0.3);
spawn.randomMob(2550, -100, 0.2);
spawn.randomMob(2000, -2800, 0.2);
spawn.randomMob(2000, -500, 0.2);
spawn.randomMob(4475, -3550, 0.1);
spawn.randomMob(2850, 175, 0.4);
spawn.randomMob(2000, -2800, 0.4);
spawn.randomMob(2200, -500, 0.4);
spawn.randomMob(4475, -3550, 0.3);
spawn.randomBoss(5000, -2150, 1);
spawn.randomBoss(3700, -4100, 0.3);
spawn.randomBoss(2700, -1600, 0.1);
@@ -1538,6 +1526,12 @@ const level = {
spawn.randomMob(4700, -150, 0.2);
spawn.randomBoss(4000, -350, 0.6);
spawn.randomBoss(2750, -550, 0.1);
spawn.randomMob(2175, -925, 0.5);
spawn.randomMob(2750, 100, 0.5);
spawn.randomMob(4250, -1725, 0.5);
spawn.randomMob(3575, -2425, 0.5);
spawn.randomMob(3975, -3900, 0.5);
spawn.randomMob(1725, 125, 0.5);
if (game.difficulty > 3) {
if (Math.random() < 0.1) { // tether ball
spawn.tetherBoss(4250, 0)

View File

@@ -970,9 +970,11 @@ const mobs = {
Matter.Body.setAngle(this, angle - Math.PI);
},
explode(mass = this.mass) {
mech.damage(Math.min(Math.max(0.02 * Math.sqrt(mass), 0.01), 0.35) * game.dmgScale);
this.dropPowerUp = false;
this.death(); //death with no power up or body
if (mech.immuneCycle < mech.cycle) {
mech.damage(Math.min(Math.max(0.02 * Math.sqrt(mass), 0.01), 0.35) * game.dmgScale);
this.dropPowerUp = false;
this.death(); //death with no power up or body
}
},
timeLimit() {
if (!mech.isBodiesAsleep) {

View File

@@ -981,6 +981,22 @@ const mod = {
mod.overfillDrain = 0.8
}
},
{
name: "CPT reversal",
description: "<strong>rewind 2-4</strong> seconds to avoid <strong class='color-harm'>harm</strong><br>drains a minimum of <strong>100%</strong> <strong class='color-f'>energy</strong>",
maxCount: 1,
count: 0,
allowed() {
return mech.fieldUpgrades[mech.fieldMode].name !== "nano-scale manufacturing" && mech.fieldUpgrades[mech.fieldMode].name !== "standing wave harmonics" && !mod.isEnergyHealth && !mod.isEnergyLoss
},
requires: "not nano-scale manufacturing, not mass-energy equivalence, not standing wave harmonics, not acute stress response",
effect() {
mod.isTimeAvoidDeath = true;
},
remove() {
mod.isTimeAvoidDeath = false;
}
},
{
name: "piezoelectricity",
description: "<strong>colliding</strong> with mobs overfills <strong class='color-f'>energy</strong> by <strong>200%</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>15%</strong>",
@@ -1022,7 +1038,7 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
return !mod.isPiezo
return !mod.isPiezo && !mod.isTimeAvoidDeath
},
requires: "not piezoelectricity<br>or acute stress response",
effect: () => {
@@ -1629,7 +1645,7 @@ const mod = {
maxCount: 1,
count: 0,
allowed() {
return (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isMissileField || mod.isIceField)) || mod.haveGunCheck("drones") || mod.haveGunCheck("super balls") || (mod.haveGunCheck("nail gun")) || (mod.haveGunCheck("shotgun")) && !mod.isIceCrystals && !mod.isNailCrit && !mod.isNailShot && !mod.isNailPoison
return ((mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isMissileField || mod.isIceField)) || mod.haveGunCheck("drones") || mod.haveGunCheck("super balls") || mod.haveGunCheck("nail gun") || mod.haveGunCheck("shotgun")) && !mod.isIceCrystals && !mod.isNailCrit && !mod.isNailShot && !mod.isNailPoison
},
requires: "drones, super balls, nail gun, shotgun",
effect() {
@@ -3123,7 +3139,7 @@ const mod = {
},
{
name: "traversable geodesics",
description: "your <strong>bullets</strong> can traverse <strong class='color-worm'>wormholes</strong><br>spawn a <strong class='color-g'>gun</strong> power up",
description: "your <strong>bullets</strong> can traverse <strong class='color-worm'>wormholes</strong><br>spawn a <strong class='color-g'>gun</strong> and <strong class='color-g'>ammo</strong> power up",
maxCount: 1,
count: 0,
allowed() {
@@ -3133,6 +3149,7 @@ const mod = {
effect() {
mod.isWormBullets = true
powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
},
remove() {
mod.isWormBullets = false
@@ -3394,5 +3411,6 @@ const mod = {
isRailAreaDamage: null,
historyLaser: null,
isSpeedHarm: null,
isSpeedDamage: null
isSpeedDamage: null,
isTimeSkip: null
}

View File

@@ -476,6 +476,45 @@ const mech = {
return dmg
},
damage(dmg) {
if (mod.isTimeAvoidDeath && mech.energy > 0.97) {
const steps = Math.floor(Math.min(240, 120 * mech.energy)) //go back 2 seconds at 100% energy
let history = mech.history[(mech.cycle - steps) % 300]
Matter.Body.setPosition(player, history.position);
Matter.Body.setVelocity(player, { x: history.velocity.x, y: history.velocity.y });
mech.energy = Math.max(mech.energy - steps, 0.01)
mech.immuneCycle = mech.cycle + mod.collisionImmuneCycles; //player is immune to collision damage for 30 cycles
let isDrawPlayer = true
const shortPause = function() {
if (mech.defaultFPSCycle < mech.cycle) { //back to default values
game.fpsCap = game.fpsCapDefault
game.fpsInterval = 1000 / game.fpsCap;
} else {
requestAnimationFrame(shortPause);
if (isDrawPlayer) {
isDrawPlayer = false
ctx.save();
ctx.translate(canvas.width2, canvas.height2); //center
ctx.scale(game.zoom / game.edgeZoomOutSmooth, game.zoom / game.edgeZoomOutSmooth); //zoom in once centered
ctx.translate(-canvas.width2 + mech.transX, -canvas.height2 + mech.transY); //translate
for (let i = 1; i < steps; i++) {
history = mech.history[(mech.cycle - i) % 300]
mech.pos.x = history.position.x
mech.pos.y = history.position.y
mech.draw();
}
ctx.restore();
}
}
};
if (mech.defaultFPSCycle < mech.cycle) requestAnimationFrame(shortPause);
game.fpsCap = 4 //1 is shortest pause, 4 is standard
game.fpsInterval = 1000 / game.fpsCap;
mech.defaultFPSCycle = mech.cycle
return
}
mech.lastHarmCycle = mech.cycle
if (mod.isDroneOnDamage) { //chance to build a drone on damage from mod
const len = Math.min((dmg - 0.06 * Math.random()) * 40, 40)
@@ -549,7 +588,6 @@ const mech = {
}
if (dmg > 0.06 / mech.holdingMassScale) mech.drop(); //drop block if holding
const normalFPS = function() {
if (mech.defaultFPSCycle < mech.cycle) { //back to default values
game.fpsCap = game.fpsCapDefault
@@ -1769,13 +1807,13 @@ const mech = {
},
{
name: "metamaterial cloaking", //"weak photonic coupling" "electromagnetically induced transparency" "optical non-coupling" "slow light field" "electro-optic transparency"
description: "<strong class='color-cloaked'>cloak</strong> after not using your gun or field<br>while <strong class='color-cloaked'>cloaked</strong> mobs can't see you<br>increase <strong class='color-d'>damage</strong> by <strong>111%</strong>",
description: "<strong class='color-cloaked'>cloak</strong> after not using your gun or field<br>while <strong class='color-cloaked'>cloaked</strong> mobs can't see you<br>increase <strong class='color-d'>damage</strong> by <strong>133%</strong>",
effect: () => {
mech.fieldFire = true;
mech.fieldMeterColor = "#fff";
mech.fieldPhase = 0;
mech.isCloak = false
mech.fieldDamage = 2.11 // 1 + 111/100
mech.fieldDamage = 2.33 // 1 + 111/100
mech.fieldDrawRadius = 0
const drawRadius = 1000
@@ -2293,11 +2331,13 @@ const mech = {
mech.fieldRange *= 0.8
if (mod.isWormholeEnergy) mech.energy += 0.5
if (mod.isWormSpores) { //pandimensionalspermia
b.spore(Vector.add(mech.hole.pos2, Vector.rotate({
x: mech.fieldRange,
y: 0
}, 2 * Math.PI * Math.random())))
Matter.Body.setVelocity(bullet[bullet.length - 1], Vector.mult(Vector.rotate(mech.hole.unit, -Math.PI / 2), 15));
for (let i = 0, len = Math.ceil(2 * Math.random()); i < len; i++) {
b.spore(Vector.add(mech.hole.pos1, Vector.rotate({
x: mech.fieldRange,
y: 0
}, 2 * Math.PI * Math.random())))
Matter.Body.setVelocity(bullet[bullet.length - 1], Vector.mult(Vector.rotate(mech.hole.unit, Math.PI / 2), 15));
}
}
break
}
@@ -2317,12 +2357,13 @@ const mech = {
// if (mod.isWormholeEnergy && mech.energy < mech.maxEnergy * 2) mech.energy = mech.maxEnergy * 2
if (mod.isWormholeEnergy) mech.energy += 0.5
if (mod.isWormSpores) { //pandimensionalspermia
b.spore(Vector.add(mech.hole.pos1, Vector.rotate({
x: mech.fieldRange,
y: 0
}, 2 * Math.PI * Math.random())))
Matter.Body.setVelocity(bullet[bullet.length - 1], Vector.mult(Vector.rotate(mech.hole.unit, Math.PI / 2), 15));
for (let i = 0, len = Math.ceil(2 * Math.random()); i < len; i++) {
b.spore(Vector.add(mech.hole.pos1, Vector.rotate({
x: mech.fieldRange,
y: 0
}, 2 * Math.PI * Math.random())))
Matter.Body.setVelocity(bullet[bullet.length - 1], Vector.mult(Vector.rotate(mech.hole.unit, Math.PI / 2), 15));
}
}
break
}
@@ -2383,7 +2424,7 @@ const mech = {
) {
const sub = Vector.sub(game.mouseInGame, mech.pos)
const mag = Vector.magnitude(sub)
const drain = 0.04 + 0.007 * Math.sqrt(mag)
const drain = 0.03 + 0.005 * Math.sqrt(mag)
if (mech.energy > drain && mag > 300) {
mech.energy -= drain
mech.hole.isReady = false;

View File

@@ -33,7 +33,7 @@ const powerUps = {
}
game.paused = true;
game.isChoosing = true; //stops p from un pausing on key down
build.pauseGrid()
build.pauseGrid(true)
},
endDraft() {
if (mod.manyWorlds && powerUps.reroll.rerolls < 1) {
@@ -43,10 +43,10 @@ const powerUps = {
document.getElementById("choose-background").style.display = "none"
document.body.style.cursor = "none";
document.body.style.overflow = "hidden"
build.unPauseGrid()
game.paused = false;
game.isChoosing = false; //stops p from un pausing on key down
mech.immuneCycle = mech.cycle + 60; //player is immune to collision damage for 30 cycles
build.unPauseGrid()
requestAnimationFrame(cycle);
},
reroll: {

View File

@@ -2215,9 +2215,9 @@ const spawn = {
spawn.shield(me, x, y, 1);
me.onDeath = function() {
powerUps.spawnBossPowerUp(this.position.x, this.position.y)
//wake up tail mobs
for (let i = 0; i < mob.length; i++) {
for (let i = 0; i < mob.length; i++) { //wake up tail mobs
if (mob[i].isSnakeTail && mob[i].alive) {
mob[i].isSnakeTail = false;
mob[i].do = mob[i].doActive
mob[i].removeConsBB();
}
@@ -2257,23 +2257,32 @@ const spawn = {
snakeBody(x, y, radius = 20) {
mobs.spawn(x, y, 4, radius, "rgb(55,170,170)");
let me = mob[mob.length - 1];
me.onHit = function() {
//run this function on hitting player
this.explode();
};
me.collisionFilter.mask = cat.bullet | cat.player
// me.g = 0.0002; //required if using 'gravity'
me.accelMag = 0.001 * game.accelScale;
// me.onHit = function() {
// //run this function on hitting player
// this.explode();
// };
me.collisionFilter.mask = cat.bullet | cat.player | cat.mob
me.accelMag = 0.0006 * game.accelScale;
me.leaveBody = false;
me.seePlayerFreq = Math.round((80 + 50 * Math.random()) * game.lookFreqScale);
me.frictionAir = 0.02;
me.isSnakeTail = true;
me.onDeath = function() {
if (this.isSnakeTail) { //wake up tail mobs
for (let i = 0; i < mob.length; i++) {
if (mob[i].isSnakeTail && mob[i].alive) {
mob[i].isSnakeTail = false;
mob[i].do = mob[i].doActive
mob[i].removeConsBB();
}
}
}
};
me.do = function() {
this.checkStatus();
};
me.doActive = function() {
this.seePlayerCheck();
this.checkStatus();
this.alwaysSeePlayer();
this.attraction();
};
},