invulnerable

tech: anyon - 2x energy after duplicating a power up, +6% duplication chance
tech: Abelian group - 4x damage while invulnerable
tech: fermion - become invulnerable for 5 seconds after a mob dies
tech: entropic gravity - crouching pulls MACHO towards the player, and 1.5x to all MACHO effects (damage, damage reduction, AoE damage)
tech: modified Newtonian dynamics - +20 speed for all Newtonian law tech

choice, MACHO, invulnerable, speed - have text keyword CSS style
removed chance to find a random tech in early levels from mobs
  this reduces tech per full game by about 2
tower level has a few changes
options exchange only works once per level, but it gives 3x choices after randomizing
dark star has a 1.2->1.3x MACHO radius
autocannon fires 1->2 extra super balls, but balls have higher gravity
grappling hook field starts with 0.6x damage reduction
super balls + uncertainty principle makes all balls start in the same spot and only separate after teleporting
ablative drones spawns 50% more drones on collision
von Neumann probe gives 40% more drones per block mass
  also added text clarification that it uses 5 energy
tech lens rotates 50% faster
ghoster mobs are more aggressive once they have lost 20% health
sneakBoss doesn't start accelerating until it is partly uncloaked, but it spawns sneaker mobs after cloaking

fixed bug with 2 different boost power up sizes
paradigm shift doesn't do damage while player is invulnerable
random internet JUNK images disabled because some of the images are bad
entanglement bug fix, maybe
This commit is contained in:
landgreen
2024-05-11 09:52:56 -07:00
parent a1164eddae
commit 507b0605d6
15 changed files with 652 additions and 760 deletions

View File

