From e874f0f7378070b50a78022f572829975d094a4d Mon Sep 17 00:00:00 2001 From: landgreen Date: Thu, 6 May 2021 17:33:07 -0700 Subject: [PATCH] new COMMUNITY LEVEL vats new COMMUNITY LEVEL vats by Dablux on discord! (also the community map order wasn't randomizing right and was giving an extra level before the final boss) --- .DS_Store | Bin 6148 -> 6148 bytes js/level.js | 452 ++++++++++++++++++++++++++++++++++++++++++++++- js/simulation.js | 13 +- js/tech.js | 18 +- todo.txt | 10 +- 5 files changed, 468 insertions(+), 25 deletions(-) diff --git a/.DS_Store b/.DS_Store index 36d56b8b5d90676e9d4a067e28141e750ede9cee..857abb7b490977c710b07bff02ee756002be29aa 100644 GIT binary patch delta 21 ccmZoMXffEJ#mv;3Fj 3) { + spawn.randomLevelBoss(1900, 400, ["shieldingBoss", "shooterBoss", "launcherBoss", "streamBoss"]) + } else { + exitDoor.isOpen = false; + } + if (tech.isDuplicateBoss && Math.random() < 2 * tech.duplicationChance()) spawn.randomLevelBoss(800, -800); + + powerUps.spawn(4450, 1050, "heal"); + if (Math.random() > (0.2 + (simulation.difficulty / 60))) { + powerUps.spawn(4500, 1050, "ammo"); + powerUps.spawn(4550, 1050, "ammo"); + } else { + powerUps.spawn(4500, 1050, "tech"); + spawn.randomMob(4550, 1050, Infinity); + } + powerUps.spawnStartingPowerUps(3750, -940) + + const W = 500; + const H = 20; + for (let i = 1; i < 5; i++) { + spawn.bodyRect(700 + (i * 100) + (W * (i - 1)), 1110, W, H, 1, spawn.propsIsNotHoldable) + let b = body[body.length - 1]; + cons[cons.length] = Constraint.create({ + pointA: { + x: b.position.x - (W / 2) + 50, + y: b.position.y - 1025 + }, + bodyB: b, + pointB: { + x: -(W / 2) + 50, + y: 0 + }, + stiffness: 0.002, + length: 1000 + }); + cons[cons.length] = Constraint.create({ + pointA: { + x: b.position.x + (W / 2) - 50, + y: b.position.y - 1025 + }, + bodyB: b, + pointB: { + x: (W / 2) - 50, + y: 0 + }, + stiffness: 0.002, + length: 1000 + }); + World.add(engine.world, [cons[cons.length - 1], cons[cons.length - 2]]) + } + + level.custom = () => { + level.playerExitCheck() + + buttonGreen.query() + buttonYellow.query() + buttonRed.query() + + if (!buttonGreen.isUp) { + if (!g) { + Matter.World.remove(engine.world, cons[1]) + cons.splice(1, 2) + } + g = true; + } + if (!buttonYellow.isUp) { + y = true; + } + if (!buttonRed.isUp) { + r = true; + } + + if (g && y && r) { + door.isOpen = false; + } else { + door.isOpen = true; + } + + door.openClose() + exitDoor.openClose() + + if (m.pos.y > 1600 && 700 < m.pos.x && m.pos.x < 3200) { // Saving player from slime pit + Matter.Body.setVelocity(player, { + x: 0, + y: 0 + }); + Matter.Body.setPosition(player, { + x: 200, + y: 1000 + }); + // move bots + for (let i = 0; i < bullet.length; i++) { + if (bullet[i].botType) { + Matter.Body.setPosition(bullet[i], Vector.add(player.position, { + x: 250 * (Math.random() - 0.5), + y: 250 * (Math.random() - 0.5) + })); + Matter.Body.setVelocity(bullet[i], { + x: 0, + y: 0 + }); + } + } + m.damage(0.1 * simulation.difficultyMode) + m.energy -= 0.1 * simulation.difficultyMode + } + + if (simulation.cycle >= nextBlockSpawn && body.length < 100) { + var len = body.length; + body[len] = Matter.Bodies.polygon(Math.floor(Math.random() * 1700) + 1050, 100, Math.floor(Math.random() * 11) + 10, Math.floor(Math.random() * 20) + 15) + body[len].collisionFilter.category = cat.body; + body[len].collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet; + World.add(engine.world, body[len]) + nextBlockSpawn = simulation.cycle + Math.floor(Math.random() * 60 + 30) + } + + if (exitDoor.isOpen) { + exitDoor.isOpen = false; + for (i = 0; i < mob.length; i++) { + if (mob[i].isBoss && 525 < mob[i].position.x < 3200 && -2500 < mob[i].position.y < 100) { + exitDoor.isOpen = true; + } + } + } + + for (let i = 0, len = body.length; i < len; i++) { + if (body[i].position.x > 700 && body[i].position.x < 3200 && body[i].position.y > 1200 && !body[i].isNotHoldable) { + Matter.Body.scale(body[i], 0.99, 0.99); + if (body[i].velocity.y > 3) body[i].force.y -= 0.96 * body[i].mass * simulation.g + const slowY = (body[i].velocity.y > 0) ? Math.max(0.3, 1 - 0.0015 * body[i].velocity.y * body[i].velocity.y) : Math.max(0.98, 1 - 0.001 * Math.abs(body[i].velocity.y)) //down : up + Matter.Body.setVelocity(body[i], { + x: Math.max(0.6, 1 - 0.07 * Math.abs(body[i].velocity.x)) * body[i].velocity.x, + y: slowY * body[i].velocity.y + }); + if (body[i].mass < 0.05) { + Matter.World.remove(engine.world, body[i]) + body.splice(i, 1) + break + } + } + } + + for (let i = 0, len = mob.length; i < len; ++i) { + if (mob[i].position.x > 700 && mob[i].position.x < 3200 && mob[i].alive && !mob[i].isShielded && mob[i].position.y > 1200) { + mobs.statusDoT(mob[i], 0.005, 30) + } + } + + ctx.beginPath() + ctx.fillStyle = "#666"; + ctx.arc(buttonGreen.min.x - 50, buttonGreen.min.y - 70, 20, 0, 2 * Math.PI) + ctx.fillRect(buttonGreen.min.x - 55, buttonGreen.max.y + 25, 10, -95) + ctx.fill() + ctx.beginPath() + ctx.arc(buttonYellow.min.x - 50, buttonYellow.min.y - 70, 20, 0, 2 * Math.PI) + ctx.fillRect(buttonYellow.min.x - 55, buttonYellow.max.y + 25, 10, -95) + ctx.fill() + ctx.beginPath() + ctx.arc(buttonRed.min.x - 50, buttonRed.min.y - 70, 20, 0, 2 * Math.PI) + ctx.fillRect(buttonRed.min.x - 55, buttonRed.max.y + 25, 10, -95) + ctx.fill() + + ctx.beginPath() + ctx.arc(buttonGreen.min.x - 50, buttonGreen.min.y - 70, 10, 0, 2 * Math.PI) + ctx.fillStyle = (g ? `rgba(0, 255, 0, 0.9)` : `rgba(255, 0, 0, 0.9)`); + ctx.fill() + ctx.beginPath() + ctx.arc(buttonYellow.min.x - 50, buttonYellow.min.y - 70, 10, 0, 2 * Math.PI) + ctx.fillStyle = (y ? `rgba(0, 255, 0, 0.9)` : `rgba(255, 0, 0, 0.9)`); + ctx.fill() + ctx.beginPath() + ctx.arc(buttonRed.min.x - 50, buttonRed.min.y - 70, 10, 0, 2 * Math.PI) + ctx.fillStyle = (r ? `rgba(0, 255, 0, 0.9)` : `rgba(255, 0, 0, 0.9)`); + ctx.fill() + + slimePit.query(); + ctx.shadowColor = 'hsla(160, 100%, 50%, 1)' + ctx.shadowBlur = 100; + slimePit.draw() + ctx.shadowBlur = 0; + ctx.shadowColor = 'rgba(0, 0, 0, 0)' + topSlime.query(); + deliveryButton.query() + deliverySlime.query() + deliverySlime2.query() + portal[2].query() + //portal[3].query() + portal2[2].query() + //portal2[3].query() + + deliverySlime.level(deliveryButton.isUp) + topSlime.level(!r) + rotor.rotate() + + ctx.fillStyle = "#d4f4f4" + ctx.fillRect(3500, 675, 600, 450) + level.exit.draw() + level.enter.draw() + } + + level.customTopLayer = () => { + drip1.draw() + drip2.draw() + drip3.draw() + + ctx.fillStyle = `rgba(68, 68, 68, ${Math.max(0.3, Math.min((4200 - m.pos.x) / 100, 0.99))})` + ctx.fillRect(4100, 650, 850, 500) + + ctx.fillStyle = "rgba(200,0,255,0.2)"; //boosts + ctx.fillRect(4400, -1410, 100, 25); + ctx.fillStyle = "rgba(200,0,255,0.1)"; //boosts + ctx.fillRect(4400, -1440, 100, 55); + ctx.fillStyle = "rgba(200,0,255,0.05)"; //boosts + ctx.fillRect(4400, -1505, 100, 120); + + ctx.fillStyle = "rgba(0,20,40,0.1)" + ctx.fillRect(4025, -1300, 475, 300) + ctx.fillRect(3325, -1000, 375, 600) + ctx.fillRect(425, 100, 3050, 2400) + ctx.fillRect(-1775, 800, 1750, 2100) + ctx.fillStyle = "rgba(0,20,40,0.2)" + ctx.fillRect(2725, -860, 450, 460) + ctx.fillRect(2125, -760, 450, 360) + ctx.fillRect(1525, -660, 450, 260) + ctx.fillRect(925, -560, 450, 160) + ctx.fillRect(3700, -980, 100, 1200) + + ctx.fillStyle = `#444`; + ctx.fillRect(465, 690, 70, 209) + ctx.fillRect(3365, 690, 70, 209) + + ctx.beginPath() + ctx.arc(500, 870, 20, 0, 2 * Math.PI) + ctx.arc(500, 820, 20, 0, 2 * Math.PI) + ctx.arc(500, 770, 20, 0, 2 * Math.PI) + ctx.fillStyle = "rgba(0, 0, 0, 0.3"; + ctx.fill() + + ctx.beginPath() + ctx.arc(500, 870, 10, 0, 2 * Math.PI) + ctx.fillStyle = (g ? `rgba(0, 255, 0, 0.9)` : `rgba(255, 0, 0, 0.9)`); + ctx.fill() + ctx.beginPath() + ctx.arc(500, 820, 10, 0, 2 * Math.PI) + ctx.fillStyle = (y ? `rgba(0, 255, 0, 0.9)` : `rgba(255, 0, 0, 0.9)`); + ctx.fill() + ctx.beginPath() + ctx.arc(500, 770, 10, 0, 2 * Math.PI) + ctx.fillStyle = (r ? `rgba(0, 255, 0, 0.9)` : `rgba(255, 0, 0, 0.9)`); + ctx.fill() + + deliveryButton.draw() + deliverySlime.draw() + deliverySlime2.draw() + topSlime.draw() + buttonGreen.draw() + buttonYellow.draw() + buttonRed.draw() + portal[0].draw() + portal[2].draw() + portal2[0].draw() + portal2[2].draw() + } + }, }; \ No newline at end of file diff --git a/js/simulation.js b/js/simulation.js index 52e8dbd..5e28d98 100644 --- a/js/simulation.js +++ b/js/simulation.js @@ -522,24 +522,23 @@ const simulation = { level.levels.push("stronghold"); level.levels.push("basement"); level.levels.push("crossfire"); + level.levels.push("vats") level.levels.push("house"); level.levels.push("perplex"); level.levels.push("coliseum"); + level.levels = shuffle(level.levels); //shuffles order of maps + level.levels.splice(0, 7); //remove some random levels to make up for adding the community levels - - // level.levels.push("vats"); - level.levels.splice(0, 5); //remove some random levels to make up for adding the community levels - - //remove undefined tech for community maps - lore.techCount = 0; + lore.techCount = 0; //remove undefined tech for community maps for (let i = 0, len = tech.tech.length; i < len; i++) { if (tech.tech[i].isLore) { tech.tech[i].frequency = 0; tech.tech[i].count = 0; } } + } else { + level.levels = shuffle(level.levels); //shuffles order of maps } - level.levels = shuffle(level.levels); //shuffles order of maps level.levels.unshift("intro"); //add level to the start of the randomized levels list level.levels.push("gauntlet"); //add level to the end of the randomized levels list level.levels.push("final"); //add level to the end of the randomized levels list diff --git a/js/tech.js b/js/tech.js index ddd5ab1..f224164 100644 --- a/js/tech.js +++ b/js/tech.js @@ -2484,7 +2484,7 @@ description: "after dying, continue in an alternate reality
reduce harm by 23%", //spawn 4 research maxCount: 1, count: 0, - frequency: 2, + frequency: 4, allowed() { return !tech.isSwitchReality && !tech.isResearchReality && tech.isDeathAvoid }, @@ -2505,9 +2505,9 @@ frequency: 1, frequencyDefault: 1, allowed() { - return !tech.isImmortal && !tech.isResearchReality && level.onLevel < 6 + return !tech.isImmortal && !tech.isResearchReality && level.onLevel < 6 && !tech.isCollisionRealitySwitch }, - requires: "before level 6, not quantum immortality, Ψ(t) collapse", + requires: "before level 6, not quantum immortality, Ψ(t) collapse, non-unitary", effect() { tech.isSwitchReality = true; }, @@ -2517,15 +2517,15 @@ }, { name: "non-unitary operator", - description: "after a collision enter an alternate reality
reduce combat difficulty by 2 levels", + description: "reduce combat difficulty by 2 levels
after a collision enter an alternate reality", maxCount: 1, count: 0, frequency: 1, frequencyDefault: 1, allowed() { - return !tech.isImmortal && !tech.isResearchReality + return !tech.isImmortal && !tech.isResearchReality && !tech.isSwitchReality }, - requires: "not quantum immortality, Ψ(t) collapse", + requires: "not quantum immortality, Ψ(t) collapse, many-worlds", effect() { tech.isCollisionRealitySwitch = true; level.difficultyDecrease(simulation.difficultyMode * 2) @@ -2545,9 +2545,9 @@ frequency: 1, frequencyDefault: 1, allowed() { - return !tech.isImmortal && !tech.isSwitchReality + return !tech.isImmortal && !tech.isSwitchReality && !tech.isCollisionRealitySwitch }, - requires: "not quantum immortality, many-worlds", + requires: "not quantum immortality, many-worlds, non-unitary", effect() { tech.isResearchReality = true; for (let i = 0; i < 12; i++) powerUps.spawn(m.pos.x + Math.random() * 10, m.pos.y + Math.random() * 10, "research", false); @@ -3702,7 +3702,7 @@ }, requires: "wave beam", effect() { - tech.waveFrequency *= 0.5 + tech.waveFrequency *= 0.66 tech.wavePacketDamage *= 1.5 }, remove() { diff --git a/todo.txt b/todo.txt index 1c81d86..5595e0b 100644 --- a/todo.txt +++ b/todo.txt @@ -1,10 +1,7 @@ ******************************************************** NEXT PATCH ******************************************************** -more wave beam balance -backward induction costs 2 research now, also it is fixed (it would sometimes give an extra tech or the wrong tech) -powerupBoss now gives research and ammo when it hits you, not 2 heals (it still ejects one of your tech also) - -tech: non-unitary operator - taking damage randomizes your run, reduce difficulty by 2 levels +new COMMUNITY LEVEL vats by Dablux on discord! +(also the community map order wasn't randomizing right and was giving an extra level before the final boss) ******************************************************** BUGS ******************************************************** @@ -42,6 +39,9 @@ is there a way to check if the player is stuck inside the map or block (repeatable almost every time) bug - mines spawn extra mines when fired at thin map wall while jumping ******************************************************** TODO ******************************************************** +make all of a packet have the same angle + also position? but how +spawn the entire packet in an instant wave tech: delay similar to quantum foam firing makes the entire packet, but with a delay?