laserLayer

mob: laserLayer - leaves behind lasers that persist for a few seconds
ghoster mobs do 66% less damage, but they eject your ammo

grappling hook tech rupture renamed swarf
  fires several nails at nearby mobs, not explosions
grappling hook 6->9 energy per second
CIWS 18->10 energy
reel +40->75 energy reeling blocks
wormhole 5->7% duplication
cloaking no longer drains energy, this fixes a can't cloak bug
  dazzler no longer drains energy
    dazzler range reduced by 15%
    dazzler stuns for 3->2 seconds
zero point energy 100->166 max energy
expansion 40->77 max energy
annihilation -33% of max energy -> 10 energy
dynamical systems is no longer a field tech  35->30 damage
tessellation is no longer a field tech  50->35 defense
yield stress removed
  topological defect 80->111% damage
  brittle 80->111% damage
commodities exchange  6-12 -> 10-14 power ups
heat engine 50->40% damage
flame test grenades clusters explode 40% faster
alternator uses 10->0% energy for harpoon

finally made a shared vertexCollision function
  this might cause some bugs with laser-like effects...
This commit is contained in:
landgreen
2024-02-24 15:09:35 -08:00
parent b5e4b0db03
commit 38d993154c
13 changed files with 684 additions and 1808 deletions

View File

@@ -19,26 +19,26 @@ const level = {
// simulation.enableConstructMode() //tech.giveTech('motion sickness') //used to build maps in testing mode
// simulation.isHorizontalFlipped = true
// tech.giveTech("performance")
// level.difficultyIncrease(8 * 2) //30 is near max on hard //60 is near max on why
// m.maxHealth = m.health = 1
// level.difficultyIncrease(3 * 2) //30 is near max on hard //60 is near max on why
// m.maxHealth = m.health = 100000000
// m.maxEnergy = m.energy = 10000000
// tech.isRerollDamage = true
// powerUps.research.changeRerolls(99999)
// m.immuneCycle = Infinity //you can't take damage
// tech.tech[297].frequency = 100
// m.couplingChange(10)
// m.setField("metamaterial cloaking") //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.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
// tech.isHookWire = true
// m.energy = 0
// simulation.molecularMode = 2
// m.damage(0.1);
// 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("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("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("Higgs mechanism") });
// for (let i = 0; i < 1; ++i) tech.giveTech("optical amplifier")
// for (let i = 0; i < 1; ++i) tech.giveTech("depolarization")
// for (let i = 0; i < 1; ++i) tech.giveTech("flame test")
// for (let i = 0; i < 1; ++i) tech.giveTech("dazzler")
// for (let i = 0; i < 1; ++i) tech.giveTech("mass production")
// requestAnimationFrame(() => { for (let i = 0; i < 10; i++) tech.giveTech("orbital-bot") });
// requestAnimationFrame(() => { for (let i = 0; i < 10; i++) b.orbitBot(m.pos, false) });
@@ -46,26 +46,30 @@ const level = {
// for (let i = 0; i < 1; i++) tech.giveTech("tungsten carbide")
// m.lastKillCycle = m.cycle
// for (let i = 0; i < 1; ++i) tech.giveTech("depolarization")
// for (let i = 0; i < 1; ++i) tech.giveTech("swarf")
// for (let i = 0; i < 1; ++i) tech.giveTech("CPT symmetry")
// 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");
// level.arena();
// spawn.mapRect(575, -700, 25, 425); //block mob line of site on testing
// level.testing();
// for (let i = 0; i < 4; ++i) spawn.hopMother(1900, -500)
// for (let i = 0; i < 4; ++i) spawn.stinger(1900, -500)
// for (let i = 0; i < 1; ++i) spawn.timeSkipBoss(1900, -2500)
// 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 < 3; ++i) spawn.laser(1900, -500)
// for (let i = 0; i < 1; ++i) spawn.laserBombingBoss(1900, -2500)
// spawn.beetleBoss(1900, -500, 25)
// spawn.slasher2(2000, -1150)
// 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)
// tech.tech[322].frequency = 100
// spawn.tetherBoss(1900, -500, { x: 1900, y: -500 })
// for (let i = 0; i < 40; ++i) tech.giveTech()
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
// spawn.bodyRect(2425, -120, 200, 200);
// console.log(body[body.length - 1].mass)
// simulation.isAutoZoom = false; //look in close
@@ -289,8 +293,8 @@ const level = {
simulation.updateTechHUD();
simulation.clearNow = true; //triggers in simulation.clearMap to remove all physics bodies and setup for new map
//pop up new level info screen for a few seconds
if (!localSettings.isHideHUD && !simulation.isChoosing && !simulation.isCheating && m.alive && (level.levels[level.onLevel] === "final" || level.levels[level.onLevel] === "reactor" || level.levels[level.onLevel] === "subway")) {
//pop up new level info screen for a few seconds //|| level.levels[level.onLevel] === "subway"
if (!localSettings.isHideHUD && !simulation.isCheating && m.alive && (level.levels[level.onLevel] === "final" || level.levels[level.onLevel] === "reactor")) {
//pause
if (!simulation.paused) {
simulation.paused = true;
@@ -325,7 +329,7 @@ const level = {
simulation.draw.cons();
simulation.draw.body();
level.customTopLayer();
let count = countMax = simulation.testing ? 0 : 180
let count = countMax = simulation.testing ? 0 : 240
let newLevelDraw = () => {
count--
if (count > 0) {
@@ -346,40 +350,46 @@ const level = {
simulation.wipe();
m.look();
simulation.camera();
// if (count < 30) {
// }
// if (count < 60) {
// simulation.draw.cons();
// simulation.draw.body();
// level.customTopLayer();
// simulation.draw.body();
// simulation.draw.drawMapPath();
// mobs.draw();
// } else
// if (count < 240) {
// ctx.lineDashOffset = 900 * Math.random()
// ctx.setLineDash([3, -8 + 0.5 * count]);
const scale = 10
const scale = 15
ctx.setLineDash([scale * (countMax - count), scale * count]);
simulation.draw.wireFrame();
ctx.setLineDash([]);
// }
// else if (count === 91) { //hide text boss
// document.getElementById("choose-grid").style.opacity = "0"
// setTimeout(() => {
// document.getElementById("choose-grid").style.visibility = "hidden"
// }, 1000);
// }
ctx.restore();
simulation.drawCursor();
}
requestAnimationFrame(newLevelDraw);
}
// else {
// //pause
// if (!simulation.paused) {
// simulation.paused = true;
// simulation.isChoosing = true; //stops p from un pausing on key down
// }
// let count = countMax = simulation.testing ? 0 : 60
// let newLevelDraw = () => {
// count--
// if (count > 0) {
// requestAnimationFrame(newLevelDraw);
// } else { //unpause
// // if (m.immuneCycle < m.cycle + 15) m.immuneCycle = m.cycle + 30; //player is immune to damage for 30 cycles
// if (simulation.paused) requestAnimationFrame(cycle);
// if (m.alive) simulation.paused = false;
// simulation.isChoosing = false; //stops p from un pausing on key down
// build.unPauseGrid()
// }
// //draw
// simulation.wipe();
// m.look();
// simulation.camera();
// const scale = 30
// ctx.setLineDash([scale * (countMax - count), scale * count]);
// simulation.draw.wireFrame();
// ctx.setLineDash([]);
// ctx.restore();
// simulation.drawCursor();
// }
// requestAnimationFrame(newLevelDraw);
// }
}
},
unPause() {