@@ -25,6 +25,7 @@ const level = {
// powerUps.research.changeRerolls(99999)
// m.immuneCycle = Infinity //you can't take damage
// tech.tech[297].frequency = 100
// tech.addJunkTechToPool(0.5)
// m.couplingChange(10)
// m.setField("plasma torch") //1 standing wave 2 perfect diamagnetism 3 negative mass 4 molecular assembler 5 plasma torch 6 time dilation 7 metamaterial cloaking 8 pilot wave 9 wormhole 10 grappling hook
// m.energy = 0
@@ -33,23 +34,23 @@ const level = {
// m.energy = 0
// simulation.molecularMode = 2
// m.damage(0.1);
// b.giveGuns("drones") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("super balls") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("shotgun") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("wave") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("laser") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.guns[8].ammo = 100000000
// requestAnimationFrame(() => { tech.giveTech("optical amplifier") });
// for (let i = 0; i < 1; ++i) tech.giveTech("combinatorial optimization")
// tech.giveTech("Pareto efficiency")
// for (let i = 0; i < 1; ++i) tech.giveTech("collider")
// for (let i = 0; i < 1; ++i) tech.giveTech("anthropic principle")
// for (let i = 0; i < 1; ++i) tech.giveTech("bubble fusion")
// tech.giveTech("Newtons 2nd law")
// for (let i = 0; i < 1; ++i) tech.giveTech("lens")
// for (let i = 0; i < 1; ++i) tech.giveTech("modified Newtonian dynamics")
// for (let i = 0; i < 1; ++i) tech.giveTech("Newtons 1st law")
// for (let i = 0; i < 1; ++i) tech.giveTech("entropic gravity")
// requestAnimationFrame(() => { for (let i = 0; i < 10; i++) b.orbitBot(m.pos, false) });
// requestAnimationFrame(() => { for (let i = 0; i < 1; i++) tech.giveTech("ersatz bots") });
// for (let i = 0; i < 1; i++) tech.giveTech("tungsten carbide")
// m.lastKillCycle = m.cycle
// for (let i = 0; i < 1; ++i) tech.giveTech("Lorentz transformation")
// for (let i = 0; i < 1; ++i) tech.giveTech("unified field theory")
// for (let i = 0; i < 1; ++i) tech.giveTech("anyon")
// for (let i = 0; i < 3; i++) powerUps.directSpawn(450, -50, "tech");
// for (let i = 0; i < 10; i++) powerUps.directSpawn(1750, -500, "research");
// for (let i = 0; i < 100; i++) powerUps.directSpawn(1750, -500, "coupling");
@@ -59,9 +60,8 @@ const level = {
// for (let i = 0; i < 1; ++i) spawn.laserLayer(1400, -500)
// Matter.Body.setPosition(player, { x: -200, y: -3330 });
// for (let i = 0; i < 4; ++i) spawn.laserLayer(1300, -500 + 100 * Math.random())
// for (let i = 0; i < 1; ++i) spawn.stinger(1900, -500)
// for (let i = 0; i < 1; ++i) spawn.powerUpBossBaby(1900, -500)
// spawn.beetleBoss(1900, -500, 25)
// spawn.sneakBoss(1900, -500)
// spawn.zombie(-3000, -500 + 300 * Math.random(), 30, 5, "white") // zombie(x, y, radius, sides, color)
// for (let i = 0; i < 5; ++i) spawn.starter(1000 + 1000 * Math.random(), -500 + 300 * Math.random())
// tech.addJunkTechToPool(2)
@@ -71,7 +71,7 @@ const level = {
level[simulation.isTraining ? "walk" : "initial"]() //normal starting level **************************************************
// for (let i = 0; i < 2; i++) spawn.ghoster(1300, -500) //ghosters need to spawn after the map loads
// for (let i = 0; i < 2; i++) spawn.ghoster(level.exit.x, level.exit.y) //ghosters need to spawn after the map loads
// spawn.bodyRect(2425, -120, 200, 200);
// console.log(body[body.length - 1].mass)
// simulation.isAutoZoom = false; //look in close
@@ -79,7 +79,7 @@ const level = {
// simulation.setZoom();
// tech.addJunkTechToPool(0.7)
// for (let i = 0; i < 2; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "tech");
// for (let i = 0; i < 1; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "entanglement");
// for (let i = 0; i < 2; ++i) powerUps.directSpawn(m.pos.x + 450, m.pos.y + 50 * Math.random(), "boost");
// for (let i = 0; i < 100; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "ammo");
// for (let i = 0; i < 2; i++) powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "field", false);
@@ -148,6 +148,7 @@ const level = {
},
newLevelOrPhase() { //runs on each new level but also on final boss phases
//used for generalist and pigeonhole principle
tech.cancelTechCount = 0
tech.buffedGun++
if (tech.buffedGun > b.inventory.length - 1) tech.buffedGun = 0;
if (tech.isGunCycle && b.activeGun !== null && b.inventory.length) {
@@ -170,7 +171,7 @@ const level = {
}
if (tech.interestRate > 0) {
const rate = ((level[level.levels[level.onLevel]].name === "final" || level[level.levels[level.onLevel]].name === "subway") ? 1 / 3 : 1) * tech.interestRate //this effect triggers extra times on these final levels
if (b.activeGun !== null && b.activeGun !== undefined && b.guns[b.activeGun].name !== "laser") {
if (b.activeGun !== null && b.activeGun !== undefined && b.guns[b.activeGun].ammo !== Infinity) {
const ammoPerOrb = b.guns[b.activeGun].ammoPack
const a = Math.ceil(rate * b.guns[b.activeGun].ammo / ammoPerOrb)
powerUps.spawnDelay("ammo", a, 4);
@@ -793,7 +794,7 @@ const level = {
return who
},
boost(x, y, height = 1000, angle = Math.PI / 2) { //height is how high the player will be flung above y
boost(x, y, speed = 1000, angle = Math.PI / 2) { //height is how high the player will be flung above y
if (angle !== Math.PI / 2) { //angle !== 3 * Math.PI / 2
angle *= -1
who = map[map.length] = Matter.Bodies.fromVertices(x + 50, y + 35, Vertices.fromPath("80 40 -80 40 -50 -40 50 -40"), {
@@ -801,14 +802,13 @@ const level = {
category: cat.body,
mask: cat.player | cat.body | cat.bullet | cat.powerUp | cat.mob | cat.mobBullet //cat.player | cat.map | cat.body | cat.bullet | cat.powerUp | cat.mob | cat.mobBullet
},
yVelocity: 1.21 * Math.sqrt(Math.abs(height)),
query() {
// check for collisions
const rayVector = Vector.add(this.position, Vector.rotate({ x: 100, y: 0 }, angle))
query = (who) => {
const list = Matter.Query.ray(who, this.position, rayVector, 100)
if (list.length > 0) {
Matter.Body.setVelocity(list[0].bodyA, Vector.rotate({ x: this.yVelocity, y: 0 }, angle));
Matter.Body.setVelocity(list[0].bodyA, Vector.rotate({ x: 1.21 * Math.sqrt(Math.abs(speed)), y: 0 }, angle));
}
}
query(body)
@@ -818,37 +818,17 @@ const level = {
//player collision
const list = Matter.Query.ray([player], this.position, rayVector, 100)
if (list.length > 0) {
Matter.Body.setVelocity(player, Vector.rotate({ x: this.yVelocity, y: 0 }, angle));
Matter.Body.setVelocity(player, Vector.rotate({ x: 1.21 * Math.sqrt(Math.abs(speed)), y: 0 }, angle));
m.buttonCD_jump = 0; // reset short jump counter to prevent short jumps on boosts
m.hardLandCD = 0 // disable hard landing
}
// if (Matter.Query.region([player], this.boostBounds).length > 0 && !input.down) {
// m.buttonCD_jump = 0; // reset short jump counter to prevent short jumps on boosts
// m.hardLandCD = 0 // disable hard landing
// if (player.velocity.y > 26) {
// Matter.Body.setVelocity(player, {
// x: player.velocity.x,
// y: -15 //gentle bounce if coming down super fast
// });
// } else {
// Matter.Body.setVelocity(player, {
// x: player.velocity.x + (Math.random() - 0.5) * 2.5,
// y: this.yVelocity //give a upwards velocity that will put the player that the height desired
// });
// }
// }
//draw
const v1 = this.vertices[0]
const v2 = this.vertices[1]
let unit = Vector.rotate({ x: 60, y: 0 }, angle)
let v3 = Vector.add(v2, unit)
let v4 = Vector.add(v1, unit)
// ctx.beginPath();
// ctx.strokeStyle = "#000";
// ctx.stroke()
ctx.beginPath();
ctx.moveTo(v1.x, v1.y)
ctx.lineTo(v2.x, v2.y)
@@ -856,9 +836,6 @@ const level = {
ctx.lineTo(v4.x, v4.y)
ctx.fillStyle = "rgba(200,0,255,0.05)";
ctx.fill()
// ctx.strokeStyle = "#000";
// ctx.stroke()
unit = Vector.rotate({ x: 20, y: 0 }, angle)
v3 = Vector.add(v2, unit)
v4 = Vector.add(v1, unit)
@@ -872,7 +849,6 @@ const level = {
},
});
Matter.Body.rotate(who, angle + Math.PI / 2);
return who
} else {
who = map[map.length] = Matter.Bodies.fromVertices(x + 50, y + 35, Vertices.fromPath("120 40 -120 40 -50 -40 50 -40"), {
@@ -890,7 +866,6 @@ const level = {
y: y
}
},
yVelocity: -1.21 * Math.sqrt(Math.abs(height)),
query() {
// check for collisions
query = (who) => {
@@ -898,7 +873,7 @@ const level = {
list = Matter.Query.region(who, this.boostBounds)
Matter.Body.setVelocity(list[0], {
x: list[0].velocity.x + (Math.random() - 0.5) * 2.5, //add a bit of horizontal drift to reduce endless bounces
y: this.yVelocity //give a upwards velocity
y: -1.21 * Math.sqrt(Math.abs(speed)) //give a upwards velocity
});
}
}
@@ -918,7 +893,7 @@ const level = {
} else {
Matter.Body.setVelocity(player, {
x: player.velocity.x + (Math.random() - 0.5) * 2.5,
y: this.yVelocity //give a upwards velocity that will put the player that the height desired
y: -1.21 * Math.sqrt(Math.abs(speed)) //give an upwards velocity that will put the player that the height desired
});
}
}
@@ -928,8 +903,6 @@ const level = {
ctx.fillRect(this.boostBounds.min.x, this.boostBounds.min.y - 10, 100, 30);
ctx.fillStyle = "rgba(200,0,255,0.05)";
ctx.fillRect(this.boostBounds.min.x, this.boostBounds.min.y - 50, 100, 70);
// ctx.fillStyle = "rgba(200,0,255,0.02)";
// ctx.fillRect(x, y - 120, 100, 120);
},
});
return who
@@ -4259,12 +4232,12 @@ const level = {
const isFlipped = (simulation.isHorizontalFlipped && Math.random() < 0.33) ? true : false
if (isFlipped) {
level.setPosToSpawn(9150 + 50, -2230 - 25);
level.exit.x = -100 - 50;
level.exit.x = 400 - 50;
level.exit.y = -50 + 25;
leftRoomColor = "#cff"
rightRoomColor = "rgba(0,0,0,0.13)"
} else {
level.setPosToSpawn(-100, -50);
level.setPosToSpawn(400, -50);
level.exit.x = 9150;
level.exit.y = -2230;
}
@@ -4272,9 +4245,10 @@ const level = {
spawn.mapRect(level.enter.x, level.enter.y + 20, 100, 20); //bump for level entrance
level.fallMode = "position"; //must set level.fallModeBounds in this mode to prevent player getting stuck left or right
level.fallModeBounds = { left: level.enter.x, right: level.exit.x } //used with level.fallMode = "position";
if (isFlipped) level.fallModeBounds = { left: level.exit.x, right: level.enter.x } //used with level.fallMode = "position";
simulation.fallHeight = 5000 //level.enter.y - 4000
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 20); //bump for level exit
level.defaultZoom = 2500
level.defaultZoom = 2300
simulation.zoomTransition(level.defaultZoom)
document.body.style.backgroundColor = "#cdd9df";
powerUps.spawnStartingPowerUps(6300, 1025)
@@ -4284,6 +4258,10 @@ const level = {
const boost3 = level.boost(9700, -730, 1050, 1.95)
const boost4 = level.boost(4300, -720, 1500, 1.25)
const boost5 = level.boost(3000, -1215, 3000, 1.25)
const boost6 = level.boost(8251, -619, 1200, 2.7)
const boost7 = level.boost(7750, -1540, 1050, 1.2)
// const boost6 = level.boost(8235, -619, 3500, 2.9)
const train1 = level.transport(3650, 100, 415, 500, 8); //x,y,width.height,VxGoal,force
const train2 = level.transport(1250, 100, 415, 500, -8); //x,y,width.height,VxGoal,force
const train3 = level.transport(4050, 100, 415, 500, 8); //x,y,width.height,VxGoal,force
@@ -4310,6 +4288,8 @@ const level = {
boost3.query();
boost4.query();
boost5.query();
boost6.query();
boost7.query();
//trains oscillate back and forth and act like they are bouncing off each other
if (train1.position.x < 2850) {
train1.changeDirection(true) //go right
@@ -4344,7 +4324,7 @@ const level = {
ctx.fillStyle = "#cff"
if (isFlipped) {
ctx.fillRect(-350, -300, 525, 325); //entrance typically
ctx.fillRect(150, -300, 525, 325); //entrance typically
} else {
ctx.fillRect(8925, -2575, 525, 400) //exit typically
}
@@ -4357,10 +4337,11 @@ const level = {
ctx.fillRect(8300, -1950, 1550, 1275);
ctx.fillRect(5400, 875, 1800, 650);
ctx.fillRect(2950, -2200, 875, 1050);
ctx.fillRect(5900, -1025, 800, 450);
if (isFlipped) {
ctx.fillRect(8925, -2575, 575, 400) //exit typically
} else {
ctx.fillRect(-350, -300, 525, 325); //entrance typically
ctx.fillRect(150, -300, 525, 325); //entrance typically
}
ctx.fillStyle = "rgba(0,0,0,0.5)"
@@ -4383,10 +4364,10 @@ const level = {
// spawn.mapVertex(6300, 900, `${-a} ${-a + c} ${-a + c} ${-a} ${a - c} ${-a} ${a} ${-a + c} ${a} ${a - c} ${a - c} ${a} ${-a + c} ${a} ${-a} ${a - c}`); //square with edges cut off
spawn.mapVertex(400, 900, `${-a} ${-a + c} ${-a + c} ${-a} ${a - c} ${-a} ${a} ${-a + c} ${a} ${a - c} ${a - c} ${a} ${-a + c} ${a} ${-a} ${a - c}`); //square with edges cut off
//lower 1st zone entrance /exit
spawn.mapRect(-400, -350, 575, 75);
spawn.mapRect(-400, -300, 75, 375);
spawn.mapRect(100, -325, 75, 175);
spawn.mapRect(100, -10, 75, 50);
spawn.mapRect(100, -350, 575, 75);
spawn.mapRect(100, -300, 75, 375);
spawn.mapRect(600, -325, 75, 175);
spawn.mapRect(600, -10, 75, 50);
//2nd zone upper hollow square
@@ -4421,24 +4402,28 @@ const level = {
//lower 3rd zone
spawn.mapVertex(6300, 450, `${-a} ${-a + c} ${-a + c} ${-a} ${a - c} ${-a} ${a} ${-a + c} ${a} ${0} ${-a} ${0}`); //square with edges cut off --- hollow top
spawn.mapVertex(6550, 1650, `${-a} ${600} ${a + 500} ${600} ${a + 500} ${a - c} ${a - c + 500} ${a} ${-a + c} ${a} ${-a} ${a - c}`); //square with edges cut off --- hollow bottom
spawn.mapVertex(6300, 1200, "-400 -40 -350 -90 350 -90 400 -40 400 40 350 90 -350 90 -400 40");
spawn.mapVertex(6450, 1650, `${-a} ${600} ${a + 700} ${600} ${a + 700} ${a - c} ${a - c + 700} ${a} ${-a + c} ${a} ${-a} ${a - c}`); //square with edges cut off --- hollow bottom
//upper 3rd zone
a = 400 //side length
c = 50 //corner offset
spawn.mapVertex(6300, -800, `${-a} ${-a + c} ${-a + c} ${-a} ${a - c} ${-a} ${a} ${-a + c} ${a} ${a - c} ${a - c} ${a} ${-a + c} ${a} ${-a} ${a - c}`); //square with edges cut off
// spawn.mapVertex(6300, -800, `${-a} ${-a + c} ${-a + c} ${-a} ${a - c} ${-a} ${a} ${-a + c} ${a} ${a - c} ${a - c} ${a} ${-a + c} ${a} ${-a} ${a - c}`); //square with edges cut off
spawn.mapVertex(6300, -1100, `${-a} ${-a + c} ${-a + c} ${-a} ${a - c} ${-a} ${a} ${-a + c} ${a} ${-200} ${-a} ${-200}`); //square with edges cut off
spawn.mapVertex(6300, -500, `${-a} ${200} ${a} ${200} ${a} ${a - c} ${a - c} ${a} ${-a + c} ${a} ${-a} ${a - c}`); //square with edges cut off
spawn.mapVertex(5800, -1425, "-300 -40 -250 -90 250 -90 300 -40 300 40 250 90 -250 90 -300 40");
spawn.mapVertex(5485, -1850, "-400 -40 -350 -90 350 -90 400 -40 400 40 350 90 -350 90 -400 40");
spawn.mapVertex(7365, -1850, "-650 -40 -600 -90 600 -90 650 -40 650 40 600 90 -600 90 -650 40"); //long
spawn.mapVertex(7115, -1850, "-400 -40 -350 -90 350 -90 400 -40 400 40 350 90 -350 90 -400 40"); //long
spawn.mapVertex(6300, -2175, "-300 -40 -250 -90 250 -90 300 -40 300 40 250 90 -250 90 -300 40"); //highest
spawn.mapVertex(4450, -1850, "-200 -40 -150 -90 150 -90 200 -40 200 40 150 90 -150 90 -200 40");
spawn.mapVertex(5500, -300, "-200 -60 -170 -90 170 -90 200 -60 200 60 170 90 -170 90 -200 60");
spawn.mapVertex(4600, -590, "-500 -90 170 -90 200 -60 200 60 170 90 -500 90");
// spawn.mapVertex(5300, -300, "-300 -60 -270 -90 270 -90 300 -60 300 60 270 90 -270 90 -300 60");
spawn.mapVertex(5300, -300, "-300 -40 -250 -90 250 -90 300 -40 300 40 250 90 -250 90 -300 40");
spawn.mapVertex(4500, -590, "-300 -90 250 -90 300 -40 300 40 250 90 -300 90");
// spawn.mapVertex(4600, -590, "-500 -90 170 -90 200 -60 200 60 170 90 -500 90");
//no debris on this level, so spawn some heals and ammo
powerUps.chooseRandomPowerUp(6275, 1425);
powerUps.chooseRandomPowerUp(3350, -1250);
powerUps.chooseRandomPowerUp(6300, -650);
powerUps.chooseRandomPowerUp(9550, -750);
//random blocks
@@ -4463,7 +4448,6 @@ const level = {
spawn.randomMob(4675, -850, 0.1);
spawn.randomMob(4450, -2050, 0.1);
spawn.randomMob(4050, -2325, 0.1);
spawn.randomMob(2850, -2325, 0.1);
spawn.randomMob(3350, -1325, 0.2);
spawn.randomMob(5300, -2050, 0.2);
spawn.randomMob(5675, -2050, 0.2);
@@ -12121,12 +12105,6 @@ const level = {
return bound.has(player.bounds.min) || bound.has(player.bounds.max);
}
function addWIMP(x, y) {
spawn.WIMP(x, y);
const me = mob[mob.length - 1];
me.isWIMP = true;
}
function relocateWIMPs(x, y) {
for (const i of mob) {
if (i.isWIMP) {
@@ -12665,10 +12643,11 @@ const level = {
Promise.resolve().then(() => {
// Clear all WIMPS and their research
for (let i = 0; i < mob.length; i++) {
while (mob[i] && !mob[i].isMACHO) {
mob[i].replace(i);
if (mob[i] && !mob[i].isMACHO) {
mob[i].isWIMP = true;
}
}
relocateWIMPs(0, -10030);
for (let i = 0; i < powerUp.length; i++) {
while (powerUp[i] && powerUp[i].name === "research") {
Matter.Composite.remove(engine.world, powerUp[i]);
@@ -12884,7 +12863,7 @@ const level = {
return this.rings.length;
},
get cap() {
return (this.ringNumber + 1) * 90 + 240;
return this.ringNumber * 90 + 180;
},
get capped() {
return templePlayer.room2.spawnInitiatorCycles > this.cap;
@@ -12919,8 +12898,8 @@ const level = {
y: -300
}), simulation.cycle - 5);
}
if (!this.capped && cycle >= this.cap - 200) {
const multCoeff = (cycle - this.cap + 200) * 0.4
if (!this.capped && cycle >= this.cap - 180) {
const multCoeff = (cycle - this.cap + 180) * 0.4
ctx.translate((Math.random() - 0.5) * multCoeff, (Math.random() - 0.5) * multCoeff);
}
ctx.shadowBlur = 20;
@@ -12930,12 +12909,12 @@ const level = {
DrawTools.arcOut(this.pos.x, this.pos.y, 100, 0, Math.PI * 2);
if (templePlayer.room2.cycles <= 100) {
for (let i = 0; i < this.ringNumber; i++) {
if (cycle < i * 90 + 90) break;
if (cycle < i * 90) break;
const ring = this.rings[i];
ctx.shadowColor = `rgb(${ring.colour.join(",")})`;
const opacity = this.capped ? 1 - 0.01 * templePlayer.room2.cycles : (cycle / 180 - i / 2 - 0.5);
const opacity = this.capped ? 1 - 0.01 * templePlayer.room2.cycles : (cycle / 180 - i / 2);
ctx.strokeStyle = `rgba(${ring.colour.join(",")}, ${Math.min(opacity, 1)})`;
const radius = (this.capped ? 1 + 0.07 * templePlayer.room2.cycles : Math.sin(Math.min(cycle - i * 90 - 90, 45) / 90 * Math.PI)) * ring.radius;
const radius = (this.capped ? 1 + 0.07 * templePlayer.room2.cycles : Math.sin(Math.min(cycle - i * 90, 45) / 90 * Math.PI)) * ring.radius;
DrawTools.arcOut(this.pos.x, this.pos.y, radius, 0, Math.PI * 2);
}
}
@@ -13083,14 +13062,15 @@ const level = {
room0() {
if (templePlayer.startAnim <= 0) return;
templePlayer.startAnim++;
if (templePlayer.startAnim == 120) {
if (templePlayer.startAnim == 60) {
makeLore("Not so fast.");
}
if (templePlayer.startAnim < 360) {
if (templePlayer.startAnim < 180) {
trapPlayer(1000, templePlayer.initialTrapY);
} else {
level.exit.x = 4500;
level.exit.y = -2030;
relocateWIMPs(level.exit.x, level.exit.y);
relocateTo(50, -2050);
simulation.fallHeight = -1000;
// simulation.setZoom(1800);
@@ -13101,49 +13081,31 @@ const level = {
}
},
room1() {
if (templePlayer.room1ToRoom2Anim <= 0) return;
if (templePlayer.room1ToRoom2Anim === 1) {
const frame = templePlayer.room1ToRoom2Anim;
if (frame <= 0) return;
if (frame === 1) {
level.exit.x = -50;
level.exit.y = -10030;
makeLore("Pathetic.");
}
if (templePlayer.room1ToRoom2Anim === 121) {
makeLore("You will never succeed.");
}
if (templePlayer.room1ToRoom2Anim >= 360 && templePlayer.room1ToRoom2Anim <= 720) {
const factor = 200 - 200 * Math.cos((templePlayer.room1ToRoom2Anim / 120 - 3) * Math.PI);
if (frame >= 1 && frame <= 360) {
const factor = 100 - 100 * Math.cos((frame / 90) * Math.PI);
ctx.translate(factor, factor);
Promise.resolve().then(() => {
ctx.save();
ctx.globalCompositeOperation = "color-burn";
ctx.fillStyle = DrawTools.randomColours;
ctx.fillStyle = DrawTools.randomColours((frame) * (360 - frame) / 32400);
DrawTools.updateRandomColours(5);
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.restore();
});
}
if (templePlayer.room1ToRoom2Anim === 720) {
if (frame === 180) {
makeLore("You are trying too hard.");
relocateTo(0, -7050);
simulation.fallHeight = -6000;
templePlayer.stage = 2;
}
if (templePlayer.room1ToRoom2Anim === 960) {
makeLore("I have mastered the understandings of the universe.");
}
if (templePlayer.room1ToRoom2Anim === 1200) {
// Congrats, you discovered the actual words by looking at the source code. Are you happy now?
const x = (
["a speck of dust", "an insignificant hindrance", "a tiny obstacle"]
)[Math.floor(Math.random() * 3)].split("");
for (let i = 0; i < x.length / 1.6; i++) {
const randomIndex = Math.floor(Math.random() * x.length);
if (x[randomIndex] !== " ") {
x[randomIndex] = String.fromCharCode(Math.floor(Math.random() * 50) + 192);
}
};
makeLore(`You are no more than ${x.join("")} to me.</h3></h2>`);
relocateWIMPs(0, -10030);
relocateWIMPs(level.exit.x, level.exit.y - 3000);
}
templePlayer.room1ToRoom2Anim++;
},
@@ -13154,23 +13116,10 @@ const level = {
level.exit.y = -13130;
makeLore("Do not try me.");
}
if (templePlayer.room2ToRoom3Anim >= 1 && templePlayer.room2ToRoom3Anim <= 180) {
canvas.style.filter = `sepia(${templePlayer.room2ToRoom3Anim / 180}) invert(${templePlayer.room2ToRoom3Anim / 180})`;
}
if (templePlayer.room2ToRoom3Anim === 180) {
makeLore("I have absolute power over you.");
canvas.style.filter = "hue-rotate(90deg)";
}
if (templePlayer.room2ToRoom3Anim === 360) {
makeLore("You will not succeed...");
canvas.style.filter = "invert(0.2)";
}
if (templePlayer.room2ToRoom3Anim === 420) {
makeLore("<h6 style='display: inline-block'>...</h6>");
canvas.style.filter = "invert(0.4)";
}
if (templePlayer.room2ToRoom3Anim > 480 && templePlayer.room2ToRoom3Anim <= 660) {
canvas.style.filter = `sepia(${(templePlayer.room2ToRoom3Anim - 480) / 180}) invert(${0.5 + (templePlayer.room2ToRoom3Anim - 480) / 180})`;
}
if (templePlayer.room2ToRoom3Anim === 780) {
makeLore("Do not interfere with me.");
templePlayer.stage = 3;
relocateTo(50, -13150);
simulation.fallHeight = -10000;
@@ -13182,43 +13131,28 @@ const level = {
mob[i].replace(i);
}
}
templePlayer.drawExit = true;
for (let i = 0; i < 5 * tech.wimpCount; i++) {
powerUps.spawn(level.exit.x + 100 * (Math.random() - 0.5), level.exit.y - 100 + 100 * (Math.random() - 0.5), "research", false);
}
canvas.style.filter = "";
}
if (templePlayer.room2ToRoom3Anim > 780 && templePlayer.room2ToRoom3Anim <= 960) {
canvas.style.filter = `sepia(${(960 - templePlayer.room2ToRoom3Anim) / 180}) invert(${(960 - templePlayer.room2ToRoom3Anim) / 180})`;
if (templePlayer.room2ToRoom3Anim > 180 && templePlayer.room2ToRoom3Anim <= 360) {
canvas.style.filter = `sepia(${(360 - templePlayer.room2ToRoom3Anim) / 180}) invert(${(360 - templePlayer.room2ToRoom3Anim) / 180})`;
}
templePlayer.room2ToRoom3Anim++;
},
room3() {
if (templePlayer.room3ToEndAnim <= 0) return;
if (templePlayer.room3ToEndAnim === 1) {
makeLore("No.");
}
if (templePlayer.room3ToEndAnim === 120) {
makeLore("This cannot be.");
}
if (templePlayer.room3ToEndAnim === 240) {
makeLore("Has my power failed me?");
}
if (templePlayer.room3ToEndAnim === 360) {
makeLore("Was it worth it, destroying this place?");
}
if (templePlayer.room3ToEndAnim === 600) {
makeLore("No one is greater than me.");
}
const text = "noone-";
for (let i = 0; i < 12; i++) {
if (templePlayer.room3ToEndAnim === 720 + i * 20) {
name = name.slice(0, -1);
simulation.makeTextLog(`<span style="font-size: 1em"><span style="color: #f00">${name}:</span> &nbsp; ${text[i % 6]}</span>`);
canvas.style.filter = `brightness(${1 - i / 22})`;
}
}
if (templePlayer.room3ToEndAnim === 1060) {
templePlayer.drawExit = true;
for (let i = 0; i < 5 * tech.wimpCount; i++) {
powerUps.spawn(level.exit.x + 100 * (Math.random() - 0.5), level.exit.y - 100 + 100 * (Math.random() - 0.5), "research", false);
}
canvas.style.filter = "";
const x = "Nooooooooooo".split("");
for (let i = 0; i < x.length / 1.6; i++) {
const randomIndex = Math.floor(Math.random() * x.length);
if (x[randomIndex] !== " ") {
x[randomIndex] = String.fromCharCode(Math.floor(Math.random() * 50) + 192);
}
};
makeLore(x.join(""));
}
templePlayer.room3ToEndAnim++;
},
@@ -13227,11 +13161,11 @@ const level = {
Promise.resolve().then(() => {
ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.fillStyle = `rgba(0, 0, 0, ${(simulation.cycle - templePlayer.clearedCycle) / 300})`;
ctx.fillStyle = `rgba(0, 0, 0, ${(simulation.cycle - templePlayer.clearedCycle) / 30})`;
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.restore();
});
if (simulation.cycle - templePlayer.clearedCycle > 420) level.nextLevel();
if (simulation.cycle - templePlayer.clearedCycle > 30) level.nextLevel();
}
};
const LogicHandler = {
@@ -13383,7 +13317,7 @@ const level = {
const roomConditions = [
isInBound(firstRoomBounds) && templePlayer.room1.cycles < 2400,
isInBound(secondRoomBounds) && templePlayer.room2.cycles > 0 && templePlayer.room2.cycles < 2160,
isInBound(thirdRoomBounds) && templePlayer.room2ToRoom3Anim < 1320
isInBound(thirdRoomBounds) && templePlayer.room2ToRoom3Anim < 540
];
Promise.resolve(roomConditions).then(roomConditions => {
// First Room
@@ -13413,7 +13347,7 @@ const level = {
ctx.fillStyle = "#0004";
ctx.fillRect(canvas.width2 - 288, 50, 576, 20);
ctx.fillStyle = "#000";
ctx.fillRect(canvas.width2 - 288, 50, 1.6 * (1320 - templePlayer.room2ToRoom3Anim), 20);
ctx.fillRect(canvas.width2 - 288, 50, 1.6 * (540 - templePlayer.room2ToRoom3Anim), 20);
ctx.restore();
}
});
@@ -13465,7 +13399,7 @@ const level = {
}
},
room3() {
if (templePlayer.room2ToRoom3Anim === 1320) {
if (templePlayer.room2ToRoom3Anim === 540) {
thirdRoomBoss(1800, -13700);
for (let i = 0; i < 3; i++) {
powerUps.spawn(m.spawnPos.x, m.spawnPos.y, "heal");
@@ -13474,8 +13408,8 @@ const level = {
}
};
const DrawTools = {
get randomColours() {
return `rgb(${this._randomColours.join(",")})`
randomColours(alpha = 1) {
return `rgba(${this._randomColours.join(",")},${alpha})`
},
_randomColours: [Math.random() * 255, Math.random() * 255, Math.random() * 255],
updateRandomColours(x = 0.8) {